From 1c172dcabb860785d36d20a806e2930b0baba533 Mon Sep 17 00:00:00 2001 From: David Hammer <dhammer@mailbox.org> Date: Wed, 30 Nov 2022 15:27:34 +0100 Subject: [PATCH] Use same condition for all constants --- src/calng/corrections/Gotthard2Correction.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/calng/corrections/Gotthard2Correction.py b/src/calng/corrections/Gotthard2Correction.py index e35c4b59..e9700dc1 100644 --- a/src/calng/corrections/Gotthard2Correction.py +++ b/src/calng/corrections/Gotthard2Correction.py @@ -148,24 +148,14 @@ class Gotthard2CalcatFriend(base_calcat.BaseCalcatFriend): def __init__(self, device, *args, **kwargs): super().__init__(device, *args, **kwargs) - self._constants_need_conditions = { - Constants.LUTGotthard2: self.condition_2, - Constants.OffsetGotthard2: self.condition_1, - Constants.RelativeGainGotthard2: self.condition_2, - Constants.BadPixelsDarkGotthard2: self.condition_1, - Constants.BadPixelsFFGotthard2: self.condition_2, - } + self._constants_need_conditions = {c: self.condition for c in Constants} - def condition_1(self): + def condition(self): res = base_calcat.OperatingConditions() res["Exposure time"] = self._get_param("exposureTime") res["Exposure period"] = self._get_param("exposurePeriod") res["Sensor Bias Voltage"] = self._get_param("biasVoltage") res["Single photon"] = self._get_param("singlePhoton") - return res - - def condition_2(self): - res = self.condition_1() res["Acquisition rate"] = self._get_param("acquisitionRate") return res -- GitLab