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
fix variance calculation to use masks #26
Conversation
@@ -130,19 +129,28 @@ def __init__(self, *args, **kwargs): | |||
"NO_DATA", "DETECTED_NEGATIVE"])) | |||
|
|||
@pipeBase.timeMethod | |||
def run(self, templateExposure, exposure, subtractedExposure, psfMatchingKernel): | |||
def run(self, exposure, templateExposure, subtractedExposure, psfMatchingKernel, | |||
xcen=None, ycen=None, var1=None, var2=None): | |||
"""! Perform decorrelation of an image difference exposure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be handy to note in the docstring that exposure, template match equation whatever in some paper.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not in a paper, yet. But I will reference the (still in progress) DMTN-021 with those details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the reference. Thanks. Maybe I_1 and I_2 should be I_s and I_t in DMTN-021, to make it explicit?
(to within a 1% tolerance). | ||
""" | ||
|
||
def _testImages(self): | ||
# Create the matching kernel. We used Gaussian PSFs for im1 and im2, so we can compute the "expected" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though it's a "private" method, it would be good to have a short docstring here that says what gets tested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
Few things, besides the specific comments I had on lines (some of which are expanded on below):
|
(to within a 1% tolerance). | ||
""" | ||
self._setUpImages(var1=0.04, var2=0.08) | ||
self._testImages() | ||
|
||
|
||
def suite(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TestSuite is dead: long live py.test! See SQR-012 and the developer docs for more details:
https://sqr-012.lsst.io/
https://developer.lsst.io/coding/python_testing.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, converted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
fix normalization of correction kernel remove commented print statements add coordinate parameters to `run` for testing update test for stricter tolerance after bug fix turn on old ClassificationDipole again add options to DecorrelateALKerneltask.run() change all sig**2 to variance Fix mixup of var1 and var2 for science and template Rename var1 to svar and var2 to tvar Improvements to unit tests Other improvements thanks to code review
fix normalization of correction kernel
remove commented print statements
add coordinate parameters to
run
for testingupdate test for stricter tolerance after bug fix
turn on old ClassificationDipole again
add options to DecorrelateALKerneltask.run()
change all sig**2 to variance
Fix mixup of var1 and var2 for science and template