LSST Applications g0d97872fb5+4fd969bb9d,g1653933729+34a971ddd9,g28da252d5a+072f89fe25,g2bbee38e9b+a99b0ab4cd,g2bc492864f+a99b0ab4cd,g2ca4be77d2+c0e3b27cd8,g2cdde0e794+704103fe75,g3156d2b45e+6e87dc994a,g347aa1857d+a99b0ab4cd,g35bb328faa+34a971ddd9,g3a166c0a6a+a99b0ab4cd,g3e281a1b8c+8ec26ec694,g4005a62e65+ba0306790b,g414038480c+9ed5ed841a,g569e0e2b34+cb4faa46ad,g5a97de2502+520531a62c,g717e5f8c0f+29153700a5,g7ede599f99+367733290c,g80478fca09+17051a22cc,g82479be7b0+f2f1ea0a87,g858d7b2824+29153700a5,g8b782ad322+29153700a5,g8cd86fa7b1+05420e7f7d,g9125e01d80+34a971ddd9,ga5288a1d22+e7f674aaf3,gae0086650b+34a971ddd9,gae74b0b5c6+45ef5cdc51,gb58c049af0+ace264a4f2,gc28159a63d+a99b0ab4cd,gcf0d15dbbd+8051a81198,gda6a2b7d83+8051a81198,gdaeeff99f8+7774323b41,gdf4d240d4a+34a971ddd9,ge2409df99d+cb167bac99,ge33fd446bb+29153700a5,ge79ae78c31+a99b0ab4cd,gf0baf85859+890af219f9,gf5289d68f6+9faa5c5784,w.2024.36
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