LSST Applications g0265f82a02+c6dfa2ddaf,g1162b98a3f+b2075782a9,g2079a07aa2+1b2e822518,g2bbee38e9b+c6dfa2ddaf,g337abbeb29+c6dfa2ddaf,g3ddfee87b4+a60788ef87,g50ff169b8f+2eb0e556e8,g52b1c1532d+90ebb246c7,g555ede804d+a60788ef87,g591dd9f2cf+ba8caea58f,g5ec818987f+864ee9cddb,g858d7b2824+9ee1ab4172,g876c692160+a40945ebb7,g8a8a8dda67+90ebb246c7,g8cdfe0ae6a+4fd9e222a8,g99cad8db69+5e309b7bc6,g9ddcbc5298+a1346535a5,ga1e77700b3+df8f93165b,ga8c6da7877+aa12a14d27,gae46bcf261+c6dfa2ddaf,gb0e22166c9+8634eb87fb,gb3f2274832+d0da15e3be,gba4ed39666+1ac82b564f,gbb8dafda3b+5dfd9c994b,gbeb006f7da+97157f9740,gc28159a63d+c6dfa2ddaf,gc86a011abf+9ee1ab4172,gcf0d15dbbd+a60788ef87,gdaeeff99f8+1cafcb7cd4,gdc0c513512+9ee1ab4172,ge79ae78c31+c6dfa2ddaf,geb67518f79+ba1859f325,geb961e4c1e+f9439d1e6f,gee10cc3b42+90ebb246c7,gf1cff7945b+9ee1ab4172,w.2024.12
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