Skip to content

Commit

Permalink
Adapt to removal of pipe.base.task.Task.display().
Browse files Browse the repository at this point in the history
Directly invoke utility code from afwDisplay in ANetAstrometryTask rather than
relying on the pipe_base framework.
  • Loading branch information
jdswinbank committed Jan 5, 2016
1 parent 55835da commit e38b8ab
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions python/lsst/meas/astrom/anetAstrometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from contextlib import contextmanager

import lsst.pex.exceptions
import lsst.afw.display as afwDisplay
import lsst.afw.geom as afwGeom
from lsst.afw.cameraGeom import TAN_PIXELS
from lsst.afw.table import Point2DKey, CovarianceMatrix2fKey
Expand Down Expand Up @@ -343,7 +344,10 @@ def loadAndMatch(self, exposure, sourceCat, bbox=None):
raise RuntimeError("No astrometric matches")
self.log.info("%d astrometric matches" % (len(matches)))

self.display('astrometry', exposure=exposure, sources=sourceCat, matches=matches)
if self._display:
import lsstDebug
lsstDebug.Info(__name__).frame
afwDisplay.utils.drawSourceMatches(exposure, sourceCat, matches, frame)

return pipeBase.Struct(
refCat = astrom.refCat,
Expand Down Expand Up @@ -385,7 +389,10 @@ def _astrometry(self, sourceCat, exposure, bbox=None):
# Note that this is the Wcs for the provided positions, which may be distorted
exposure.setWcs(astrom.getWcs())

self.display('astrometry', exposure=exposure, sources=sourceCat, matches=matches)
if self._display:
import lsstDebug
frame = lsstDebug.Info(__name__).frame
afwDisplay.utils.drawSourceMatches(exposure, sourceCat, matches, frame)

return pipeBase.Struct(
refCat = astrom.refCat,
Expand Down Expand Up @@ -463,7 +470,10 @@ def fitWcs(initialWcs, title=None):
else:
self.log.warn("Not calculating a SIP solution; matches may be suspect")

self.display('astrometry', exposure=exposure, sources=sourceCat, matches=matches)
if self._display:
import lsstDebug
frame = lsstDebug.Info(__name__).frame
afwDisplay.utils.drawSourceMatches(exposure, sourceCat, matches, frame)

return sip

Expand Down

0 comments on commit e38b8ab

Please sign in to comment.