Skip to content
Snippets Groups Projects
Commit 29d1db58 authored by Steffen Hauf's avatar Steffen Hauf
Browse files

Overrides for GOTTHARD-II testing

parent b519acc0
No related branches found
No related tags found
1 merge request!12Snapshot: field test deployed version as of end of run 202201
......@@ -105,6 +105,7 @@ class Gotthard2CpuRunner:
def correct(self, flags, out=None):
if out is None:
out = np.empty(self.processed_shape, dtype=np.float32)
self.correction_kernel(
self.input_data,
self.input_gain_stage,
......@@ -299,9 +300,12 @@ class Gotthard2Correction(BaseCorrection):
do_generate_preview,
):
# cell table currently not used for GOTTHARD2 (assume alternating)
gain_map = np.asarray(data_hash.get("data.gain"))
if self.unsafe_get("dataFormat.overrideInputAxisOrder"):
gain_map.shape = self.input_data_shape
try:
self.kernel_runner.load_data(
image_data, data_hash.get("data.gain")
image_data, gain_map
)
except Exception as e:
self.log_status_warn(f"Unknown exception when loading data: {e}")
......@@ -309,6 +313,7 @@ class Gotthard2Correction(BaseCorrection):
buffer_handle, buffer_array = self._shmem_buffer.next_slot()
self.kernel_runner.correct(self._correction_flag_enabled, out=buffer_array)
if do_generate_preview:
if self._correction_flag_enabled != self._correction_flag_preview:
self.kernel_runner.correct(self._correction_flag_preview)
......
......@@ -957,8 +957,8 @@ class BaseCorrection(PythonDevice):
continue
try:
image_data = data_hash.get(self._image_data_path)
cell_table = data_hash.get(self._cell_table_path).ravel()
image_data = np.asarray(data_hash.get(self._image_data_path))
cell_table = np.asarray(data_hash.get(self._cell_table_path)).ravel()
except RuntimeError as err:
self.log_status_info(
f"Failed to load image data; probably empty hash from DAQ: {err}"
......
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