LSST Applications 27.0.0,g0265f82a02+469cd937ee,g02d81e74bb+21ad69e7e1,g1470d8bcf6+cbe83ee85a,g2079a07aa2+e67c6346a6,g212a7c68fe+04a9158687,g2305ad1205+94392ce272,g295015adf3+81dd352a9d,g2bbee38e9b+469cd937ee,g337abbeb29+469cd937ee,g3939d97d7f+72a9f7b576,g487adcacf7+71499e7cba,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+df404f777f,g5a732f18d5+be83d3ecdb,g64a986408d+21ad69e7e1,g858d7b2824+21ad69e7e1,g8a8a8dda67+a6fc98d2e7,g99cad8db69+f62e5b0af5,g9ddcbc5298+d4bad12328,ga1e77700b3+9c366c4306,ga8c6da7877+71e4819109,gb0e22166c9+25ba2f69a1,gb6a65358fc+469cd937ee,gbb8dafda3b+69d3c0e320,gc07e1c2157+a98bf949bb,gc120e1dc64+615ec43309,gc28159a63d+469cd937ee,gcf0d15dbbd+72a9f7b576,gdaeeff99f8+a38ce5ea23,ge6526c86ff+3a7c1ac5f1,ge79ae78c31+469cd937ee,gee10cc3b42+a6fc98d2e7,gf1cff7945b+21ad69e7e1,gfbcc870c63+9a11dc8c8f
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 261 of file measurePsf.py.

261def plotPsfCandidates(cellSet, showBadCandidates=False, frame=1):
262 stamps = []
263 for cell in cellSet.getCellList():
264 for cand in cell.begin(not showBadCandidates): # maybe include bad candidates
265 try:
266 im = cand.getMaskedImage()
267
268 chi2 = cand.getChi2()
269 if chi2 < 1e100:
270 chi2 = "%.1f" % chi2
271 else:
272 chi2 = float("nan")
273
274 stamps.append((im, "%d%s" %
275 (maUtils.splitId(cand.getSource().getId(), True)["objId"], chi2),
276 cand.getStatus()))
277 except Exception:
278 continue
279
280 mos = afwDisplay.utils.Mosaic()
281 disp = afwDisplay.Display(frame=frame)
282 for im, label, status in stamps:
283 im = type(im)(im, True)
284 try:
285 im /= afwMath.makeStatistics(im, afwMath.MAX).getValue()
286 except NotImplementedError:
287 pass
288
289 mos.append(im, label,
290 afwDisplay.GREEN if status == afwMath.SpatialCellCandidate.GOOD else
291 afwDisplay.YELLOW if status == afwMath.SpatialCellCandidate.UNKNOWN else afwDisplay.RED)
292
293 if mos.images:
294 disp.mtv(mos.makeMosaic(), title="Psf Candidates")
295
296
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 297 of file measurePsf.py.

297def plotResiduals(exposure, cellSet, showBadCandidates=False, normalizeResiduals=True, frame=2):
298 psf = exposure.getPsf()
299 disp = afwDisplay.Display(frame=frame)
300 while True:
301 try:
302 maUtils.showPsfCandidates(exposure, cellSet, psf=psf, display=disp,
303 normalize=normalizeResiduals,
304 showBadCandidates=showBadCandidates)
305 frame += 1
306 maUtils.showPsfCandidates(exposure, cellSet, psf=psf, display=disp,
307 normalize=normalizeResiduals,
308 showBadCandidates=showBadCandidates,
309 variance=True)
310 frame += 1
311 except Exception:
312 if not showBadCandidates:
313 showBadCandidates = True
314 continue
315 break
316
317 return frame

◆ showPsfSpatialCells()

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

Definition at line 248 of file measurePsf.py.

248def showPsfSpatialCells(exposure, cellSet, showBadCandidates, frame=1):
249 disp = afwDisplay.Display(frame=frame)
250 maUtils.showPsfSpatialCells(exposure, cellSet,
251 symb="o", ctype=afwDisplay.CYAN, ctypeUnused=afwDisplay.YELLOW,
252 size=4, display=disp)
253 for cell in cellSet.getCellList():
254 for cand in cell.begin(not showBadCandidates): # maybe include bad candidates
255 status = cand.getStatus()
256 disp.dot('+', *cand.getSource().getCentroid(),
257 ctype=afwDisplay.GREEN if status == afwMath.SpatialCellCandidate.GOOD else
258 afwDisplay.YELLOW if status == afwMath.SpatialCellCandidate.UNKNOWN else afwDisplay.RED)
259
260