316 def plotApCorr(bbox, xx, yy, zzMeasure, field, title, doPause):
317 """Plot aperture correction fit residuals 319 There are two subplots: residuals against x and y. 321 Intended for debugging. 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 334 import matplotlib.pyplot
as plt
336 zzFit = field.evaluate(xx, yy)
337 residuals = zzMeasure - zzFit
339 fig, axes = plt.subplots(2, 1)
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)
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())
357 print(
"%s: plt.pause() failed. Please close plots when done." % __name__)
360 print(
"%s: Please close plots when done." % __name__)
362 def plotApCorr(bbox, xx, yy, zzMeasure, field, title, doPause)