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

Fix dipoleFitting to use correct matched template exposure #67

Merged
merged 1 commit into from
Jul 26, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions python/lsst/pipe/tasks/imageDifference.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ def run(self, sensorRef, templateIdList=None):
# If doSubtract is False, then subtractedExposure was fetched from disk (above), thus it may have
# already been decorrelated. Thus, we do not do decorrelation if doSubtract is False.
if self.config.doDecorrelation and self.config.doSubtract:
decorrResult = self.decorrelate.run(templateExposure, exposure,
decorrResult = self.decorrelate.run(exposure, templateExposure,
subtractedExposure,
subtractRes.psfMatchingKernel)
subtractedExposure = decorrResult.correctedExposure
Expand Down Expand Up @@ -561,7 +561,11 @@ def run(self, sensorRef, templateIdList=None):
if not self.config.doDipoleFitting:
self.measurement.run(diaSources, subtractedExposure)
else:
self.measurement.run(diaSources, subtractedExposure, exposure, templateExposure)
if self.config.doSubtract:
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not clear on why "doSubtract" means we pass the matchedExposure here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If doSubract == True then we have a matchedExposure and we can use that rather than computing it from exposure - subtractedExposure. This is noted in the DipoleFitTask.run() docstring.

self.measurement.run(diaSources, subtractedExposure, exposure,
subtractRes.matchedExposure)
else:
self.measurement.run(diaSources, subtractedExposure, exposure)

# Match with the calexp sources if possible
if self.config.doMatchSources:
Expand Down