From a81e62fe09dfc9e0b1afd86cdbf297c668d0e9e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Le=20Guyader?= <loic.le.guyader@xfel.eu> Date: Fri, 13 May 2022 10:17:11 +0200 Subject: [PATCH] Simplification --- src/toolbox_scs/routines/boz.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/toolbox_scs/routines/boz.py b/src/toolbox_scs/routines/boz.py index bdfeb1e..5703ce3 100644 --- a/src/toolbox_scs/routines/boz.py +++ b/src/toolbox_scs/routines/boz.py @@ -273,13 +273,13 @@ def _plane_flat_field(p, roi): return Z -def compute_flat_field_correction(rois, p, plot=False): +def compute_flat_field_correction(rois, plane, plot=False): """Compute the plane field correction on beam rois. Inputs ------ rois: dictionnary of beam rois['n', '0', 'p'] - p: plane vector + plane: 2 plane vector concatenated plot: boolean, True by default, diagnostic plot Returns @@ -289,12 +289,12 @@ def compute_flat_field_correction(rois, p, plot=False): """ flat_field = np.ones((128, 512)) - r = 'n' - flat_field[rois[r]['yl']:rois[r]['yh'], rois[r]['xl']:rois[r]['xh']] = \ - _plane_flat_field(p[:4], rois[r]) - r = 'p' - flat_field[rois[r]['yl']:rois[r]['yh'], rois[r]['xl']:rois[r]['xh']] = \ - _plane_flat_field(p[4:], rois[r]) + r = rois['n'] + flat_field[r['yl']:r['yh'], r['xl']:r['xh']] = \ + _plane_flat_field(plane[:4], r) + r = rois['p'] + flat_field[r['yl']:r['yh'], r['xl']:r['xh']] = \ + _plane_flat_field(plane[4:], r) if plot: f, ax = plt.subplots(1, 1, figsize=(6, 2)) -- GitLab