LSST Applications g04a91732dc+146a938ab0,g07dc498a13+80b84b0d75,g0fba68d861+4c4f3dcb5c,g1409bbee79+80b84b0d75,g1a7e361dbc+80b84b0d75,g1fd858c14a+f6e422e056,g20f46db602+333b6c0f32,g35bb328faa+fcb1d3bbc8,g42c1b31a95+a1301e4c20,g4d2262a081+f1facf12e5,g4d39ba7253+9b833be27e,g4e0f332c67+5d362be553,g53246c7159+fcb1d3bbc8,g60b5630c4e+9b833be27e,g78460c75b0+2f9a1b4bcd,g786e29fd12+cf7ec2a62a,g7b71ed6315+fcb1d3bbc8,g8852436030+790117df0f,g89139ef638+80b84b0d75,g8d6b6b353c+9b833be27e,g9125e01d80+fcb1d3bbc8,g989de1cb63+80b84b0d75,g9f33ca652e+9c6b68d7f3,ga9baa6287d+9b833be27e,gaaedd4e678+80b84b0d75,gabe3b4be73+1e0a283bba,gb1101e3267+9f3571abad,gb58c049af0+f03b321e39,gb90eeb9370+691e4ab549,gc741bbaa4f+2bcd3860df,gcf25f946ba+790117df0f,gd315a588df+5b65d88fe4,gd6cbbdb0b4+c8606af20c,gd9a9a58781+fcb1d3bbc8,gde0f65d7ad+ee6a3faa19,ge278dab8ac+932305ba37,ge82c20c137+76d20ab76d,gee8db133a9+2a6ae0040b,w.2025.10
LSST Data Management Base Package
Loading...
Searching...
No Matches
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