From f3c79e98790501e8b33961522feda6a45ec1099f Mon Sep 17 00:00:00 2001 From: Christopher Waters Date: Wed, 6 Sep 2023 12:13:30 -0700 Subject: [PATCH 1/6] Remove photodiode data connection. DM-38944 removed this connection on the main cp_pipe version of the linearizer task, but the subclass here was forgotten. --- python/lsst/cp/verify/verifyLinearity.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/python/lsst/cp/verify/verifyLinearity.py b/python/lsst/cp/verify/verifyLinearity.py index dcfa9fc..2f64adc 100644 --- a/python/lsst/cp/verify/verifyLinearity.py +++ b/python/lsst/cp/verify/verifyLinearity.py @@ -239,15 +239,6 @@ class CpvLinearitySolveConnections(pipeBase.PipelineTaskConnections, dimensions=("instrument", "detector"), isCalibration=True, ) - inputPhotodiodeData = cT.PrerequisiteInput( - name="photodiode", - doc="Photodiode readings data.", - storageClass="IsrCalib", - dimensions=("instrument", "exposure"), - multiple=True, - deferLoad=True, - minimum=0, - ) inputPhotodiodeCorrection = cT.Input( name="cpvPdCorrection", doc="Input photodiode correction.", @@ -270,9 +261,6 @@ def __init__(self, *, config=None): if config.applyPhotodiodeCorrection is not True: self.inputs.discard("inputPhotodiodeCorrection") - if config.usePhotodiode is not True: - self.inputs.discard("inputPhotodiodeData") - class CpvLinearitySolveConfig(cpPipe.LinearitySolveConfig, pipelineConnections=CpvLinearitySolveConnections): From 63f63c1bfb8739e210bdd4520d45bf936ebc42fe Mon Sep 17 00:00:00 2001 From: Christopher Waters Date: Wed, 6 Sep 2023 12:22:32 -0700 Subject: [PATCH 2/6] Switch to HSM moments. --- python/lsst/cp/verify/verifyBfk.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python/lsst/cp/verify/verifyBfk.py b/python/lsst/cp/verify/verifyBfk.py index a66ecc0..b69fe1d 100644 --- a/python/lsst/cp/verify/verifyBfk.py +++ b/python/lsst/cp/verify/verifyBfk.py @@ -137,11 +137,13 @@ def catalogStatistics(self, exposure, catalog, uncorrectedCatalog, statControl): outputStatistics['SIZE_DIFF'] = sizeDiff return outputStatistics + xxKey = 'ext_shapeHSM_HsmSourceMoments_xx' + yyKey = 'ext_shapeHSM_HsmSourceMoments_yy' for source, uncorrectedSource, d in matches: # This uses the simple difference in source moments. sourceMagnitude = -2.5 * np.log10(source.getPsfInstFlux()) - sourceSize = source['base_SdssShape_xx'] + source['base_SdssShape_yy'] - uncorrectedSize = uncorrectedSource['base_SdssShape_xx'] + uncorrectedSource['base_SdssShape_yy'] + sourceSize = source[xxKey] + source[yyKey] + uncorrectedSize = uncorrectedSource[xxKey] + uncorrectedSource[yyKey] magnitude.append(float(sourceMagnitude)) sizeDiff.append(float(uncorrectedSize - sourceSize)) From f109cba88cb8705f2a34b8a30a0ee437359dc215 Mon Sep 17 00:00:00 2001 From: Christopher Waters Date: Wed, 6 Sep 2023 12:23:13 -0700 Subject: [PATCH 3/6] Do not measure PSF, as inputs may not have enough sources. --- pipelines/_ingredients/VerifyBfk.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pipelines/_ingredients/VerifyBfk.yaml b/pipelines/_ingredients/VerifyBfk.yaml index 438bc1b..ee1015f 100644 --- a/pipelines/_ingredients/VerifyBfk.yaml +++ b/pipelines/_ingredients/VerifyBfk.yaml @@ -13,6 +13,7 @@ tasks: connections.exposure: 'verifyBfkIsr' doApCorr: false doDeblend: false + doMeasurePsf: false verifyUncorrectedBfkIsr: class: lsst.ip.isr.isrTask.IsrTask config: @@ -30,6 +31,7 @@ tasks: connections.outputSchema: 'verifyUncorrBfk_schema' doApCorr: false doDeblend: false + doMeasurePsf: false verifyBfkChip: class: lsst.cp.verify.verifyBfk.CpVerifyBfkTask config: From 1b58a49a1ab2856a105db59168a49f33e161d22e Mon Sep 17 00:00:00 2001 From: Christopher Waters Date: Wed, 6 Sep 2023 16:16:38 -0700 Subject: [PATCH 4/6] Ensure linearity verification is using Spline model for LATISS. --- pipelines/Latiss/VerifyLinearity.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pipelines/Latiss/VerifyLinearity.yaml b/pipelines/Latiss/VerifyLinearity.yaml index df29eff..8079bbc 100644 --- a/pipelines/Latiss/VerifyLinearity.yaml +++ b/pipelines/Latiss/VerifyLinearity.yaml @@ -2,3 +2,8 @@ description: cp_verify LINEARITY calibration verification instrument: lsst.obs.lsst.Latiss imports: - location: $CP_VERIFY_DIR/pipelines/_ingredients/VerifyLinearity.yaml +tasks: + verifyLinearitySecondLinearizer: + class: lsst.cp.verify.verifyLinearity.CpvLinearitySolveTask + config: + linearityType: "Spline" From 1b4f31896c8a6e1282af664448c1e27c1114b0ea Mon Sep 17 00:00:00 2001 From: Christopher Waters Date: Wed, 6 Sep 2023 17:14:30 -0700 Subject: [PATCH 5/6] Fix PTC verification errors. --- python/lsst/cp/verify/verifyCalib.py | 2 +- python/lsst/cp/verify/verifyPtc.py | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/python/lsst/cp/verify/verifyCalib.py b/python/lsst/cp/verify/verifyCalib.py index 7f756dc..e28a982 100644 --- a/python/lsst/cp/verify/verifyCalib.py +++ b/python/lsst/cp/verify/verifyCalib.py @@ -38,7 +38,7 @@ class CpVerifyCalibConnections(pipeBase.PipelineTaskConnections, deferLoad=True, ) - inputCalib = cT.Input( + inputCalib = cT.PrerequisiteInput( name="calib", doc="Input calib to calculate statistics for.", storageClass="IsrCalib", diff --git a/python/lsst/cp/verify/verifyPtc.py b/python/lsst/cp/verify/verifyPtc.py index 38848be..06f914a 100644 --- a/python/lsst/cp/verify/verifyPtc.py +++ b/python/lsst/cp/verify/verifyPtc.py @@ -40,7 +40,7 @@ class CpVerifyPtcConnections(CpVerifyCalibConnections, class CpVerifyPtcConfig(CpVerifyCalibConfig, - pipelineConnections=CpVerifyPtcConnections): + pipelineConnections=CpVerifyCalibConnections): """Inherits from base CpVerifyCalibConfig.""" def setDefaults(self): @@ -143,10 +143,9 @@ def amplifierStatistics(self, inputCalib, camera=None): outputStatistics[ampName]['PTC_TURNOFF'] = inputCalib.ptcTurnoff[ampName] outputStatistics[ampName]['PTC_FIT_TYPE'] = ptcFitType if ptcFitType == 'EXPAPPROXIMATION': - outputStatistics[ampName]['PTC_BFE_A00'] = inputCalib.ptcFitPars[ampName][0] + outputStatistics[ampName]['PTC_BFE_A00'] = float(inputCalib.ptcFitPars[ampName][0]) if ptcFitType == 'FULLCOVARIANCE': - outputStatistics[ampName]['PTC_BFE_A00'] = inputCalib.aMatrix[ampName][0][0] - + outputStatistics[ampName]['PTC_BFE_A00'] = float(inputCalib.aMatrix[ampName][0][0]) return outputStatistics def verify(self, calib, statisticsDict, camera=None): From 5223cc3ca89567b5deaabbbff2e2f83b1c3120b4 Mon Sep 17 00:00:00 2001 From: Christopher Waters Date: Fri, 12 Jan 2024 14:50:57 -0800 Subject: [PATCH 6/6] Remove unneeded connection class. --- python/lsst/cp/verify/verifyPtc.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/python/lsst/cp/verify/verifyPtc.py b/python/lsst/cp/verify/verifyPtc.py index 06f914a..e7ef784 100644 --- a/python/lsst/cp/verify/verifyPtc.py +++ b/python/lsst/cp/verify/verifyPtc.py @@ -21,22 +21,9 @@ import numpy as np import lsst.pex.config as pexConfig -import lsst.pipe.base.connectionTypes as cT from .verifyCalib import CpVerifyCalibConfig, CpVerifyCalibTask, CpVerifyCalibConnections -__all__ = ['CpVerifyPtcConnections', 'CpVerifyPtcConfig', 'CpVerifyPtcTask'] - - -class CpVerifyPtcConnections(CpVerifyCalibConnections, - dimensions={"instrument", "detector"}, - defaultTemplates={}): - inputCalib = cT.Input( - name="calib", - doc="Input calib to calculate statistics for.", - storageClass="PhotonTransferCurveDataset", - dimensions=["instrument", "detector"], - isCalibration=True - ) +__all__ = ['CpVerifyPtcConfig', 'CpVerifyPtcTask'] class CpVerifyPtcConfig(CpVerifyCalibConfig,