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.pipe.tasks.measurePsf Namespace Reference

Classes

class  MeasurePsfConfig
 
class  MeasurePsfTask
 Measure the PSF. More...
 

Functions

def showPsfSpatialCells
 
def plotPsfCandidates
 
def plotResiduals
 

Function Documentation

def lsst.pipe.tasks.measurePsf.plotPsfCandidates (   cellSet,
  showBadCandidates = False,
  frame = 1 
)

Definition at line 354 of file measurePsf.py.

355 def plotPsfCandidates(cellSet, showBadCandidates=False, frame=1):
356  import lsst.afw.display.utils as displayUtils
357 
358  stamps = []
359  for cell in cellSet.getCellList():
360  for cand in cell.begin(not showBadCandidates): # maybe include bad candidates
361  cand = measAlg.cast_PsfCandidateF(cand)
362 
363  try:
364  im = cand.getMaskedImage()
365 
366  chi2 = cand.getChi2()
367  if chi2 < 1e100:
368  chi2 = "%.1f" % chi2
369  else:
370  chi2 = numpy.nan
371 
372  stamps.append((im, "%d%s" %
373  (maUtils.splitId(cand.getSource().getId(), True)["objId"], chi2),
374  cand.getStatus()))
375  except Exception, e:
376  continue
377 
378  mos = displayUtils.Mosaic()
379  for im, label, status in stamps:
380  im = type(im)(im, True)
381  try:
382  im /= afwMath.makeStatistics(im, afwMath.MAX).getValue()
383  except NotImplementedError:
384  pass
385 
386  mos.append(im, label,
387  ds9.GREEN if status == afwMath.SpatialCellCandidate.GOOD else
388  ds9.YELLOW if status == afwMath.SpatialCellCandidate.UNKNOWN else ds9.RED)
389 
390  if mos.images:
391  mos.makeMosaic(frame=frame, title="Psf Candidates")
Statistics makeStatistics(afwImage::Mask< afwImage::MaskPixel > const &msk, int const flags, StatisticsControl const &sctrl)
Specialization to handle Masks.
Definition: Statistics.cc:1023
def lsst.pipe.tasks.measurePsf.plotResiduals (   exposure,
  cellSet,
  showBadCandidates = False,
  normalizeResiduals = True,
  frame = 2 
)

Definition at line 392 of file measurePsf.py.

393 def plotResiduals(exposure, cellSet, showBadCandidates=False, normalizeResiduals=True, frame=2):
394  psf = exposure.getPsf()
395  while True:
396  try:
397  maUtils.showPsfCandidates(exposure, cellSet, psf=psf, frame=frame,
398  normalize=normalizeResiduals,
399  showBadCandidates=showBadCandidates)
400  frame += 1
401  maUtils.showPsfCandidates(exposure, cellSet, psf=psf, frame=frame,
402  normalize=normalizeResiduals,
403  showBadCandidates=showBadCandidates,
404  variance=True)
405  frame += 1
406  except Exception as e:
407  if not showBadCandidates:
408  showBadCandidates = True
409  continue
410  break
411 
412  return frame
def lsst.pipe.tasks.measurePsf.showPsfSpatialCells (   exposure,
  cellSet,
  showBadCandidates,
  frame = 1 
)

Definition at line 342 of file measurePsf.py.

343 def showPsfSpatialCells(exposure, cellSet, showBadCandidates, frame=1):
344  maUtils.showPsfSpatialCells(exposure, cellSet,
345  symb="o", ctype=ds9.CYAN, ctypeUnused=ds9.YELLOW,
346  size=4, frame=frame)
347  for cell in cellSet.getCellList():
348  for cand in cell.begin(not showBadCandidates): # maybe include bad candidates
349  cand = measAlg.cast_PsfCandidateF(cand)
350  status = cand.getStatus()
351  ds9.dot('+', *cand.getSource().getCentroid(), frame=frame,
352  ctype=ds9.GREEN if status == afwMath.SpatialCellCandidate.GOOD else
353  ds9.YELLOW if status == afwMath.SpatialCellCandidate.UNKNOWN else ds9.RED)