LSSTApplications  17.0+124,17.0+14,17.0+73,18.0.0+37,18.0.0+80,18.0.0-4-g68ffd23+4,18.1.0-1-g0001055+12,18.1.0-1-g03d53ef+5,18.1.0-1-g1349e88+55,18.1.0-1-g2505f39+44,18.1.0-1-g5315e5e+4,18.1.0-1-g5e4b7ea+14,18.1.0-1-g7e8fceb+4,18.1.0-1-g85f8cd4+48,18.1.0-1-g8ff0b9f+4,18.1.0-1-ga2c679d+1,18.1.0-1-gd55f500+35,18.1.0-10-gb58edde+2,18.1.0-11-g0997b02+4,18.1.0-13-gfe4edf0b+12,18.1.0-14-g259bd21+21,18.1.0-19-gdb69f3f+2,18.1.0-2-g5f9922c+24,18.1.0-2-gd3b74e5+11,18.1.0-2-gfbf3545+32,18.1.0-26-g728bddb4+5,18.1.0-27-g6ff7ca9+2,18.1.0-3-g52aa583+25,18.1.0-3-g8ea57af+9,18.1.0-3-gb69f684+42,18.1.0-3-gfcaddf3+6,18.1.0-32-gd8786685a,18.1.0-4-gf3f9b77+6,18.1.0-5-g1dd662b+2,18.1.0-5-g6dbcb01+41,18.1.0-6-gae77429+3,18.1.0-7-g9d75d83+9,18.1.0-7-gae09a6d+30,18.1.0-9-gc381ef5+4,w.2019.45
LSSTDataManagementBasePackage
Classes | Functions
lsst.pipe.tasks.measurePsf Namespace Reference

Classes

class  MeasurePsfConfig
 
class  MeasurePsfTask
 Measure the PSF. 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 355 of file measurePsf.py.

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

◆ plotResiduals()

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

Definition at line 391 of file measurePsf.py.

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

◆ showPsfSpatialCells()

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

Definition at line 342 of file measurePsf.py.

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