1213 def run(self, exposure, amp, isTransposed=False):
1214 """Measure and remove parallel overscan from an amplifier image.
1215
1216 This method assumes that serial overscan has already been
1217 removed from the amplifier.
1218
1219 Parameters
1220 ----------
1221 exposure : `lsst.afw.image.Exposure`
1222 Image data that will have the overscan corrections applied.
1223 amp : `lsst.afw.cameraGeom.Amplifier`
1224 Amplifier to use for debugging purposes.
1225 isTransposed : `bool`, optional
1226 Is the image transposed, such that serial and parallel
1227 overscan regions are reversed? Default is False.
1228
1229 Returns
1230 -------
1231 overscanResults : `lsst.pipe.base.Struct`
1232 Result struct with components:
1233
1234 ``imageFit``
1235 Value or fit subtracted from the amplifier image data
1236 (scalar or `lsst.afw.image.Image`).
1237 ``overscanFit``
1238 Value or fit subtracted from the parallel overscan image
1239 data (scalar or `lsst.afw.image.Image`).
1240 ``overscanImage``
1241 Image of the parallel overscan region with the parallel
1242 overscan correction applied
1243 (`lsst.afw.image.Image`). This quantity is used to
1244 estimate the amplifier read noise empirically.
1245 ``overscanMean``
1246 Mean of the fit parallel overscan region.
1247 ``overscanMedian``
1248 Median of the fit parallel overscan region.
1249 ``overscanSigma``
1250 Sigma of the fit parallel overscan region.
1251 ``residualMean``
1252 Mean of the residual of the parallel overscan region after
1253 correction.
1254 ``residualMedian``
1255 Median of the residual of the parallel overscan region after
1256 correction.
1257 ``residualSigma``
1258 Mean of the residual of the parallel overscan region after
1259 correction.
1260
1261 Raises
1262 ------
1263 RuntimeError
1264 Raised if an invalid overscan type is set.
1265 """
1266
1267
1268 parallelOverscanBBox = amp.getRawParallelOverscanBBox()
1269 imageBBox = amp.getRawDataBBox()
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281 results = self.correctOverscan(
1282 exposure,
1283 amp,
1284 imageBBox,
1285 parallelOverscanBBox,
1286 isTransposed=not isTransposed,
1287 leadingToSkip=self.config.leadingToSkip,
1288 trailingToSkip=self.config.trailingToSkip,
1289 )
1290 overscanMean = results.overscanMean
1291 overscanMedian = results.overscanMedian
1292 overscanSigma = results.overscanSigma
1293 residualMean = results.overscanMeanResidual
1294 residualMedian = results.overscanMedianResidual
1295 residualSigma = results.overscanSigmaResidual
1296
1297 return pipeBase.Struct(
1298 imageFit=results.ampOverscanModel,
1299 overscanFit=results.overscanOverscanModel,
1300 overscanImage=results.overscanImage,
1301 overscanMean=overscanMean,
1302 overscanMedian=overscanMedian,
1303 overscanSigma=overscanSigma,
1304 residualMean=residualMean,
1305 residualMedian=residualMedian,
1306 residualSigma=residualSigma,
1307 )
1308