LSSTApplications  20.0.0
LSSTDataManagementBasePackage
Classes | Functions
lsst.meas.algorithms.measureApCorr Namespace Reference

Classes

class  FluxKeys
 
class  MeasureApCorrConfig
 Configuration for MeasureApCorrTask. More...
 
class  MeasureApCorrTask
 Task to measure aperture correction. More...
 

Functions

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

Function Documentation

◆ plotApCorr()

def 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.

@param bbox  Bounding box (for bounds)
@param xx  x coordinates
@param yy  y coordinates
@param zzMeasure  Measured value of the aperture correction
@param field  Fit aperture correction field
@param title  Title for plot
@param doPause  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 316 of file measureApCorr.py.

316 def plotApCorr(bbox, xx, yy, zzMeasure, field, title, doPause):
317  """Plot aperture correction fit residuals
318 
319  There are two subplots: residuals against x and y.
320 
321  Intended for debugging.
322 
323  @param bbox Bounding box (for bounds)
324  @param xx x coordinates
325  @param yy y coordinates
326  @param zzMeasure Measured value of the aperture correction
327  @param field Fit aperture correction field
328  @param title Title for plot
329  @param doPause Pause to inspect the residuals plot? If False,
330  there will be a 4 second delay to allow for
331  inspection of the plot before closing it and
332  moving on.
333  """
334  import matplotlib.pyplot as plt
335 
336  zzFit = field.evaluate(xx, yy)
337  residuals = zzMeasure - zzFit
338 
339  fig, axes = plt.subplots(2, 1)
340 
341  axes[0].scatter(xx, residuals, s=3, marker='o', lw=0, alpha=0.7)
342  axes[1].scatter(yy, residuals, s=3, marker='o', lw=0, alpha=0.7)
343  for ax in axes:
344  ax.set_ylabel("ApCorr Fit Residual")
345  ax.set_ylim(0.9*residuals.min(), 1.1*residuals.max())
346  axes[0].set_xlabel("x")
347  axes[0].set_xlim(bbox.getMinX(), bbox.getMaxX())
348  axes[1].set_xlabel("y")
349  axes[1].set_xlim(bbox.getMinY(), bbox.getMaxY())
350  plt.suptitle(title)
351 
352  if not doPause:
353  try:
354  plt.pause(4)
355  plt.close()
356  except Exception:
357  print("%s: plt.pause() failed. Please close plots when done." % __name__)
358  plt.show()
359  else:
360  print("%s: Please close plots when done." % __name__)
361  plt.show()
lsst::meas::algorithms.measureApCorr.plotApCorr
def plotApCorr(bbox, xx, yy, zzMeasure, field, title, doPause)
Definition: measureApCorr.py:316