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

Reorder correct / preview / reshape

parent cb902408
No related branches found
No related tags found
1 merge request!35Frame selection
......@@ -775,13 +775,11 @@ class AgipdCorrection(base_correction.BaseCorrection):
self.log_status_warn(f"Unknown exception when loading data to GPU: {e}")
buffer_handle, buffer_array = self._shmem_buffer.next_slot()
self.kernel_runner.correct(self._correction_flag_enabled)
# previews are generated before any addons are run
# first prepare previews (not affected by addons)
self.kernel_runner.correct(self._correction_flag_preview)
with self.warning_context(
"processingState", base_correction.WarningLampType.PREVIEW_SETTINGS
) as warn:
if self._correction_flag_enabled != self._correction_flag_preview:
self.kernel_runner.correct(self._correction_flag_preview)
(
preview_slice_index,
preview_cell,
......@@ -800,6 +798,11 @@ class AgipdCorrection(base_correction.BaseCorrection):
preview_raw_gain,
preview_gain_map,
) = self.kernel_runner.compute_previews(preview_slice_index)
# TODO: start writing out previews asynchronously in the background
# then prepare full corrected data
if self._correction_flag_enabled != self._correction_flag_preview:
self.kernel_runner.correct(self._correction_flag_enabled)
for addon in self._enabled_addons:
addon.post_correction(
self.kernel_runner.processed_data, cell_table, pulse_table, data_hash
......
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