LSST Applications g063fba187b+fee0456c91,g0f08755f38+ea96e5a5a3,g1653933729+a8ce1bb630,g168dd56ebc+a8ce1bb630,g1a2382251a+90257ff92a,g20f6ffc8e0+ea96e5a5a3,g217e2c1bcf+937a289c59,g28da252d5a+daa7da44eb,g2bbee38e9b+253935c60e,g2bc492864f+253935c60e,g3156d2b45e+6e55a43351,g32e5bea42b+31359a2a7a,g347aa1857d+253935c60e,g35bb328faa+a8ce1bb630,g3a166c0a6a+253935c60e,g3b1af351f3+a8ce1bb630,g3e281a1b8c+c5dd892a6c,g414038480c+416496e02f,g41af890bb2+afe91b1188,g599934f4f4+0db33f7991,g7af13505b9+e36de7bce6,g80478fca09+da231ba887,g82479be7b0+a4516e59e3,g858d7b2824+ea96e5a5a3,g89c8672015+f4add4ffd5,g9125e01d80+a8ce1bb630,ga5288a1d22+bc6ab8dfbd,gb58c049af0+d64f4d3760,gc28159a63d+253935c60e,gcab2d0539d+3f2b72788c,gcf0d15dbbd+4ea9c45075,gda6a2b7d83+4ea9c45075,gdaeeff99f8+1711a396fd,ge79ae78c31+253935c60e,gef2f8181fd+3031e3cf99,gf0baf85859+c1f95f4921,gfa517265be+ea96e5a5a3,gfa999e8aa5+17cd334064,w.2024.50
LSST Data Management Base Package
Loading...
Searching...
No Matches
Classes | Functions
lsst.meas.algorithms.measureApCorr Namespace Reference

Classes

class  _FluxNames
 
class  MeasureApCorrConfig
 
class  MeasureApCorrError
 
class  MeasureApCorrTask
 

Functions

 plotApCorr (bbox, xx, yy, zzMeasure, field, title, doPause)
 

Function Documentation

◆ plotApCorr()

lsst.meas.algorithms.measureApCorr.plotApCorr ( bbox,
xx,
yy,
zzMeasure,
field,
title,
doPause )
Plot aperture correction fit residuals

There are two subplots: residuals against x and y.

Intended for debugging.

Parameters
----------
bbox : `lsst.geom.Box2I`
    Bounding box (for bounds)
xx, yy : `numpy.ndarray`, (N)
    x and y coordinates
zzMeasure : `float`
    Measured value of the aperture correction
field : `lsst.afw.math.ChebyshevBoundedField`
    Fit aperture correction field
title : 'str'
    Title for plot
doPause : `bool`
    Pause to inspect the residuals plot? If
    False, there will be a 4 second delay to
    allow for inspection of the plot before
    closing it and moving on.

Definition at line 389 of file measureApCorr.py.

389def plotApCorr(bbox, xx, yy, zzMeasure, field, title, doPause):
390 """Plot aperture correction fit residuals
391
392 There are two subplots: residuals against x and y.
393
394 Intended for debugging.
395
396 Parameters
397 ----------
398 bbox : `lsst.geom.Box2I`
399 Bounding box (for bounds)
400 xx, yy : `numpy.ndarray`, (N)
401 x and y coordinates
402 zzMeasure : `float`
403 Measured value of the aperture correction
404 field : `lsst.afw.math.ChebyshevBoundedField`
405 Fit aperture correction field
406 title : 'str'
407 Title for plot
408 doPause : `bool`
409 Pause to inspect the residuals plot? If
410 False, there will be a 4 second delay to
411 allow for inspection of the plot before
412 closing it and moving on.
413 """
414 import matplotlib.pyplot as plt
415
416 zzFit = field.evaluate(xx, yy)
417 residuals = zzMeasure - zzFit
418
419 fig, axes = plt.subplots(2, 1)
420
421 axes[0].scatter(xx, residuals, s=3, marker='o', lw=0, alpha=0.7)
422 axes[1].scatter(yy, residuals, s=3, marker='o', lw=0, alpha=0.7)
423 for ax in axes:
424 ax.set_ylabel("ApCorr Fit Residual")
425 ax.set_ylim(0.9*residuals.min(), 1.1*residuals.max())
426 axes[0].set_xlabel("x")
427 axes[0].set_xlim(bbox.getMinX(), bbox.getMaxX())
428 axes[1].set_xlabel("y")
429 axes[1].set_xlim(bbox.getMinY(), bbox.getMaxY())
430 plt.suptitle(title)
431
432 if not doPause:
433 try:
434 plt.pause(4)
435 plt.close()
436 except Exception:
437 print("%s: plt.pause() failed. Please close plots when done." % __name__)
438 plt.show()
439 else:
440 print("%s: Please close plots when done." % __name__)
441 plt.show()