diff --git a/src/calng/corrections/Epix100Correction.py b/src/calng/corrections/Epix100Correction.py index b541a72af5a96d70cd320140026284e0bfb40ace..a469c0ee9cf500bebdbfadf62d3d44667afda390 100644 --- a/src/calng/corrections/Epix100Correction.py +++ b/src/calng/corrections/Epix100Correction.py @@ -213,12 +213,9 @@ class Epix100CpuRunner(base_kernel_runner.BaseKernelRunner): if config.has("corrections.commonMode.enableBlock"): self._cm_block = config["corrections.commonMode.enableBlock"] - def expected_input_data_shape(self, num_frames): - assert num_frames == 1 - return ( - self.num_pixels_ss, - self.num_pixels_fs, - ) + def expected_input_shape(self, num_frames): + assert num_frames == 1, "ePix not expected to have multiple frames" + return (self.num_pixels_ss, self.num_pixels_fs) def _expected_output_shape(self, num_frames): return (self.num_pixels_ss, self.num_pixels_fs) @@ -393,6 +390,10 @@ class Epix100Correction(base_correction.BaseCorrection): def _get_data_from_hash(self, data_hash): image_data = data_hash.get(self._image_data_path) + if self.unsafe_get("workarounds.overrideInputAxisOrder"): + expected_shape = self.kernel_runner.expected_input_shape(1) + if expected_shape != image_data.shape: + image_data.shape = expected_shape return ( 1, image_data, diff --git a/src/calng/corrections/PnccdCorrection.py b/src/calng/corrections/PnccdCorrection.py index 0156e2001508255245b8ca66490f07f01b759ec0..1235334247e5c7eccdf3efa3901e87130ba87bfd 100644 --- a/src/calng/corrections/PnccdCorrection.py +++ b/src/calng/corrections/PnccdCorrection.py @@ -390,6 +390,10 @@ class PnccdCorrection(base_correction.BaseCorrection): def _get_data_from_hash(self, data_hash): image_data = data_hash.get(self._image_data_path) + if self.unsafe_get("workarounds.overrideInputAxisOrder"): + expected_shape = self.kernel_runner.expected_input_shape(1) + if expected_shape != image_data.shape: + image_data.shape = expected_shape return ( 1, image_data,