Loading [MathJax]/extensions/tex2jax.js
LSST Applications g04a91732dc+7fec47d7bc,g07dc498a13+5ab4d22ec3,g0fba68d861+565de8e5d5,g1409bbee79+5ab4d22ec3,g1a7e361dbc+5ab4d22ec3,g1fd858c14a+11200c7927,g20f46db602+25d63fd678,g35bb328faa+fcb1d3bbc8,g4d2262a081+61302e889d,g4d39ba7253+d05e267ece,g4e0f332c67+5d362be553,g53246c7159+fcb1d3bbc8,g60b5630c4e+d05e267ece,g78460c75b0+2f9a1b4bcd,g786e29fd12+cf7ec2a62a,g7b71ed6315+fcb1d3bbc8,g8048e755c2+a1301e4c20,g8852436030+163ceb82d8,g89139ef638+5ab4d22ec3,g89e1512fd8+fbb808ebce,g8d6b6b353c+d05e267ece,g9125e01d80+fcb1d3bbc8,g989de1cb63+5ab4d22ec3,g9f33ca652e+8abe617c77,ga9baa6287d+d05e267ece,gaaedd4e678+5ab4d22ec3,gabe3b4be73+1e0a283bba,gb1101e3267+fefe9ce5b1,gb58c049af0+f03b321e39,gb90eeb9370+824c420ec4,gc741bbaa4f+77ddc33078,gcf25f946ba+163ceb82d8,gd315a588df+0f88d5218e,gd6cbbdb0b4+c8606af20c,gd9a9a58781+fcb1d3bbc8,gde0f65d7ad+e6bd566e97,ge278dab8ac+932305ba37,ge82c20c137+76d20ab76d,w.2025.10
LSST Data Management Base Package
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
lsst.pipe.tasks.measurePsf Namespace Reference

Classes

class  MeasurePsfConfig
 
class  MeasurePsfTask
 
class  NonfinitePsfShapeError
 

Functions

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

Function Documentation

◆ plotPsfCandidates()

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

Definition at line 330 of file measurePsf.py.

330def plotPsfCandidates(cellSet, showBadCandidates=False, frame=1):
331 stamps = []
332 for cell in cellSet.getCellList():
333 for cand in cell.begin(not showBadCandidates): # maybe include bad candidates
334 try:
335 im = cand.getMaskedImage()
336
337 chi2 = cand.getChi2()
338 if chi2 < 1e100:
339 chi2 = "%.1f" % chi2
340 else:
341 chi2 = float("nan")
342
343 stamps.append((im, "%d%s" %
344 (maUtils.splitId(cand.getSource().getId(), True)["objId"], chi2),
345 cand.getStatus()))
346 except Exception:
347 continue
348
349 mos = afwDisplay.utils.Mosaic()
350 disp = afwDisplay.Display(frame=frame)
351 for im, label, status in stamps:
352 im = type(im)(im, True)
353 try:
354 im /= afwMath.makeStatistics(im, afwMath.MAX).getValue()
355 except NotImplementedError:
356 pass
357
358 mos.append(im, label,
359 afwDisplay.GREEN if status == afwMath.SpatialCellCandidate.GOOD else
360 afwDisplay.YELLOW if status == afwMath.SpatialCellCandidate.UNKNOWN else afwDisplay.RED)
361
362 if mos.images:
363 disp.mtv(mos.makeMosaic(), title="Psf Candidates")
364
365
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:361

◆ plotResiduals()

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

Definition at line 366 of file measurePsf.py.

366def plotResiduals(exposure, cellSet, showBadCandidates=False, normalizeResiduals=True, frame=2):
367 psf = exposure.getPsf()
368 disp = afwDisplay.Display(frame=frame)
369 while True:
370 try:
371 maUtils.showPsfCandidates(exposure, cellSet, psf=psf, display=disp,
372 normalize=normalizeResiduals,
373 showBadCandidates=showBadCandidates)
374 frame += 1
375 maUtils.showPsfCandidates(exposure, cellSet, psf=psf, display=disp,
376 normalize=normalizeResiduals,
377 showBadCandidates=showBadCandidates,
378 variance=True)
379 frame += 1
380 except Exception:
381 if not showBadCandidates:
382 showBadCandidates = True
383 continue
384 break
385
386 return frame

◆ showPsfSpatialCells()

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

Definition at line 317 of file measurePsf.py.

317def showPsfSpatialCells(exposure, cellSet, showBadCandidates, frame=1):
318 disp = afwDisplay.Display(frame=frame)
319 maUtils.showPsfSpatialCells(exposure, cellSet,
320 symb="o", ctype=afwDisplay.CYAN, ctypeUnused=afwDisplay.YELLOW,
321 size=4, display=disp)
322 for cell in cellSet.getCellList():
323 for cand in cell.begin(not showBadCandidates): # maybe include bad candidates
324 status = cand.getStatus()
325 disp.dot('+', *cand.getSource().getCentroid(),
326 ctype=afwDisplay.GREEN if status == afwMath.SpatialCellCandidate.GOOD else
327 afwDisplay.YELLOW if status == afwMath.SpatialCellCandidate.UNKNOWN else afwDisplay.RED)
328
329