LSSTApplications  18.1.0
LSSTDataManagementBasePackage
Classes | Functions
lsst.meas.extensions.astrometryNet.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 (exposure, wcs, allMatches, useMatches, frame=0, title=None, pause=False)
 Show results of astrometry fitting. More...
 

Function Documentation

◆ showAstrometry()

def lsst.meas.extensions.astrometryNet.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 456 of file anetAstrometry.py.

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