LSSTApplications  1.1.2+25,10.0+13,10.0+132,10.0+133,10.0+224,10.0+41,10.0+8,10.0-1-g0f53050+14,10.0-1-g4b7b172+19,10.0-1-g61a5bae+98,10.0-1-g7408a83+3,10.0-1-gc1e0f5a+19,10.0-1-gdb4482e+14,10.0-11-g3947115+2,10.0-12-g8719d8b+2,10.0-15-ga3f480f+1,10.0-2-g4f67435,10.0-2-gcb4bc6c+26,10.0-28-gf7f57a9+1,10.0-3-g1bbe32c+14,10.0-3-g5b46d21,10.0-4-g027f45f+5,10.0-4-g86f66b5+2,10.0-4-gc4fccf3+24,10.0-40-g4349866+2,10.0-5-g766159b,10.0-5-gca2295e+25,10.0-6-g462a451+1
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 394 of file anetAstrometry.py.

395 def showAstrometry(exposure, wcs, allMatches, useMatches, frame=0, title=None, pause=False):
396  """!Show results of astrometry fitting
397 
398  \param exposure Image to display
399  \param wcs Astrometric solution
400  \param allMatches List of all astrometric matches (including rejects)
401  \param useMatches List of used astrometric matches
402  \param frame Frame number for display
403  \param title Title for display
404  \param pause Pause to allow viewing of the display and optional debugging?
405 
406  - Matches are shown in yellow if used in the Wcs solution, otherwise red
407  - +: Detected objects
408  - x: Catalogue objects
409  """
410  import lsst.afw.display.ds9 as ds9
411  ds9.mtv(exposure, frame=frame, title=title)
412 
413  useIndices = set(m.second.getId() for m in useMatches)
414 
415  radii = []
416  with ds9.Buffering():
417  for i, m in enumerate(allMatches):
418  x, y = m.second.getX(), m.second.getY()
419  pix = wcs.skyToPixel(m.first.getCoord())
420 
421  isUsed = m.second.getId() in useIndices
422  if isUsed:
423  radii.append(numpy.hypot(pix[0] - x, pix[1] - y))
424 
425  color = ds9.YELLOW if isUsed else ds9.RED
426 
427  ds9.dot("+", x, y, size=10, frame=frame, ctype=color)
428  ds9.dot("x", pix[0], pix[1], size=10, frame=frame, ctype=color)
429 
430  radii = numpy.array(radii)
431  print "<dr> = %.4g +- %.4g pixels [%d/%d matches]" % (radii.mean(), radii.std(),
432  len(useMatches), len(allMatches))
433 
434  if pause:
435  import sys
436  while True:
437  try:
438  reply = raw_input("Debugging? [p]db [q]uit; any other key to continue... ").strip()
439  except EOFError:
440  reply = ""
441 
442  reply = reply.split()
443  if len(reply) > 1:
444  reply = reply[0]
445  if reply == "p":
446  import pdb;pdb.set_trace()
447  elif reply == "q":
448  sys.exit(1)
449  else:
450  break
def showAstrometry
Show results of astrometry fitting.