Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-42163: eo_pipe/cp_verify parity: ptc #228

Merged
merged 5 commits into from Jan 25, 2024
Merged

DM-42163: eo_pipe/cp_verify parity: ptc #228

merged 5 commits into from Jan 25, 2024

Conversation

plazas
Copy link
Contributor

@plazas plazas commented Jan 19, 2024

No description provided.

Copy link
Contributor

@czwa czwa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slight None/nan issue, but I think it's a quick fix.

@@ -809,12 +816,15 @@ 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`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NaN is just a flavor of float.


If either mu1 or m2 are NaN's, the returned value is NaN.
"""
if np.isnan(mu1) or np.isnan(mu2):
self.log.warning("Mean of amp in image 1 or 2 is NaN: %f, %f.", mu1, mu2)
return np.nan, np.nan, None
return np.nan, np.nan, None, np.nan
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test above (L587) tests for is None, not np.nan. Same point for the other returns below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the test to check for np.nan

self.log.warning("NaN mean or var, or None cov in amp %s in exposure pair %d, %d of "
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 "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"rowMeanVariance"? Just for consistency.

@plazas plazas merged commit 52047a5 into main Jan 25, 2024
2 checks passed
@plazas plazas deleted the tickets/DM-42163 branch January 25, 2024 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants