LSSTApplications  8.0.0.0+107,8.0.0.1+13,9.1+18,9.2,master-g084aeec0a4,master-g0aced2eed8+6,master-g15627eb03c,master-g28afc54ef9,master-g3391ba5ea0,master-g3d0fb8ae5f,master-g4432ae2e89+36,master-g5c3c32f3ec+17,master-g60f1e072bb+1,master-g6a3ac32d1b,master-g76a88a4307+1,master-g7bce1f4e06+57,master-g8ff4092549+31,master-g98e65bf68e,master-ga6b77976b1+53,master-gae20e2b580+3,master-gb584cd3397+53,master-gc5448b162b+1,master-gc54cf9771d,master-gc69578ece6+1,master-gcbf758c456+22,master-gcec1da163f+63,master-gcf15f11bcc,master-gd167108223,master-gf44c96c709
LSSTDataManagementBasePackage
Classes | Functions
lsst.pipe.tasks.astrometry Namespace Reference

Classes

class  AstrometryConfig
 
class  AstrometryTask
 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.pipe.tasks.astrometry.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 411 of file astrometry.py.

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