diff --git a/src/calng/AgipdCorrection.py b/src/calng/AgipdCorrection.py index 74d8c05880b81c155c9e13430460a49caf23cd81..d619ec406337cf8f3d18a59df7f0b1a4100ace9d 100644 --- a/src/calng/AgipdCorrection.py +++ b/src/calng/AgipdCorrection.py @@ -315,19 +315,20 @@ class AgipdCorrection(BaseCorrection): if do_generate_preview: if self._correction_flag_enabled != self._correction_flag_preview: self.gpu_runner.correct(self._correction_flag_preview) + # WARNING: actually looking for cell ID at the request of SPB preview_slice_index = self._schema_cache["preview.pulse"] if preview_slice_index >= 0: - # look at pulse_table to find which index this pulse ID is in - pulse_id_found = np.where(pulse_table == preview_slice_index)[0] - if len(pulse_id_found) == 0: - pulse_found_instead = pulse_table[0] + # look at cell_table to find which index this pulse ID is in + cell_id_found = np.where(cell_table == preview_slice_index)[0] + if len(cell_id_found) == 0: + cell_found_instead = cell_table[0] self.log_status_info( - f"Pulse {preview_slice_index} not found, arbitrary pulse " - f"{pulse_found_instead} will be shown instead." + f"Cell {preview_slice_index} not found, arbitrary cell " + f"{cell_found_instead} will be shown instead." ) preview_slice_index = 0 else: - preview_slice_index = pulse_id_found[0] + preview_slice_index = cell_id_found[0] preview_raw, preview_corrected = self.gpu_runner.compute_preview( preview_slice_index ) diff --git a/src/calng/base_correction.py b/src/calng/base_correction.py index 11f68b429a7904dcc1e4797e6db1ed03cc853a54..271736c04fa92af3cc0eeaa1d23804b39576479b 100644 --- a/src/calng/base_correction.py +++ b/src/calng/base_correction.py @@ -338,9 +338,10 @@ class BaseCorrection(PythonDevice): .defaultValue(True) .reconfigurable() .commit(), + # TODO: Split into AGIPD-specific or see if others like cell ID over pulse ID INT32_ELEMENT(expected) .key("preview.pulse") - .displayedName("Pulse (or stat) for preview") + .displayedName("Cell (or stat) for preview") .description( "If this value is ≥ 0, the corresponding index from data will be " "sliced for the preview. If this value is ≤ 0, preview will be one of " @@ -603,7 +604,7 @@ class BaseCorrection(PythonDevice): # TODO: allow sending *all* frames for commissioning (request: Jola) preview_hash = Hash() preview_hash.set("image.trainId", train_id) - preview_hash.set("image.pulseId", self._schema_cache["preview.pulse"]) + preview_hash.set("image.cellId", self._schema_cache["preview.pulse"]) # note: have to construct because setting .tid after init is broken timestamp = Timestamp(Epochstamp(), Trainstamp(train_id))