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-11951: Fixes in AL Decorrelation and Zogy #150

Merged
merged 1 commit into from
Sep 20, 2017
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
16 changes: 10 additions & 6 deletions python/lsst/pipe/tasks/imageDifference.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ def setDefaults(self):
self.detection.thresholdType = "pixel_stdev"

# Add filtered flux measurement, the correct measurement for pre-convolved images.
# Enable all measurements, regardless of doPreConvolved, as it makes data harvesting easier.
# Enable all measurements, regardless of doPreConvolve, as it makes data harvesting easier.
# To change that you must modify algorithms.names in the task's applyOverrides method,
# after the user has set doPreConvolved.
# after the user has set doPreConvolve.
self.measurement.algorithms.names.add('base_PeakLikelihoodFlux')

# For shuffling the control sample
Expand Down Expand Up @@ -320,10 +320,10 @@ def run(self, sensorRef, templateIdList=None):
templateSources = template.sources

if self.config.subtract.name == 'zogy':
spatiallyVarying = self.config.doSpatiallyVarying
subtractRes = self.subtract.subtractExposures(templateExposure, exposure,
doWarping=True,
spatiallyVarying=spatiallyVarying)
spatiallyVarying=self.config.doSpatiallyVarying,
doPreConvolve=self.config.doPreConvolve)
subtractedExposure = subtractRes.subtractedExposure

elif self.config.subtract.name == 'al':
Expand All @@ -337,6 +337,7 @@ def run(self, sensorRef, templateIdList=None):
# (properly, this should be a cross-correlation, but our code does not yet support that)
# compute scienceSigmaPost: sigma of science exposure with pre-convolution, if done,
# else sigma of original science exposure
preConvPsf = None
if self.config.doPreConvolve:
convControl = afwMath.ConvolutionControl()
# cannot convolve in place, so make a new MI to receive convolved image
Expand Down Expand Up @@ -547,11 +548,14 @@ def run(self, sensorRef, templateIdList=None):
# thus it may have already been decorrelated. Thus, we do not decorrelate if
# doSubtract is False.
if self.config.doDecorrelation and self.config.doSubtract:
spatiallyVarying = self.config.doSpatiallyVarying
preConvKernel = None
if preConvPsf is not None:
preConvKernel = preConvPsf.getLocalKernel()
decorrResult = self.decorrelate.run(exposure, templateExposure,
subtractedExposure,
subtractRes.psfMatchingKernel,
spatiallyVarying=spatiallyVarying)
spatiallyVarying=self.config.doSpatiallyVarying,
preConvKernel=preConvKernel)
subtractedExposure = decorrResult.correctedExposure

# END (if subtractAlgorithm == 'AL')
Expand Down