From 97719d78bd5de125c9d1d395ff4e7998fdad6e79 Mon Sep 17 00:00:00 2001 From: bsavitzky Date: Mon, 17 Jul 2023 11:13:24 -0400 Subject: [PATCH] Revert "bugfix for resampled pixel size" --- py4DSTEM/preprocess/preprocess.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/py4DSTEM/preprocess/preprocess.py b/py4DSTEM/preprocess/preprocess.py index c72240b4c..162b9a32d 100644 --- a/py4DSTEM/preprocess/preprocess.py +++ b/py4DSTEM/preprocess/preprocess.py @@ -649,7 +649,12 @@ def resample_data_diffraction( if not resampling_factor: resampling_factor = old_size[2] / output_size[0] if datacube.calibration.get_Q_pixel_size() is not None: - datacube.calibration.set_Q_pixel_size(datacube.calibration.get_Q_pixel_size() * resampling_factor) + datacube.calibration.set_Q_pixel_size(datacube.calibration.get_Q_pixel_size() / resampling_factor) + + if not resampling_factor: + resampling_factor = old_size[2] / output_size[0] + if datacube.calibration.get_Q_pixel_size() is not None: + datacube.calibration.set_Q_pixel_size(datacube.calibration.get_Q_pixel_size() / resampling_factor) elif method == "bilinear": from scipy.ndimage import zoom