LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
Classes | Functions
lsst.pipe.tasks.measurePsf Namespace Reference

Classes

class  MeasurePsfConfig
 
class  MeasurePsfTask
  More...
 

Functions

def showPsfSpatialCells (exposure, cellSet, showBadCandidates, frame=1)
 
def plotPsfCandidates (cellSet, showBadCandidates=False, frame=1)
 
def plotResiduals (exposure, cellSet, showBadCandidates=False, normalizeResiduals=True, frame=2)
 

Function Documentation

◆ plotPsfCandidates()

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

Definition at line 357 of file measurePsf.py.

357 def plotPsfCandidates(cellSet, showBadCandidates=False, frame=1):
358  stamps = []
359  for cell in cellSet.getCellList():
360  for cand in cell.begin(not showBadCandidates): # maybe include bad candidates
361  try:
362  im = cand.getMaskedImage()
363 
364  chi2 = cand.getChi2()
365  if chi2 < 1e100:
366  chi2 = "%.1f" % chi2
367  else:
368  chi2 = float("nan")
369 
370  stamps.append((im, "%d%s" %
371  (maUtils.splitId(cand.getSource().getId(), True)["objId"], chi2),
372  cand.getStatus()))
373  except Exception:
374  continue
375 
376  mos = afwDisplay.utils.Mosaic()
377  disp = afwDisplay.Display(frame=frame)
378  for im, label, status in stamps:
379  im = type(im)(im, True)
380  try:
381  im /= afwMath.makeStatistics(im, afwMath.MAX).getValue()
382  except NotImplementedError:
383  pass
384 
385  mos.append(im, label,
386  afwDisplay.GREEN if status == afwMath.SpatialCellCandidate.GOOD else
387  afwDisplay.YELLOW if status == afwMath.SpatialCellCandidate.UNKNOWN else afwDisplay.RED)
388 
389  if mos.images:
390  disp.mtv(mos.makeMosaic(), title="Psf Candidates")
391 
392 
table::Key< int > type
Definition: Detector.cc:163
Statistics makeStatistics(lsst::afw::image::Image< Pixel > const &img, lsst::afw::image::Mask< image::MaskPixel > const &msk, int const flags, StatisticsControl const &sctrl=StatisticsControl())
Handle a watered-down front-end to the constructor (no variance)
Definition: Statistics.h:359
def plotPsfCandidates(cellSet, showBadCandidates=False, frame=1)
Definition: measurePsf.py:357

◆ plotResiduals()

def lsst.pipe.tasks.measurePsf.plotResiduals (   exposure,
  cellSet,
  showBadCandidates = False,
  normalizeResiduals = True,
  frame = 2 
)

Definition at line 393 of file measurePsf.py.

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

◆ showPsfSpatialCells()

def lsst.pipe.tasks.measurePsf.showPsfSpatialCells (   exposure,
  cellSet,
  showBadCandidates,
  frame = 1 
)

Definition at line 344 of file measurePsf.py.

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