LSST Applications g0f08755f38+9c285cab97,g1635faa6d4+13f3999e92,g1653933729+a8ce1bb630,g1a0ca8cf93+bf6eb00ceb,g28da252d5a+0829b12dee,g29321ee8c0+5700dc9eac,g2bbee38e9b+9634bc57db,g2bc492864f+9634bc57db,g2cdde0e794+c2c89b37c4,g3156d2b45e+41e33cbcdc,g347aa1857d+9634bc57db,g35bb328faa+a8ce1bb630,g3a166c0a6a+9634bc57db,g3e281a1b8c+9f2c4e2fc3,g414038480c+077ccc18e7,g41af890bb2+fde0dd39b6,g5fbc88fb19+17cd334064,g781aacb6e4+a8ce1bb630,g80478fca09+55a9465950,g82479be7b0+d730eedb7d,g858d7b2824+9c285cab97,g9125e01d80+a8ce1bb630,g9726552aa6+10f999ec6a,ga5288a1d22+2a84bb7594,gacf8899fa4+c69c5206e8,gae0086650b+a8ce1bb630,gb58c049af0+d64f4d3760,gc28159a63d+9634bc57db,gcf0d15dbbd+4b7d09cae4,gda3e153d99+9c285cab97,gda6a2b7d83+4b7d09cae4,gdaeeff99f8+1711a396fd,ge2409df99d+5e831397f4,ge79ae78c31+9634bc57db,gf0baf85859+147a0692ba,gf3967379c6+41c94011de,gf3fb38a9a8+8f07a9901b,gfb92a5be7c+9c285cab97,w.2024.46
LSST Data Management Base Package
Loading...
Searching...
No Matches
Classes | Functions
lsst.pipe.tasks.measurePsf Namespace Reference

Classes

class  MeasurePsfConfig
 
class  MeasurePsfTask
 

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 298 of file measurePsf.py.

298def plotPsfCandidates(cellSet, showBadCandidates=False, frame=1):
299 stamps = []
300 for cell in cellSet.getCellList():
301 for cand in cell.begin(not showBadCandidates): # maybe include bad candidates
302 try:
303 im = cand.getMaskedImage()
304
305 chi2 = cand.getChi2()
306 if chi2 < 1e100:
307 chi2 = "%.1f" % chi2
308 else:
309 chi2 = float("nan")
310
311 stamps.append((im, "%d%s" %
312 (maUtils.splitId(cand.getSource().getId(), True)["objId"], chi2),
313 cand.getStatus()))
314 except Exception:
315 continue
316
317 mos = afwDisplay.utils.Mosaic()
318 disp = afwDisplay.Display(frame=frame)
319 for im, label, status in stamps:
320 im = type(im)(im, True)
321 try:
322 im /= afwMath.makeStatistics(im, afwMath.MAX).getValue()
323 except NotImplementedError:
324 pass
325
326 mos.append(im, label,
327 afwDisplay.GREEN if status == afwMath.SpatialCellCandidate.GOOD else
328 afwDisplay.YELLOW if status == afwMath.SpatialCellCandidate.UNKNOWN else afwDisplay.RED)
329
330 if mos.images:
331 disp.mtv(mos.makeMosaic(), title="Psf Candidates")
332
333
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 334 of file measurePsf.py.

334def plotResiduals(exposure, cellSet, showBadCandidates=False, normalizeResiduals=True, frame=2):
335 psf = exposure.getPsf()
336 disp = afwDisplay.Display(frame=frame)
337 while True:
338 try:
339 maUtils.showPsfCandidates(exposure, cellSet, psf=psf, display=disp,
340 normalize=normalizeResiduals,
341 showBadCandidates=showBadCandidates)
342 frame += 1
343 maUtils.showPsfCandidates(exposure, cellSet, psf=psf, display=disp,
344 normalize=normalizeResiduals,
345 showBadCandidates=showBadCandidates,
346 variance=True)
347 frame += 1
348 except Exception:
349 if not showBadCandidates:
350 showBadCandidates = True
351 continue
352 break
353
354 return frame

◆ showPsfSpatialCells()

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

Definition at line 285 of file measurePsf.py.

285def showPsfSpatialCells(exposure, cellSet, showBadCandidates, frame=1):
286 disp = afwDisplay.Display(frame=frame)
287 maUtils.showPsfSpatialCells(exposure, cellSet,
288 symb="o", ctype=afwDisplay.CYAN, ctypeUnused=afwDisplay.YELLOW,
289 size=4, display=disp)
290 for cell in cellSet.getCellList():
291 for cand in cell.begin(not showBadCandidates): # maybe include bad candidates
292 status = cand.getStatus()
293 disp.dot('+', *cand.getSource().getCentroid(),
294 ctype=afwDisplay.GREEN if status == afwMath.SpatialCellCandidate.GOOD else
295 afwDisplay.YELLOW if status == afwMath.SpatialCellCandidate.UNKNOWN else afwDisplay.RED)
296
297