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

Make _update_frame_filter by default call _update_buffers itself

parent 67e1ba2d
No related branches found
No related tags found
2 merge requests!12Snapshot: field test deployed version as of end of run 202201,!3Base correction device, CalCat interaction, DSSC and AGIPD devices
...@@ -639,7 +639,6 @@ class BaseCorrection(PythonDevice): ...@@ -639,7 +639,6 @@ class BaseCorrection(PythonDevice):
self, pathlib.Path.cwd() / "calibration-client-secrets.json" self, pathlib.Path.cwd() / "calibration-client-secrets.json"
) )
self._update_frame_filter() self._update_frame_filter()
self._update_buffers()
self._buffered_status_update = Hash( self._buffered_status_update = Hash(
"trainId", "trainId",
...@@ -825,9 +824,9 @@ class BaseCorrection(PythonDevice): ...@@ -825,9 +824,9 @@ class BaseCorrection(PythonDevice):
self.log.DEBUG(f"Corrections for dataOutput: {str(enabled)}") self.log.DEBUG(f"Corrections for dataOutput: {str(enabled)}")
self.log.DEBUG(f"Corrections for preview: {str(preview)}") self.log.DEBUG(f"Corrections for preview: {str(preview)}")
def _update_frame_filter(self): def _update_frame_filter(self, update_buffers=True):
"""Parse frameFilter string (if set) and update cached filter array. May update """Parse frameFilter string (if set) and update cached filter array. May update
dataFormat.filteredFrames, so one will typically want to call _update_buffers dataFormat.filteredFrames - will therefore by default call _update_buffers
afterwards.""" afterwards."""
# TODO: add some validation to preReconfigure # TODO: add some validation to preReconfigure
self.log.DEBUG("Updating frame filter") self.log.DEBUG("Updating frame filter")
...@@ -871,6 +870,9 @@ class BaseCorrection(PythonDevice): ...@@ -871,6 +870,9 @@ class BaseCorrection(PythonDevice):
): ):
self.log_status_warn("Invalid frame filter set, expect exceptions!") self.log_status_warn("Invalid frame filter set, expect exceptions!")
if update_buffers:
self._update_buffers()
def _update_buffers(self): def _update_buffers(self):
"""(Re)initialize buffers / kernel runner according to expected data shapes""" """(Re)initialize buffers / kernel runner according to expected data shapes"""
self.log.INFO("Updating buffers according to data shapes") self.log.INFO("Updating buffers according to data shapes")
...@@ -973,7 +975,6 @@ class BaseCorrection(PythonDevice): ...@@ -973,7 +975,6 @@ class BaseCorrection(PythonDevice):
self.set("dataFormat.memoryCells", image_data.shape[0]) self.set("dataFormat.memoryCells", image_data.shape[0])
with self._buffer_lock: with self._buffer_lock:
self._update_frame_filter() self._update_frame_filter()
self._update_buffers()
# DataAggregator typically tells us the wrong axis order # DataAggregator typically tells us the wrong axis order
if self._schema_cache["dataFormat.overrideInputAxisOrder"]: if self._schema_cache["dataFormat.overrideInputAxisOrder"]:
......
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