Skip to content
Snippets Groups Projects

Fix for the BOZ analysis

Merged Loïc Le Guyader requested to merge boz-fix into master
1 file
+ 11
13
Compare changes
  • Side-by-side
  • Inline
@@ -795,26 +795,24 @@ def inspect_plane_fitting(avg, rois, vmin=None, vmax=None):
@@ -795,26 +795,24 @@ def inspect_plane_fitting(avg, rois, vmin=None, vmax=None):
fig, axs = plt.subplots(2, 3, sharex=True, figsize=(6, 6))
fig, axs = plt.subplots(2, 3, sharex=True, figsize=(6, 6))
img_rois = {}
img_rois = {}
 
centers = {}
 
 
for k, r in enumerate(['n', '0', 'p']):
 
roi = rois[r]
 
centers[r] = np.array([(roi['yl'] + roi['yh'])//2,
 
(roi['xl'] + roi['xh'])//2])
 
d = '0'
 
roi = rois[d]
for k, r in enumerate(['n', '0', 'p']):
for k, r in enumerate(['n', '0', 'p']):
img_rois[r] = avg[rois[r]['yl']:rois[r]['yh'],
img_rois[r] = np.roll(avg, tuple(centers[r] - centers[d]))[
rois[r]['xl']:rois[r]['xh']]
roi['yl']:roi['yh'], roi['xl']:roi['xh']]
im = axs[0, k].imshow(img_rois[r],
im = axs[0, k].imshow(img_rois[r],
vmin=vmin,
vmin=vmin,
vmax=vmax)
vmax=vmax)
for k, r in enumerate(['n', '0', 'p']):
for k, r in enumerate(['n', '0', 'p']):
if img_rois[r].shape[1] != img_rois['0'].shape[1]:
v = img_rois[r]/img_rois['0']
if k == 0:
n1 = img_rois[r].shape[1]
n = img_rois['0'].shape[1]
v = img_rois[r][:, (n1-n):]/img_rois['0']
else:
n1 = img_rois[r].shape[1]
n = img_rois['0'].shape[1]
v = img_rois[r][:, :-(n1-n)]/img_rois['0']
else:
v = img_rois[r]/img_rois['0']
im2 = axs[1, k].imshow(v, vmin=0.2, vmax=1.1, cmap='RdBu_r')
im2 = axs[1, k].imshow(v, vmin=0.2, vmax=1.1, cmap='RdBu_r')
cbar = fig.colorbar(im, ax=axs[0, :], orientation="horizontal")
cbar = fig.colorbar(im, ax=axs[0, :], orientation="horizontal")
Loading