Commit 37713ab9 authored by Nicola Vigano's avatar Nicola Vigano
Browse files

Alignment: fixed bug due to out-dated variable content



Thanks Alessandro for spotting this
Signed-off-by: Nicola Vigano's avatarNicola VIGANÒ <nicola.vigano@esrf.fr>
parent 081c272b
Pipeline #28023 failed with stages
in 6 minutes and 48 seconds
......@@ -514,6 +514,7 @@ class CenterOfRotation(AlignmentBase):
img_2 = self._prepare_image(img_2, roi_yxhw=roi_yxhw, median_filt_shape=median_filt_shape)
cc = self._compute_correlation_fft(img_1, img_2, padding_mode, high_pass=high_pass, low_pass=low_pass)
img_shape = img_2.shape
cc_vs = np.fft.fftfreq(img_shape[-2], 1 / img_shape[-2])
cc_hs = np.fft.fftfreq(img_shape[-1], 1 / img_shape[-1])
......@@ -628,9 +629,6 @@ class DetectorTranslationAlongBeam(AlignmentBase):
img_stack = self._prepare_image(img_stack, roi_yxhw=roi_yxhw, median_filt_shape=median_filt_shape)
cc_vs = np.fft.fftfreq(img_shape[-2], 1 / img_shape[-2])
cc_hs = np.fft.fftfreq(img_shape[-1], 1 / img_shape[-1])
# do correlations
ccs = [
self._compute_correlation_fft(
......@@ -643,6 +641,10 @@ class DetectorTranslationAlongBeam(AlignmentBase):
for ii in range(1, num_imgs)
]
img_shape = img_stack.shape[-2:]
cc_vs = np.fft.fftfreq(img_shape[-2], 1 / img_shape[-2])
cc_hs = np.fft.fftfreq(img_shape[-1], 1 / img_shape[-1])
shifts_vh = np.empty((num_imgs - 1, 2))
for ii, cc in enumerate(ccs):
(f_vals, fv, fh) = self.extract_peak_region_2d(cc, peak_radius=peak_fit_radius, cc_vs=cc_vs, cc_hs=cc_hs)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment