Skip to content
Snippets Groups Projects
Commit 3d9eebd1 authored by David Hammer's avatar David Hammer
Browse files

Use workarounds.overrideInputAxisOrder in slow detectors

parent 49a4cbe2
Branches epix-fix-input-data-shape
No related tags found
1 merge request!107pnCCD and ePix: Fix input data shape if DAQ sends something funny
......@@ -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,
......
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment