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.astrometry Namespace Reference

Classes

class  AstrometryConfig
 
class  AstrometryTask
 Match an input source catalog with objects from a reference catalog and solve for the WCS. More...
 

Functions

def showAstrometry
 

Function Documentation

def lsst.meas.astrom.astrometry.showAstrometry (   refCat,
  sourceCat,
  bbox = None,
  exposure = None,
  matches = None,
  frame = 1,
  title = "" 
)
Show an astrometry debug image

@param[in] refCat  reference object catalog; must have fields "centroid_x" and "centroid_y"
@param[in] sourceCat  source catalog; must have field "slot_Centroid_x" and "slot_Centroid_y"
@param[in] exposure  exposure to display, or None for a blank exposure
@param[in] bbox  bounding box of exposure; required if exposure is None and ignored otherwise
@param[in] matches  list of matches (an lsst.afw.table.ReferenceMatchVector), or None
@param[in] frame  frame number for ds9 display
@param[in] title  title for ds9 display

@throw RuntimeError if exposure and bbox are both None

Definition at line 345 of file astrometry.py.

346 def showAstrometry(refCat, sourceCat, bbox=None, exposure=None, matches=None, frame=1, title=""):
347  """Show an astrometry debug image
348 
349  @param[in] refCat reference object catalog; must have fields "centroid_x" and "centroid_y"
350  @param[in] sourceCat source catalog; must have field "slot_Centroid_x" and "slot_Centroid_y"
351  @param[in] exposure exposure to display, or None for a blank exposure
352  @param[in] bbox bounding box of exposure; required if exposure is None and ignored otherwise
353  @param[in] matches list of matches (an lsst.afw.table.ReferenceMatchVector), or None
354  @param[in] frame frame number for ds9 display
355  @param[in] title title for ds9 display
356 
357  @throw RuntimeError if exposure and bbox are both None
358  """
359  import lsst.afw.display.ds9 as ds9
360 
361  if exposure is None:
362  if bbox is None:
363  raise RuntimeError("must specify exposure or bbox")
364  exposure = ExposureF(bbox)
365  ds9.mtv(exposure, frame=frame, title=title)
366 
367  with ds9.Buffering():
368  refCentroidKey = Point2DKey(refCat.schema["centroid"])
369  for refObj in refCat:
370  x, y = refObj.get(refCentroidKey)
371  ds9.dot("x", x, y, size=10, frame=frame, ctype=ds9.RED)
372 
373  sourceCentroidKey = Point2DKey(sourceCat.schema["slot_Centroid"])
374  for source in sourceCat:
375  x, y = source.get(sourceCentroidKey)
376  ds9.dot("+", x, y, size=10, frame=frame, ctype=ds9.GREEN)
377 
378  if matches:
379  radArr = numpy.ndarray(len(matches))
380 
381  for i, m in enumerate(matches):
382  refCentroid = m.first.get(refCentroidKey)
383  sourceCentroid = m.second.get(sourceCentroidKey)
384  radArr[i] = math.hypot(*(refCentroid - sourceCentroid))
385  ds9.dot("o", x, y, size=10, frame=frame, ctype=ds9.YELLOW)
386 
387  print("<match radius> = %.4g +- %.4g [%d matches]" %
388  (radArr.mean(), radArr.std(), len(matches)))
PointKey< double > Point2DKey
Definition: aggregates.h:119