From b2214c9f4fd4256d8e788779906236ce8c4b058f Mon Sep 17 00:00:00 2001 From: Christopher Waters Date: Thu, 16 Nov 2023 13:25:46 -0800 Subject: [PATCH] Enforce gain usage in CTI construction. --- pipelines/_ingredients/cpDeferredCharge.yaml | 3 +++ python/lsst/cp/pipe/deferredCharge.py | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pipelines/_ingredients/cpDeferredCharge.yaml b/pipelines/_ingredients/cpDeferredCharge.yaml index 73aae7bb..02a3467d 100644 --- a/pipelines/_ingredients/cpDeferredCharge.yaml +++ b/pipelines/_ingredients/cpDeferredCharge.yaml @@ -27,3 +27,6 @@ tasks: config: connections.inputMeasurements: 'cpCtiStats' connections.outputCalib: 'cpCtiCalib' + useGains: true +contracts: + - ctiIsr.doApplyGains == solveCti.useGains diff --git a/python/lsst/cp/pipe/deferredCharge.py b/python/lsst/cp/pipe/deferredCharge.py index da5efa53..ff140bd5 100644 --- a/python/lsst/cp/pipe/deferredCharge.py +++ b/python/lsst/cp/pipe/deferredCharge.py @@ -81,6 +81,12 @@ class CpCtiSolveConfig(pipeBase.PipelineTaskConfig, doc="First and last overscan column to use for local offset effect.", ) + useGains = pexConfig.Field( + dtype=bool, + default=True, + doc="Use gains in calculation.", + ) + maxSignalForCti = pexConfig.Field( dtype=float, default=10000.0, @@ -179,7 +185,7 @@ def run(self, inputMeasurements, camera, inputDims): detector = camera[detectorId] # Initialize with detector. - calib = DeferredChargeCalib(camera=camera, detector=detector) + calib = DeferredChargeCalib(camera=camera, detector=detector, useGains=self.config.useGains) localCalib = self.solveLocalOffsets(inputMeasurements, calib, detector)