Skip to content

Commit

Permalink
Use NaN instead of None to prevent potential serialization issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
czwa committed Jan 20, 2023
1 parent 53df42e commit 7f8815f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/lsst/cp/pipe/ptc/cpExtractPtcTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,9 +756,9 @@ def getGainFromFlatPair(self, im1Area, im2Area, imStatsCtrl, mu1, mu2,
if correctionType not in ['NONE', 'SIMPLE', 'FULL']:
raise RuntimeError("Unknown correction type: %s" % correctionType)

if correctionType != 'NONE' and readNoise is None:
if correctionType != 'NONE' and not np.isfinite(readNoise):
self.log.warning("'correctionType' in 'getGainFromFlatPair' is %s, "
"but 'readNoise' is 'None'. Setting 'correctionType' "
"but 'readNoise' is NaN. Setting 'correctionType' "
"to 'NONE', so a gain value will be estimated without "
"corrections." % correctionType)
correctionType = 'NONE'
Expand Down Expand Up @@ -824,6 +824,6 @@ def getReadNoiseFromMetadata(self, taskMetadata, ampName):
else:
self.log.warning("Median readout noise from ISR metadata for amp %s "
"could not be calculated." % ampName)
readNoise = None
readNoise = np.nan

return readNoise

0 comments on commit 7f8815f

Please sign in to comment.