LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Classes | Functions
lsst.meas.astrom.anetAstrometry Namespace Reference

Classes

class  ANetAstrometryConfig
 
class  ANetAstrometryTask
 Use astrometry.net to match input sources with a reference catalog and solve for the Wcs. More...
 

Functions

def showAstrometry
 Show results of astrometry fitting. More...
 

Function Documentation

def lsst.meas.astrom.anetAstrometry.showAstrometry (   exposure,
  wcs,
  allMatches,
  useMatches,
  frame = 0,
  title = None,
  pause = False 
)

Show results of astrometry fitting.

Parameters
exposureImage to display
wcsAstrometric solution
allMatchesList of all astrometric matches (including rejects)
useMatchesList of used astrometric matches
frameFrame number for display
titleTitle for display
pausePause to allow viewing of the display and optional debugging?
  • Matches are shown in yellow if used in the Wcs solution, otherwise red
    • +: Detected objects
    • x: Catalogue objects

Definition at line 470 of file anetAstrometry.py.

471 def showAstrometry(exposure, wcs, allMatches, useMatches, frame=0, title=None, pause=False):
472  """!Show results of astrometry fitting
473 
474  \param exposure Image to display
475  \param wcs Astrometric solution
476  \param allMatches List of all astrometric matches (including rejects)
477  \param useMatches List of used astrometric matches
478  \param frame Frame number for display
479  \param title Title for display
480  \param pause Pause to allow viewing of the display and optional debugging?
481 
482  - Matches are shown in yellow if used in the Wcs solution, otherwise red
483  - +: Detected objects
484  - x: Catalogue objects
485  """
486  import lsst.afw.display.ds9 as ds9
487  ds9.mtv(exposure, frame=frame, title=title)
488 
489  useIndices = set(m.second.getId() for m in useMatches)
490 
491  radii = []
492  with ds9.Buffering():
493  for i, m in enumerate(allMatches):
494  x, y = m.second.getX(), m.second.getY()
495  pix = wcs.skyToPixel(m.first.getCoord())
496 
497  isUsed = m.second.getId() in useIndices
498  if isUsed:
499  radii.append(numpy.hypot(pix[0] - x, pix[1] - y))
500 
501  color = ds9.YELLOW if isUsed else ds9.RED
502 
503  ds9.dot("+", x, y, size=10, frame=frame, ctype=color)
504  ds9.dot("x", pix[0], pix[1], size=10, frame=frame, ctype=color)
505 
506  radii = numpy.array(radii)
507  print "<dr> = %.4g +- %.4g pixels [%d/%d matches]" % (radii.mean(), radii.std(),
508  len(useMatches), len(allMatches))
509 
510  if pause:
511  import sys
512  while True:
513  try:
514  reply = raw_input("Debugging? [p]db [q]uit; any other key to continue... ").strip()
515  except EOFError:
516  reply = ""
517 
518  if len(reply) > 1:
519  reply = reply[0]
520  if reply == "p":
521  import pdb;pdb.set_trace()
522  elif reply == "q":
523  sys.exit(1)
524  else:
525  break
def showAstrometry
Show results of astrometry fitting.