LSST Applications 24.1.5,g02d81e74bb+fa3a7a026e,g180d380827+a53a32eff8,g2079a07aa2+86d27d4dc4,g2305ad1205+c0501b3732,g295015adf3+7d3e92f0ec,g2bbee38e9b+0e5473021a,g337abbeb29+0e5473021a,g33d1c0ed96+0e5473021a,g3a166c0a6a+0e5473021a,g3ddfee87b4+5dd1654d75,g48712c4677+3bf1020dcb,g487adcacf7+065c13d9cf,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+d7ac436cfb,g5a732f18d5+53520f316c,g64a986408d+fa3a7a026e,g858d7b2824+fa3a7a026e,g8a8a8dda67+585e252eca,g99cad8db69+a5a909b84f,g9ddcbc5298+9a081db1e4,ga1e77700b3+15fc3df1f7,ga8c6da7877+4cf350ccb2,gb0e22166c9+60f28cb32d,gba4ed39666+c2a2e4ac27,gbb8dafda3b+f991a0b59f,gc120e1dc64+9ccbfdb8be,gc28159a63d+0e5473021a,gcf0d15dbbd+5dd1654d75,gd96a1ce819+42fd0ee607,gdaeeff99f8+f9a426f77a,ge6526c86ff+0d71447b4b,ge79ae78c31+0e5473021a,gee10cc3b42+585e252eca,gff1a9f87cc+fa3a7a026e
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Static Protected Attributes | List of all members
lsst.ip.isr.overscan.OverscanCorrectionTask Class Reference
Inheritance diagram for lsst.ip.isr.overscan.OverscanCorrectionTask:
lsst.ip.isr.overscan.OverscanCorrectionTaskBase

Public Member Functions

 run (self, exposure, amp, isTransposed=False)
 

Static Public Attributes

 ConfigClass = OverscanCorrectionTaskConfig
 

Static Protected Attributes

str _DefaultName = "overscan"
 

Detailed Description

Correction task for serial/parallel overscan.

(Will be deprecated)

This class contains a number of utilities that are easier to
understand and use when they are not embedded in nested if/else
loops.

Parameters
----------
statControl : `lsst.afw.math.StatisticsControl`, optional
    Statistics control object.

Definition at line 878 of file overscan.py.

Member Function Documentation

◆ run()

lsst.ip.isr.overscan.OverscanCorrectionTask.run ( self,
exposure,
amp,
isTransposed = False )
Measure and remove serial/parallel overscan from an amplifier image.

This will be deprecated.

Parameters
----------
exposure : `lsst.afw.image.Exposure`
    Image data that will have the overscan corrections applied.
amp : `lsst.afw.cameraGeom.Amplifier`
    Amplifier to use for debugging purposes.
isTransposed : `bool`, optional
    Is the image transposed, such that serial and parallel
    overscan regions are reversed?  Default is False.

Returns
-------
overscanResults : `lsst.pipe.base.Struct`
    Result struct with components:

    ``imageFit``
        Value or fit subtracted from the amplifier image data
        (scalar or `lsst.afw.image.Image`).
    ``overscanFit``
        Value or fit subtracted from the serial overscan image
        data (scalar or `lsst.afw.image.Image`).
    ``overscanImage``
        Image of the serial overscan region with the serial
        overscan correction applied
        (`lsst.afw.image.Image`). This quantity is used to
        estimate the amplifier read noise empirically.
    ``parallelOverscanFit``
        Value or fit subtracted from the parallel overscan
        image data (scalar, `lsst.afw.image.Image`, or None).
    ``parallelOverscanImage``
        Image of the parallel overscan region with the
        parallel overscan correction applied
        (`lsst.afw.image.Image` or None).
    ``overscanMean``
        Mean of the fit serial overscan region.
        This and the following values will be tuples of
        (serial, parallel) if doParallelOverscan=True.
    ``overscanMedian``
        Median of the fit serial overscan region.
    ``overscanSigma``
        Sigma of the fit serial overscan region.
    ``residualMean``
        Mean of the residual of the serial overscan region after
        correction.
    ``residualMedian``
        Median of the residual of the serial overscan region after
        correction.
    ``residualSigma``
        Mean of the residual of the serial overscan region after
        correction.


Raises
------
RuntimeError
    Raised if an invalid overscan type is set.

Reimplemented from lsst.ip.isr.overscan.OverscanCorrectionTaskBase.

Definition at line 895 of file overscan.py.

895 def run(self, exposure, amp, isTransposed=False):
896 """Measure and remove serial/parallel overscan from an amplifier image.
897
898 This will be deprecated.
899
900 Parameters
901 ----------
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.
909
910 Returns
911 -------
912 overscanResults : `lsst.pipe.base.Struct`
913 Result struct with components:
914
915 ``imageFit``
916 Value or fit subtracted from the amplifier image data
917 (scalar or `lsst.afw.image.Image`).
918 ``overscanFit``
919 Value or fit subtracted from the serial overscan image
920 data (scalar or `lsst.afw.image.Image`).
921 ``overscanImage``
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).
933 ``overscanMean``
934 Mean of the fit serial overscan region.
935 This and the following values will be tuples of
936 (serial, parallel) if doParallelOverscan=True.
937 ``overscanMedian``
938 Median of the fit serial overscan region.
939 ``overscanSigma``
940 Sigma of the fit serial overscan region.
941 ``residualMean``
942 Mean of the residual of the serial overscan region after
943 correction.
944 ``residualMedian``
945 Median of the residual of the serial overscan region after
946 correction.
947 ``residualSigma``
948 Mean of the residual of the serial overscan region after
949 correction.
950
951
952 Raises
953 ------
954 RuntimeError
955 Raised if an invalid overscan type is set.
956 """
957 # Do Serial overscan first.
958 serialOverscanBBox = amp.getRawSerialOverscanBBox()
959 imageBBox = amp.getRawDataBBox()
960
961 if self.config.doParallelOverscan:
962 # We need to extend the serial overscan BBox to the full
963 # size of the detector.
964 parallelOverscanBBox = amp.getRawParallelOverscanBBox()
965 imageBBox = imageBBox.expandedTo(parallelOverscanBBox)
966
967 if isTransposed:
968 serialOverscanBBox = geom.Box2I(
969 geom.Point2I(serialOverscanBBox.getMinX(), imageBBox.getEndY()),
970 geom.Extent2I(imageBBox.getWidth(), serialOverscanBBox.getHeight()),
971 )
972 else:
973 serialOverscanBBox = geom.Box2I(
974 geom.Point2I(serialOverscanBBox.getMinX(),
975 imageBBox.getMinY()),
976 geom.Extent2I(serialOverscanBBox.getWidth(),
977 imageBBox.getHeight()),
978 )
979
980 serialResults = self.correctOverscan(
981 exposure,
982 amp,
983 imageBBox,
984 serialOverscanBBox,
985 isTransposed=isTransposed,
986 leadingToSkip=self.config.leadingColumnsToSkip,
987 trailingToSkip=self.config.trailingColumnsToSkip,
988 )
989 overscanMean = serialResults.overscanMean
990 overscanMedian = serialResults.overscanMedian
991 overscanSigma = serialResults.overscanSigma
992 residualMean = serialResults.overscanMeanResidual
993 residualMedian = serialResults.overscanMedianResidual
994 residualSigma = serialResults.overscanSigmaResidual
995
996 # Do Parallel Overscan
997 parallelResults = None
998 if self.config.doParallelOverscan:
999 # This does not need any extensions, as we'll only
1000 # subtract it from the data region.
1001 parallelOverscanBBox = amp.getRawParallelOverscanBBox()
1002 imageBBox = amp.getRawDataBBox()
1003
1004 # The serial overscan correction has removed some signal
1005 # from the parallel overscan region, but that is largely a
1006 # constant offset. The collapseArray method now attempts
1007 # to fill fully masked columns with the median of
1008 # neighboring values, with a fallback to the median of the
1009 # correction in all other columns. Filling with neighbor
1010 # values ensures that large variations in the parallel
1011 # overscan do not create new outlier points. The
1012 # MEDIAN_PER_ROW method does this filling as a separate
1013 # operation, using the same method.
1014 parallelResults = self.correctOverscan(
1015 exposure,
1016 amp,
1017 imageBBox,
1018 parallelOverscanBBox,
1019 isTransposed=not isTransposed,
1020 leadingToSkip=self.config.leadingRowsToSkip,
1021 trailingToSkip=self.config.trailingRowsToSkip,
1022 )
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)
1029
1030 parallelOverscanFit = parallelResults.overscanOverscanModel if parallelResults else None
1031 parallelOverscanImage = parallelResults.overscanImage if parallelResults else None
1032
1033 return pipeBase.Struct(imageFit=serialResults.ampOverscanModel,
1034 overscanFit=serialResults.overscanOverscanModel,
1035 overscanImage=serialResults.overscanImage,
1036
1037 parallelOverscanFit=parallelOverscanFit,
1038 parallelOverscanImage=parallelOverscanImage,
1039 overscanMean=overscanMean,
1040 overscanMedian=overscanMedian,
1041 overscanSigma=overscanSigma,
1042 residualMean=residualMean,
1043 residualMedian=residualMedian,
1044 residualSigma=residualSigma)
1045
1046
An integer coordinate rectangle.
Definition Box.h:55

Member Data Documentation

◆ _DefaultName

str lsst.ip.isr.overscan.OverscanCorrectionTask._DefaultName = "overscan"
staticprotected

Definition at line 893 of file overscan.py.

◆ ConfigClass

lsst.ip.isr.overscan.OverscanCorrectionTask.ConfigClass = OverscanCorrectionTaskConfig
static

Definition at line 892 of file overscan.py.


The documentation for this class was generated from the following file: