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-24762: Add option to PTC task to correct for sigma clipping bias #79

Merged
merged 3 commits into from Apr 6, 2021

Conversation

plazas
Copy link
Contributor

@plazas plazas commented Apr 5, 2021

No description provided.

@@ -272,6 +273,11 @@ def run(self, inputExp, inputDims):
# in {maxLag, maxLag}^2]
muDiff, varDiff, covAstier = self.measureMeanVarCov(exp1, exp2, region=region,
covAstierRealSpace=doRealSpace)
# Correction factor for sigma clipping. Function returns 1/sqrt(varFactor),
# so it needs to be squared. varDiff is calculated via afwMath.VARIANCECLIP.
varFactor = sigmaClipCorrection(self.config.nSigmaClipPtc)**2
Copy link
Collaborator

Choose a reason for hiding this comment

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

I just want to check that L305 where you square things (as it was before) isn't re-squaring (i.e. because you're squaring the result here already).

Basically this line and the next are as they were before (I think) but it looks like L305 and L306 might be expecting it not to be squared, so just check that's all consistent.

Definitely not saying this is wrong, but just check this is really what you want.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We actually have two ways of getting the variance of the difference image: via afwMath.VARIANCECLIP and via the [0,0] element of the covariance calculation (Pierre’s code; L305, and L306). So that’s why the squaring was done in two different places

@plazas plazas merged commit 434b3eb into master Apr 6, 2021
@plazas plazas deleted the tickets/DM-24762 branch April 6, 2021 22:39
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