-
Notifications
You must be signed in to change notification settings - Fork 8
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-34644: Clean up decorrelation code #214
Changes from all commits
247f243
6269e2c
efb23bf
05cf2dc
e24ad66
62cb8d0
efa8456
bad4268
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -449,7 +449,7 @@ def testNoiseDiffimCorrection(self): | |
|
||
self._setUpSourcelessImages(svar=svar, tvar=tvar) | ||
diffExp, mKernel, expected_var = self._makeAndTestUncorrectedDiffim() | ||
corrected_diffExp = self._runDecorrelationTask(diffExp, mKernel) | ||
corrected_diffExp = self._runDecorrelationTask(diffExp.clone(), mKernel) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just for my edification, why the change to .clone() here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Other places too, actually.... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's so I can modify the difference exposure in place in the decorrelation task, and not effect the tests. |
||
|
||
rho_sci = estimatePixelCorrelation(self.im1ex.getImage().getArray()) | ||
rho_rawdiff = estimatePixelCorrelation(diffExp.getImage().getArray()) | ||
|
@@ -529,7 +529,7 @@ def _testDiffimCorrection_spatialTask(self, svar, tvar, varyPsf=0.0): | |
diffExp, mKernel, expected_var = self._makeAndTestUncorrectedDiffim() | ||
variances = [] | ||
for spatiallyVarying in [False, True]: | ||
corrected_diffExp = self._runDecorrelationSpatialTask(diffExp, mKernel, | ||
corrected_diffExp = self._runDecorrelationSpatialTask(diffExp.clone(), mKernel, | ||
spatiallyVarying) | ||
var, mn = self._testDecorrelation(expected_var, corrected_diffExp) | ||
variances.append(var) | ||
|
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 really need to add the logging context manager to the
utils
package so that the log level resets automatically when the task below completes. I'm not overly happy with how we handle this since it really is saying that this task is too verbose by default and it's impossible to ever see the info messages. As written, if someone sets the log level to DEBUG in pipetask they won't get any debug messages out of this task and that seems wrong.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 completely agree that code that forces the log level like this is problematic. This is code that is not used outside of the unit tests, for now at least, and I just wanted to change this line to fix a warning while building the package. This particular task will need to be refactored if we want to use it in production.