Fix models for usage in non-destructive mode
Models simple_collection
, simple_measurement
, dc_offset
, output_pixel_reset_voltage_apd
, ktc_noise
are currently not suitable for usage in non-destructive readout.
simple_collection
, simple_measurement
should replace the data in the detector, not add to it. So +=
operator needs to be =
.
For example when collecting charge stored in the detector:
# Now
detector.pixel.array += detector.charge.array
# How it should be:
detector.pixel.array = detector.charge.array
dc_offset
, output_pixel_reset_voltage_apd
, ktc_noise
in non-destructive mode only have to be applied once at the first run of the pipeline. If statement is needed in the models.
Additionally, function detector.empty()
has to be reviewed for non-destructive mode:
def empty(self, empty_all: bool = True) -> None:
"""Empty the data in the detector.
Returns
-------
None
"""
if self._photon:
self.photon.array *= 0
if empty_all:
if self._charge:
self._charge.empty()
if self._pixel:
self.pixel.array *= 0
if self._signal:
self.signal.array *= 0
if self._image:
self.image.array *= 0
Edited by Matej Arko