Skip to content

Commit

Permalink
Fix check for np.nan
Browse files Browse the repository at this point in the history
Fix lint error
  • Loading branch information
plazas committed Jan 24, 2024
1 parent a50f319 commit c24e7b7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions python/lsst/cp/pipe/ptc/cpExtractPtcTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,8 @@ def run(self, inputExp, inputDims, taskMetadata, inputPhotodiodeData=None):
# Mask data point at this mean signal level if
# the signal, variance, or covariance calculations
# from `measureMeanVarCov` resulted in NaNs.
if np.isnan(muDiff) or np.isnan(varDiff) or (covAstier is None) or (rowMeanVariance is None):
if (np.isnan(muDiff) or np.isnan(varDiff) or (covAstier is None)
or (rowMeanVariance is np.nan)):
self.log.warning("NaN mean, var or rowmeanVariance, or None cov in amp %s "
"in exposure pair %d, %d of "
"detector %d.", ampName, expId1, expId2, detNum)
Expand Down Expand Up @@ -796,11 +797,11 @@ def measureMeanVarCov(self, im1Area, im2Area, imStatsCtrl, mu1, mu2):
Returns
-------
mu : `float` or `NaN`
mu : `float`
0.5*(mu1 + mu2), where mu1, and mu2 are the clipped means
of the regions in both exposures. If either mu1 or m2 are
NaN's, the returned value is NaN.
varDiff : `float` or `NaN`
varDiff : `float`
Half of the clipped variance of the difference of the
regions inthe two input exposures. If either mu1 or m2 are
NaN's, the returned value is NaN.
Expand All @@ -816,7 +817,7 @@ def measureMeanVarCov(self, im1Area, im2Area, imStatsCtrl, mu1, mu2):
Covariance at (dx, dy).
nPix : `int`
Number of pixel pairs used to evaluate var and cov.
rowMeanVariance : `float` or `NaN`
rowMeanVariance : `float`
Variance of the means of each row in the difference image.
Taken from `github.com/lsst-camera-dh/eo_pipe`.
Expand Down

0 comments on commit c24e7b7

Please sign in to comment.