LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
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 469 of file anetAstrometry.py.

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