Skip to content

Commit

Permalink
Pass log args separately in ANetAstrometryTask
Browse files Browse the repository at this point in the history
so the formatting can be deferred until it is known if the message
is to be logged.
  • Loading branch information
r-owen committed Jul 11, 2018
1 parent 67b4993 commit 7f16872
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions python/lsst/meas/extensions/astrometryNet/anetAstrometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def loadAndMatch(self, exposure, sourceCat, bbox=None):
matchMeta = astrom.getMatchMetadata()
if matches is None or len(matches) == 0:
raise RuntimeError("No astrometric matches")
self.log.info("%d astrometric matches" % (len(matches)))
self.log.info("%d astrometric matches", len(matches))

if self._display:
frame = lsstDebug.Info(__name__).frame
Expand Down Expand Up @@ -362,7 +362,7 @@ def _astrometry(self, sourceCat, exposure, bbox=None):
matchMeta = astrom.getMatchMetadata()
if matches is None or len(matches) == 0:
raise RuntimeError("No astrometric matches")
self.log.info("%d astrometric matches" % (len(matches)))
self.log.info("%d astrometric matches", len(matches))

# Note that this is the Wcs for the provided positions, which may be distorted
exposure.setWcs(astrom.getWcs())
Expand Down Expand Up @@ -434,10 +434,10 @@ def fitWcs(initialWcs, title=None):
wcs, scatter = fitWcs(wcs, title="Final astrometry")

except lsst.pex.exceptions.LengthError as e:
self.log.warn("Unable to fit SIP: %s" % e)
self.log.warn("Unable to fit SIP: %s", e)

self.log.info("Astrometric scatter: %f arcsec (%d matches, %d rejected)" %
(scatter.asArcseconds(), len(matches), numRejected))
self.log.info("Astrometric scatter: %f arcsec (%d matches, %d rejected)",
scatter.asArcseconds(), len(matches), numRejected)
exposure.setWcs(wcs)

# Apply WCS to sources
Expand Down

0 comments on commit 7f16872

Please sign in to comment.