LSSTApplications  17.0+11,17.0+34,17.0+56,17.0+57,17.0+59,17.0+7,17.0-1-g377950a+33,17.0.1-1-g114240f+2,17.0.1-1-g4d4fbc4+28,17.0.1-1-g55520dc+49,17.0.1-1-g5f4ed7e+52,17.0.1-1-g6dd7d69+17,17.0.1-1-g8de6c91+11,17.0.1-1-gb9095d2+7,17.0.1-1-ge9fec5e+5,17.0.1-1-gf4e0155+55,17.0.1-1-gfc65f5f+50,17.0.1-1-gfc6fb1f+20,17.0.1-10-g87f9f3f+1,17.0.1-11-ge9de802+16,17.0.1-16-ga14f7d5c+4,17.0.1-17-gc79d625+1,17.0.1-17-gdae4c4a+8,17.0.1-2-g26618f5+29,17.0.1-2-g54f2ebc+9,17.0.1-2-gf403422+1,17.0.1-20-g2ca2f74+6,17.0.1-23-gf3eadeb7+1,17.0.1-3-g7e86b59+39,17.0.1-3-gb5ca14a,17.0.1-3-gd08d533+40,17.0.1-30-g596af8797,17.0.1-4-g59d126d+4,17.0.1-4-gc69c472+5,17.0.1-6-g5afd9b9+4,17.0.1-7-g35889ee+1,17.0.1-7-gc7c8782+18,17.0.1-9-gc4bbfb2+3,w.2019.22
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:167

◆ 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