Skip to content

Commit

Permalink
Add test for invariance of noise vs flux
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Broughton committed Jan 26, 2024
1 parent 3e2f513 commit b36c416
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion python/lsst/cp/verify/verifyPtc.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,18 @@ def verify(self, calib, statisticsDict, camera=None):
verify['PTC_GAIN'] = bool(diffGain < self.config.gainThreshold)
verify['PTC_NOISE'] = bool(diffNoise < self.config.noiseThreshold)

# Check that the noises measured in cpPtcExtract do not evolve
# as a function of flux.
# We fit a linear model to the noise as a function of flux
# and check that the maximum absolute residual of the model
# from 0 across the full signal range is within one standard
# deviation in noise
signals = calib.rawMeans[ampName]
noiseList = calib.noiseList[ampName]
params = np.polyfit(signals, noiseList, deg=1)
maxNoiseDiff = (signals[-1] - signals[0])*params[0]
verify['NOISE_SIGNAL_INDEPENDENCE'] = bool(maxNoiseDiff < np.std(noiseList))

# DMTN-101: 16.3
# Check that the measured PTC turnoff is at least greater than the
# full-well requirement of 90k e-.
Expand Down Expand Up @@ -236,7 +248,8 @@ def verify(self, calib, statisticsDict, camera=None):
verifyStats[ampName] = verify

# Loop over amps to make a detector summary.
verifyDetStats = {'PTC_GAIN': [], 'PTC_NOISE': [], 'PTC_TURNOFF': [], 'PTC_BFE_A00': []}
verifyDetStats = {'PTC_GAIN': [], 'PTC_NOISE': [], 'PTC_TURNOFF': [], 'PTC_BFE_A00': [],
'NOISE_SIGNAL_INDEPENDENCE': []}
for amp in verifyStats:
for testName in verifyStats[amp]:
if testName == 'SUCCESS':
Expand Down

0 comments on commit b36c416

Please sign in to comment.