LSST Applications 27.0.0,g0265f82a02+469cd937ee,g02d81e74bb+21ad69e7e1,g1470d8bcf6+cbe83ee85a,g2079a07aa2+e67c6346a6,g212a7c68fe+04a9158687,g2305ad1205+94392ce272,g295015adf3+81dd352a9d,g2bbee38e9b+469cd937ee,g337abbeb29+469cd937ee,g3939d97d7f+72a9f7b576,g487adcacf7+71499e7cba,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+df404f777f,g5a732f18d5+be83d3ecdb,g64a986408d+21ad69e7e1,g858d7b2824+21ad69e7e1,g8a8a8dda67+a6fc98d2e7,g99cad8db69+f62e5b0af5,g9ddcbc5298+d4bad12328,ga1e77700b3+9c366c4306,ga8c6da7877+71e4819109,gb0e22166c9+25ba2f69a1,gb6a65358fc+469cd937ee,gbb8dafda3b+69d3c0e320,gc07e1c2157+a98bf949bb,gc120e1dc64+615ec43309,gc28159a63d+469cd937ee,gcf0d15dbbd+72a9f7b576,gdaeeff99f8+a38ce5ea23,ge6526c86ff+3a7c1ac5f1,ge79ae78c31+469cd937ee,gee10cc3b42+a6fc98d2e7,gf1cff7945b+21ad69e7e1,gfbcc870c63+9a11dc8c8f
LSST Data Management Base Package
|
Public Member Functions | |
__init__ (self, statControl=None, **kwargs) | |
run (self, exposure, amp, isTransposed=False) | |
correctOverscan (self, exposure, amp, imageBBox, overscanBBox, isTransposed=True, leadingToSkip=0, trailingToSkip=0) | |
broadcastFitToImage (self, overscanValue, imageArray, transpose=False) | |
trimOverscan (self, exposure, amp, bbox, skipLeading, skipTrailing, transpose=False) | |
fitOverscan (self, overscanImage, isTransposed=False) | |
maskParallelOverscan (self, exposure, detector) | |
measureConstantOverscan (self, image) | |
getImageArray (self, image) | |
maskOutliers (self, imageArray) | |
fillMaskedPixels (self, overscanVector) | |
collapseArray (self, maskedArray, fillMasked=True) | |
collapseArrayMedian (self, maskedArray) | |
splineFit (self, indices, collapsed, numBins) | |
measureVectorOverscan (self, image, isTransposed=False) | |
debugView (self, image, model, amp=None, isTransposed=True) | |
Static Public Member Functions | |
integerConvert (image) | |
splineEval (indices, interp) | |
maskExtrapolated (collapsed) | |
Public Attributes | |
allowDebug | |
statControl | |
splineFit | |
splineEval | |
Static Public Attributes | |
ConfigClass = OverscanCorrectionTaskConfigBase | |
Static Protected Attributes | |
str | _DefaultName = "overscanBase" |
Base Correction task for overscan. 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 127 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTaskBase.__init__ | ( | self, | |
statControl = None, | |||
** | kwargs ) |
Definition at line 142 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTaskBase.broadcastFitToImage | ( | self, | |
overscanValue, | |||
imageArray, | |||
transpose = False ) |
Broadcast 0 or 1 dimension fit to appropriate shape. Parameters ---------- overscanValue : `numpy.ndarray`, (Nrows, ) or scalar Overscan fit to broadcast. imageArray : `numpy.ndarray`, (Nrows, Ncols) Image array that we want to match. transpose : `bool`, optional Switch order to broadcast along the other axis. Returns ------- overscanModel : `numpy.ndarray`, (Nrows, Ncols) or scalar Expanded overscan fit. Raises ------ RuntimeError Raised if no axis has the appropriate dimension.
Definition at line 267 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTaskBase.collapseArray | ( | self, | |
maskedArray, | |||
fillMasked = True ) |
Collapse overscan array (and mask) to a 1-D vector of values. Parameters ---------- maskedArray : `numpy.ma.masked_array` Masked array of input overscan data. fillMasked : `bool`, optional If true, fill any pixels that are masked with a median of neighbors. Returns ------- collapsed : `numpy.ma.masked_array` Single dimensional overscan data, combined with the mean.
Definition at line 578 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTaskBase.collapseArrayMedian | ( | self, | |
maskedArray ) |
Collapse overscan array (and mask) to a 1-D vector of using the correct integer median of row-values. Parameters ---------- maskedArray : `numpy.ma.masked_array` Masked array of input overscan data. Returns ------- collapsed : `numpy.ma.masked_array` Single dimensional overscan data, combined with the afwMath median.
Definition at line 601 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTaskBase.correctOverscan | ( | self, | |
exposure, | |||
amp, | |||
imageBBox, | |||
overscanBBox, | |||
isTransposed = True, | |||
leadingToSkip = 0, | |||
trailingToSkip = 0 ) |
Trim the exposure, fit the overscan, subtract the fit, and calculate statistics. Parameters ---------- exposure : `lsst.afw.image.Exposure` Exposure containing the data. amp : `lsst.afw.cameraGeom.Amplifier` The amplifier that is to be corrected. imageBBox: `lsst.geom.Box2I` Bounding box of the image data that will have the overscan subtracted. If parallel overscan will be performed, that area is added to the image bounding box during serial overscan correction. overscanBBox: `lsst.geom.Box2I` Bounding box for the overscan data. isTransposed: `bool` If true, then the data will be transposed before fitting the overscan. leadingToSkip : `int`, optional Leading rows/columns to skip. trailingToSkip : `int`, optional Leading rows/columns to skip. Returns ------- results : `lsst.pipe.base.Struct` ``ampOverscanModel`` Overscan model broadcast to the full image size. (`lsst.afw.image.Exposure`) ``overscanOverscanModel`` Overscan model broadcast to the full overscan image size. (`lsst.afw.image.Exposure`) ``overscanImage`` Overscan image with the overscan fit subtracted. (`lsst.afw.image.Exposure`) ``overscanValue`` Overscan model. (`float` or `np.array`) ``overscanMean`` Mean value of the overscan fit. (`float`) ``overscanMedian`` Median value of the overscan fit. (`float`) ``overscanSigma`` Standard deviation of the overscan fit. (`float`) ``overscanMeanResidual`` Mean value of the overscan region after overscan subtraction. (`float`) ``overscanMedianResidual`` Median value of the overscan region after overscan subtraction. (`float`) ``overscanSigmaResidual`` Standard deviation of the overscan region after overscan subtraction. (`float`)
Definition at line 156 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTaskBase.debugView | ( | self, | |
image, | |||
model, | |||
amp = None, | |||
isTransposed = True ) |
Debug display for the final overscan solution. Parameters ---------- image : `lsst.afw.image.Image` Input image the overscan solution was determined from. model : `numpy.ndarray` or `float` Overscan model determined for the image. amp : `lsst.afw.cameraGeom.Amplifier`, optional Amplifier to extract diagnostic information. isTransposed : `bool`, optional Does the data need to be transposed before display?
Definition at line 802 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTaskBase.fillMaskedPixels | ( | self, | |
overscanVector ) |
Fill masked/NaN pixels in the overscan. Parameters ---------- overscanVector : `np.array` or `np.ma.masked_array` Overscan vector to fill. Returns ------- overscanVector : `np.ma.masked_array` Filled vector. Notes ----- Each maskSlice is a section of overscan with contiguous masks. Ideally this adds 5 pixels from the left and right of that mask slice, and takes the median of those values to fill the slice. If this isn't possible, the median of all non-masked values is used. The mask is removed for the pixels filled.
Definition at line 537 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTaskBase.fitOverscan | ( | self, | |
overscanImage, | |||
isTransposed = False ) |
Definition at line 364 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTaskBase.getImageArray | ( | self, | |
image ) |
Extract the numpy array from the input image. Parameters ---------- image : `lsst.afw.image.Image` or `lsst.afw.image.MaskedImage` Image data to pull array from. calcImage : `numpy.ndarray` Image data array for numpy operating.
Definition at line 486 of file overscan.py.
|
static |
Return an integer version of the input image. Parameters ---------- image : `numpy.ndarray`, `lsst.afw.image.Image` or `MaskedImage` Image to convert to integers. Returns ------- outI : `numpy.ndarray`, `lsst.afw.image.Image` or `MaskedImage` The integer converted image. Raises ------ RuntimeError Raised if the input image could not be converted.
Definition at line 395 of file overscan.py.
|
static |
Create mask if edges are extrapolated. Parameters ---------- collapsed : `numpy.ma.masked_array` Masked array to check the edges of. Returns ------- maskArray : `numpy.ndarray` Boolean numpy array of pixels to mask.
Definition at line 695 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTaskBase.maskOutliers | ( | self, | |
imageArray ) |
Mask outliers in a row of overscan data from a robust sigma clipping procedure. Parameters ---------- imageArray : `numpy.ndarray` Image to filter along numpy axis=1. Returns ------- maskedArray : `numpy.ma.masked_array` Masked image marking outliers.
Definition at line 505 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTaskBase.maskParallelOverscan | ( | self, | |
exposure, | |||
detector ) |
Mask the union of high values on all amplifiers in the parallel overscan. This operates on the image in-place. Parameters ---------- exposure : `lsst.afw.image.Exposure` An untrimmed raw exposure. detector : `lsst.afw.cameraGeom.Detector` The detetor to use for amplifier geometry.
Reimplemented in lsst.ip.isr.overscan.ParallelOverscanCorrectionTask.
Definition at line 428 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTaskBase.measureConstantOverscan | ( | self, | |
image ) |
Measure a constant overscan value. Parameters ---------- image : `lsst.afw.image.Image` or `lsst.afw.image.MaskedImage` Image data to measure the overscan from. Returns ------- results : `lsst.pipe.base.Struct` Overscan result with entries: - ``overscanValue``: Overscan value to subtract (`float`) - ``isTransposed``: Orientation of the overscan (`bool`)
Definition at line 464 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTaskBase.measureVectorOverscan | ( | self, | |
image, | |||
isTransposed = False ) |
Calculate the 1-d vector overscan from the input overscan image. Parameters ---------- image : `lsst.afw.image.MaskedImage` Image containing the overscan data. isTransposed : `bool` If true, the image has been transposed. Returns ------- results : `lsst.pipe.base.Struct` Overscan result with entries: ``overscanValue`` Overscan value to subtract (`float`) ``maskArray`` List of rows that should be masked as ``SUSPECT`` when the overscan solution is applied. (`list` [ `bool` ]) ``isTransposed`` Indicates if the overscan data was transposed during calcuation, noting along which axis the overscan should be subtracted. (`bool`)
Definition at line 723 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTaskBase.run | ( | self, | |
exposure, | |||
amp, | |||
isTransposed = False ) |
Reimplemented in lsst.ip.isr.overscan.OverscanCorrectionTask, lsst.ip.isr.overscan.SerialOverscanCorrectionTask, and lsst.ip.isr.overscan.ParallelOverscanCorrectionTask.
Definition at line 153 of file overscan.py.
|
static |
Wrapper function to match spline evaluation API to polynomial fit API. Parameters ---------- indices : `numpy.ndarray` Locations to evaluate the spline. interp : `lsst.afw.math.interpolate` Interpolation object to use. Returns ------- values : `numpy.ndarray` Evaluated spline values at each index.
Definition at line 675 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTaskBase.splineFit | ( | self, | |
indices, | |||
collapsed, | |||
numBins ) |
Wrapper function to match spline fit API to polynomial fit API. Parameters ---------- indices : `numpy.ndarray` Locations to evaluate the spline. collapsed : `numpy.ndarray` Collapsed overscan values corresponding to the spline evaluation points. numBins : `int` Number of bins to use in constructing the spline. Returns ------- interp : `lsst.afw.math.Interpolate` Interpolation object for later evaluation.
Definition at line 629 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTaskBase.trimOverscan | ( | self, | |
exposure, | |||
amp, | |||
bbox, | |||
skipLeading, | |||
skipTrailing, | |||
transpose = False ) |
Trim overscan region to remove edges. Parameters ---------- exposure : `lsst.afw.image.Exposure` Exposure containing data. amp : `lsst.afw.cameraGeom.Amplifier` Amplifier containing geometry information. bbox : `lsst.geom.Box2I` Bounding box of the overscan region. skipLeading : `int` Number of leading (towards data region) rows/columns to skip. skipTrailing : `int` Number of trailing (away from data region) rows/columns to skip. transpose : `bool`, optional Operate on the transposed array. Returns ------- overscanArray : `numpy.array`, (N, M) Data array to fit. overscanMask : `numpy.array`, (N, M) Data mask.
Definition at line 317 of file overscan.py.
|
staticprotected |
Definition at line 140 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTaskBase.allowDebug |
Definition at line 144 of file overscan.py.
|
static |
Definition at line 139 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTaskBase.splineEval |
Definition at line 779 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTaskBase.splineFit |
Definition at line 779 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTaskBase.statControl |
Definition at line 147 of file overscan.py.