895 def run(self, exposure, amp, isTransposed=False):
896 """Measure and remove serial/parallel overscan from an amplifier image.
898 This will be deprecated.
902 exposure : `lsst.afw.image.Exposure`
903 Image data that will have the overscan corrections applied.
904 amp : `lsst.afw.cameraGeom.Amplifier`
905 Amplifier to use for debugging purposes.
906 isTransposed : `bool`, optional
907 Is the image transposed, such that serial and parallel
908 overscan regions are reversed? Default is False.
912 overscanResults : `lsst.pipe.base.Struct`
913 Result struct with components:
916 Value or fit subtracted from the amplifier image data
917 (scalar or `lsst.afw.image.Image`).
919 Value or fit subtracted from the serial overscan image
920 data (scalar or `lsst.afw.image.Image`).
922 Image of the serial overscan region with the serial
923 overscan correction applied
924 (`lsst.afw.image.Image`). This quantity is used to
925 estimate the amplifier read noise empirically.
926 ``parallelOverscanFit``
927 Value or fit subtracted from the parallel overscan
928 image data (scalar, `lsst.afw.image.Image`, or None).
929 ``parallelOverscanImage``
930 Image of the parallel overscan region with the
931 parallel overscan correction applied
932 (`lsst.afw.image.Image` or None).
934 Mean of the fit serial overscan region.
935 This and the following values will be tuples of
936 (serial, parallel) if doParallelOverscan=True.
938 Median of the fit serial overscan region.
940 Sigma of the fit serial overscan region.
942 Mean of the residual of the serial overscan region after
945 Median of the residual of the serial overscan region after
948 Mean of the residual of the serial overscan region after
955 Raised if an invalid overscan type is set.
958 serialOverscanBBox = amp.getRawSerialOverscanBBox()
959 imageBBox = amp.getRawDataBBox()
961 if self.config.doParallelOverscan:
964 parallelOverscanBBox = amp.getRawParallelOverscanBBox()
965 imageBBox = imageBBox.expandedTo(parallelOverscanBBox)
969 geom.Point2I(serialOverscanBBox.getMinX(), imageBBox.getEndY()),
970 geom.Extent2I(imageBBox.getWidth(), serialOverscanBBox.getHeight()),
975 imageBBox.getMinY()),
977 imageBBox.getHeight()),
985 isTransposed=isTransposed,
986 leadingToSkip=self.config.leadingColumnsToSkip,
987 trailingToSkip=self.config.trailingColumnsToSkip,
989 overscanMean = serialResults.overscanMean
990 overscanMedian = serialResults.overscanMedian
991 overscanSigma = serialResults.overscanSigma
992 residualMean = serialResults.overscanMeanResidual
993 residualMedian = serialResults.overscanMedianResidual
994 residualSigma = serialResults.overscanSigmaResidual
997 parallelResults =
None
998 if self.config.doParallelOverscan:
1001 parallelOverscanBBox = amp.getRawParallelOverscanBBox()
1002 imageBBox = amp.getRawDataBBox()
1018 parallelOverscanBBox,
1019 isTransposed=
not isTransposed,
1020 leadingToSkip=self.config.leadingRowsToSkip,
1021 trailingToSkip=self.config.trailingRowsToSkip,
1023 overscanMean = (overscanMean, parallelResults.overscanMean)
1024 overscanMedian = (overscanMedian, parallelResults.overscanMedian)
1025 overscanSigma = (overscanSigma, parallelResults.overscanSigma)
1026 residualMean = (residualMean, parallelResults.overscanMeanResidual)
1027 residualMedian = (residualMedian, parallelResults.overscanMedianResidual)
1028 residualSigma = (residualSigma, parallelResults.overscanSigmaResidual)
1030 parallelOverscanFit = parallelResults.overscanOverscanModel
if parallelResults
else None
1031 parallelOverscanImage = parallelResults.overscanImage
if parallelResults
else None
1033 return pipeBase.Struct(imageFit=serialResults.ampOverscanModel,
1034 overscanFit=serialResults.overscanOverscanModel,
1035 overscanImage=serialResults.overscanImage,
1037 parallelOverscanFit=parallelOverscanFit,
1038 parallelOverscanImage=parallelOverscanImage,
1039 overscanMean=overscanMean,
1040 overscanMedian=overscanMedian,
1041 overscanSigma=overscanSigma,
1042 residualMean=residualMean,
1043 residualMedian=residualMedian,
1044 residualSigma=residualSigma)