diff --git a/src/calng/base_correction.py b/src/calng/base_correction.py index 28d59130017bb1cbc4e716e3748a059d959685d9..59c48000a3f42a54e62ff5c780a413b3fe746dfa 100644 --- a/src/calng/base_correction.py +++ b/src/calng/base_correction.py @@ -639,7 +639,6 @@ class BaseCorrection(PythonDevice): self, pathlib.Path.cwd() / "calibration-client-secrets.json" ) self._update_frame_filter() - self._update_buffers() self._buffered_status_update = Hash( "trainId", @@ -825,9 +824,9 @@ class BaseCorrection(PythonDevice): self.log.DEBUG(f"Corrections for dataOutput: {str(enabled)}") 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 - dataFormat.filteredFrames, so one will typically want to call _update_buffers + dataFormat.filteredFrames - will therefore by default call _update_buffers afterwards.""" # TODO: add some validation to preReconfigure self.log.DEBUG("Updating frame filter") @@ -871,6 +870,9 @@ class BaseCorrection(PythonDevice): ): self.log_status_warn("Invalid frame filter set, expect exceptions!") + if update_buffers: + self._update_buffers() + def _update_buffers(self): """(Re)initialize buffers / kernel runner according to expected data shapes""" self.log.INFO("Updating buffers according to data shapes") @@ -973,7 +975,6 @@ class BaseCorrection(PythonDevice): self.set("dataFormat.memoryCells", image_data.shape[0]) with self._buffer_lock: self._update_frame_filter() - self._update_buffers() # DataAggregator typically tells us the wrong axis order if self._schema_cache["dataFormat.overrideInputAxisOrder"]: