diff --git a/src/cal_tools/calcat_interface2.py b/src/cal_tools/calcat_interface2.py index a9de2aea033bcf2ffc61c333cee7e6df7555c5cc..57134dba75e3bd437db202e1a17f438decd76154 100644 --- a/src/cal_tools/calcat_interface2.py +++ b/src/cal_tools/calcat_interface2.py @@ -954,6 +954,7 @@ class LPDConditions(ConditionsBase): category: int = 1 pixels_x: int = 256 pixels_y: int = 256 + parallel_gain: bool = False _base_params = [ "Sensor Bias Voltage", @@ -961,6 +962,7 @@ class LPDConditions(ConditionsBase): "Pixels X", "Pixels Y", "Feedback capacitor", + "Parallel gain", ] _dark_parameters = _base_params + [ "Memory cell order", @@ -977,6 +979,16 @@ class LPDConditions(ConditionsBase): "BadPixelsFF": _illuminated_parameters, } + def make_dict(self, parameters): + cond = super().make_dict(parameters) + + # Legacy value for no parallel gain not injected for backwards + # compatibility with prior calibration data. + if int(cond.get("Parallel gain", -1)) == 0: + del cond["Parallel gain"] + + return cond + @dataclass class DSSCConditions(ConditionsBase):