Skip to content

Commit

Permalink
Merge pull request #291 from lsst/tickets/DM-48468
Browse files Browse the repository at this point in the history
DM-48468: Turn off gaussian histogram Ks testing by default.
  • Loading branch information
erykoff authored Jan 22, 2025
2 parents 235520f + 5c67fd1 commit 5dc75b4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
17 changes: 14 additions & 3 deletions python/lsst/cp/pipe/ptc/cpPtcExtract.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,12 @@ class PhotonTransferCurveExtractConfig(pipeBase.PipelineTaskConfig,
'FULL': 'Second order correction.'
}
)
doKsHistMeasurement = pexConfig.Field(
dtype=bool,
doc="Do the Ks test of gaussianity? If False, kspValue will be filled "
"with all 1.0s.",
default=False,
)
ksHistNBins = pexConfig.Field(
dtype=int,
doc="Number of bins for the KS test histogram.",
Expand Down Expand Up @@ -693,9 +699,9 @@ def run(self, inputExp, inputDims, taskMetadata=None, inputPhotodiodeData=None):
# the combined dataset).
covArray[0, 0, 0] /= varFactor

if expIdMask:
if expIdMask and self.config.doKsHistMeasurement:
# Run the Gaussian histogram only if this is a legal
# amplifier.
# amplifier and configured to do so.
histVar, histChi2Dof, kspValue = self.computeGaussianHistogramParameters(
im1Area,
im2Area,
Expand All @@ -706,7 +712,12 @@ def run(self, inputExp, inputDims, taskMetadata=None, inputPhotodiodeData=None):
else:
histVar = np.nan
histChi2Dof = np.nan
kspValue = 0.0
if self.config.doKsHistMeasurement:
kspValue = 0.0
else:
# When this is turned off, we will always allow it to
# pass downstream.
kspValue = 1.0

if self.config.doExtractPhotodiodeData or self.config.useEfdPhotodiodeData:
nExps = 0
Expand Down
1 change: 1 addition & 0 deletions tests/test_ptc.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ def test_covAstier(self):
extractConfig.minNumberGoodPixelsForCovariance = 5000
extractConfig.detectorMeasurementRegion = "FULL"
extractConfig.doExtractPhotodiodeData = True
extractConfig.doKsHistMeasurement = True
extractConfig.auxiliaryHeaderKeys = ["CCOBCURR", "CCDTEMP"]
extractTask = cpPipe.ptc.PhotonTransferCurveExtractTask(config=extractConfig)

Expand Down

0 comments on commit 5dc75b4

Please sign in to comment.