LSST Applications  21.0.0-147-g0e635eb1+1acddb5be5,22.0.0+052faf71bd,22.0.0+1ea9a8b2b2,22.0.0+6312710a6c,22.0.0+729191ecac,22.0.0+7589c3a021,22.0.0+9f079a9461,22.0.1-1-g7d6de66+b8044ec9de,22.0.1-1-g87000a6+536b1ee016,22.0.1-1-g8e32f31+6312710a6c,22.0.1-10-gd060f87+016f7cdc03,22.0.1-12-g9c3108e+df145f6f68,22.0.1-16-g314fa6d+c825727ab8,22.0.1-19-g93a5c75+d23f2fb6d8,22.0.1-19-gb93eaa13+aab3ef7709,22.0.1-2-g8ef0a89+b8044ec9de,22.0.1-2-g92698f7+9f079a9461,22.0.1-2-ga9b0f51+052faf71bd,22.0.1-2-gac51dbf+052faf71bd,22.0.1-2-gb66926d+6312710a6c,22.0.1-2-gcb770ba+09e3807989,22.0.1-20-g32debb5+b8044ec9de,22.0.1-23-gc2439a9a+fb0756638e,22.0.1-3-g496fd5d+09117f784f,22.0.1-3-g59f966b+1e6ba2c031,22.0.1-3-g849a1b8+f8b568069f,22.0.1-3-gaaec9c0+c5c846a8b1,22.0.1-32-g5ddfab5d3+60ce4897b0,22.0.1-4-g037fbe1+64e601228d,22.0.1-4-g8623105+b8044ec9de,22.0.1-5-g096abc9+d18c45d440,22.0.1-5-g15c806e+57f5c03693,22.0.1-7-gba73697+57f5c03693,master-g6e05de7fdc+c1283a92b8,master-g72cdda8301+729191ecac,w.2021.39
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 356 of file measurePsf.py.

356 def plotPsfCandidates(cellSet, showBadCandidates=False, frame=1):
357  stamps = []
358  for cell in cellSet.getCellList():
359  for cand in cell.begin(not showBadCandidates): # maybe include bad candidates
360  try:
361  im = cand.getMaskedImage()
362 
363  chi2 = cand.getChi2()
364  if chi2 < 1e100:
365  chi2 = "%.1f" % chi2
366  else:
367  chi2 = float("nan")
368 
369  stamps.append((im, "%d%s" %
370  (maUtils.splitId(cand.getSource().getId(), True)["objId"], chi2),
371  cand.getStatus()))
372  except Exception:
373  continue
374 
375  mos = afwDisplay.utils.Mosaic()
376  disp = afwDisplay.Display(frame=frame)
377  for im, label, status in stamps:
378  im = type(im)(im, True)
379  try:
380  im /= afwMath.makeStatistics(im, afwMath.MAX).getValue()
381  except NotImplementedError:
382  pass
383 
384  mos.append(im, label,
385  afwDisplay.GREEN if status == afwMath.SpatialCellCandidate.GOOD else
386  afwDisplay.YELLOW if status == afwMath.SpatialCellCandidate.UNKNOWN else afwDisplay.RED)
387 
388  if mos.images:
389  disp.mtv(mos.makeMosaic(), title="Psf Candidates")
390 
391 
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:356

◆ plotResiduals()

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

Definition at line 392 of file measurePsf.py.

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

◆ showPsfSpatialCells()

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

Definition at line 343 of file measurePsf.py.

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