Skip to content

Commit

Permalink
Eliminate an unneeded extra WCS fit in ImageDifferenceTask
Browse files Browse the repository at this point in the history
ImageDifferenceTask had a workaround for the fact that our
tan-sip fitter used to fail if CRPIX was large. That's been fixed,
so I removed the workaround and managed to eliminate use of
a hard-coded astrometry task at the same time.
  • Loading branch information
r-owen committed Aug 12, 2015
1 parent c4b5082 commit 001f098
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions python/lsst/pipe/tasks/imageDifference.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,19 +576,14 @@ def run(self, sensorRef):
sources=diaSources,
)

# One problem is that the SIP fits are w.r.t. CRPIX,
# and these coadd patches have the CRPIX of the entire
# tract, i.e. off the image. This causes
# register.fitWcs to fail. A workaround for now is to
# re-fit the Wcs which returns with a CRPIX that is on
# the image, and *then* to fit for the relative Wcs.
#
def fitAstrometry(self, templateSources, templateExposure, selectSources):
"""Fit the relative astrometry between templateSources and selectSources"""
sipOrder = self.config.templateSipOrder
astrometer = measAstrom.Astrometry(measAstrom.MeasAstromConfig(sipOrder=sipOrder))
newWcs = astrometer.determineWcs(templateSources, templateExposure).getWcs()
results = self.register.run(templateSources, newWcs,
"""Fit the relative astrometry between templateSources and selectSources
@todo remove this method. It originally fit a new WCS to the template before calling register.run
because our TAN-SIP fitter behaved badly for points far from CRPIX, but that's been fixed.
It remains because a subtask overrides it.
"""
results = self.register.run(templateSources, templateSources.getWcs(),
templateExposure.getBBox(), selectSources)
return results

Expand Down

0 comments on commit 001f098

Please sign in to comment.