diff --git a/src/toolbox_scs/routines/boz.py b/src/toolbox_scs/routines/boz.py index bdfeb1e0d76c56491f6c679472211a8d1f5e7aca..5703ce3c1c0d055ec7118ce71eb352de07f70c78 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))