diff --git a/pes_to_spec/model.py b/pes_to_spec/model.py index d0b22592a6e5dda8f32fc0d2091800e3fe2de170..0e038dd7321f6cb09a949735e0b56bd4fb7a7892 100644 --- a/pes_to_spec/model.py +++ b/pes_to_spec/model.py @@ -440,10 +440,10 @@ class SelectRelevantLowResolution(TransformerMixin, BaseEstimator): """ # reduce on channel and on train ID sum_low_res = - np.mean(sum(list(X.values())), axis=0) - axis = np.arange(0.0, sum_low_res.shape[1], 1.0) + axis = np.arange(0.0, sum_low_res.shape[0], 1.0) #widths = np.arange(10, 50, step=5) #peak_idx = find_peaks_cwt(sum_low_res, widths) - gaussian = np.exp(-0.5*(axis - sum_low_res.shape[1]//2)**2/20**2) + gaussian = np.exp(-0.5*(axis - sum_low_res.shape[0]//2)**2/20**2) gaussian /= np.sum(gaussian, axis=1, keepdims=True) # apply it to the data smoothened = fftconvolve(sum_low_res, gaussian, mode="same", axes=1) diff --git a/pes_to_spec/test/offline_analysis.py b/pes_to_spec/test/offline_analysis.py index d1fcf77cf7621515cde1303a22fdf4a23ce6b68c..d433fc9142dc9ff67253cb604f8539c38eec369f 100755 --- a/pes_to_spec/test/offline_analysis.py +++ b/pes_to_spec/test/offline_analysis.py @@ -139,8 +139,8 @@ def main(): print("Opening run ...") # get run - #run = open_run(proposal=args.proposal, run=args.run) - run = RunDirectory("/gpfs/exfel/data/scratch/tmichela/data/r0206") + run = open_run(proposal=args.proposal, run=args.run) + #run = RunDirectory("/gpfs/exfel/data/scratch/tmichela/data/r0206") # ----------------Used in the first tests------------------------- # get train IDs and match them, so we are sure to have information from all needed sources