LSSTApplications  11.0-22-g33de520,12.1+25,13.0+25,13.0+30,13.0-1-g174df6e+3,13.0-1-g41367f3+3,13.0-1-g47a359c+3,13.0-1-g52a7baa+3,13.0-1-g976b40b+3,13.0-10-gcc6134a+6,13.0-10-gf7c21d5+2,13.0-13-gdd29b46+5,13.0-14-gc9904b0,13.0-2-g15de9a1+3,13.0-2-ga4f5e85+6,13.0-2-gf5c5ced+6,13.0-2-gf9e84ea+5,13.0-22-g8f1d162,13.0-3-g7fa07e0+4,13.0-34-ga37f01a,13.0-4-g0bde1de,13.0-5-g0db1a30+1,13.0-5-g6708b9e+9,13.0-6-g7b63e3f+6,13.0-8-gba0f85f,13.0-9-gc47bba1,master-gb637561bb9
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 494 of file anetAstrometry.py.

495 def showAstrometry(exposure, wcs, allMatches, useMatches, frame=0, title=None, pause=False):
496  """!Show results of astrometry fitting
497 
498  \param exposure Image to display
499  \param wcs Astrometric solution
500  \param allMatches List of all astrometric matches (including rejects)
501  \param useMatches List of used astrometric matches
502  \param frame Frame number for display
503  \param title Title for display
504  \param pause Pause to allow viewing of the display and optional debugging?
505 
506  - Matches are shown in yellow if used in the Wcs solution, otherwise red
507  - +: Detected objects
508  - x: Catalogue objects
509  """
510  import lsst.afw.display.ds9 as ds9
511  ds9.mtv(exposure, frame=frame, title=title)
512 
513  useIndices = set(m.second.getId() for m in useMatches)
514 
515  radii = []
516  with ds9.Buffering():
517  for i, m in enumerate(allMatches):
518  x, y = m.second.getX(), m.second.getY()
519  pix = wcs.skyToPixel(m.first.getCoord())
520 
521  isUsed = m.second.getId() in useIndices
522  if isUsed:
523  radii.append(np.hypot(pix[0] - x, pix[1] - y))
524 
525  color = ds9.YELLOW if isUsed else ds9.RED
526 
527  ds9.dot("+", x, y, size=10, frame=frame, ctype=color)
528  ds9.dot("x", pix[0], pix[1], size=10, frame=frame, ctype=color)
529 
530  radii = np.array(radii)
531  print("<dr> = %.4g +- %.4g pixels [%d/%d matches]" % (radii.mean(), radii.std(),
532  len(useMatches), len(allMatches)))
533 
534  if pause:
535  import sys
536  while True:
537  try:
538  reply = input("Debugging? [p]db [q]uit; any other key to continue... ").strip()
539  except EOFError:
540  reply = ""
541 
542  if len(reply) > 1:
543  reply = reply[0]
544  if reply == "p":
545  import pdb
546  pdb.set_trace()
547  elif reply == "q":
548  sys.exit(1)
549  else:
550  break
def showAstrometry
Show results of astrometry fitting.