lsst.ip.isr g08227fae09+2789c9dd7a
|
Public Member Functions | |
__init__ (self, statControl=None, **kwargs) | |
run (self, exposure, amp, isTransposed=False) | |
correctOverscan (self, exposure, amp, imageBBox, overscanBBox, isTransposed=True) | |
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 = OverscanCorrectionTaskConfig | |
Static Protected Attributes | |
str | _DefaultName = "overscan" |
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 124 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTask.__init__ | ( | self, | |
statControl = None, | |||
** | kwargs ) |
Definition at line 139 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTask.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 368 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTask.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 679 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTask.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 702 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTask.correctOverscan | ( | self, | |
exposure, | |||
amp, | |||
imageBBox, | |||
overscanBBox, | |||
isTransposed = True ) |
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. 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 262 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTask.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 903 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTask.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 638 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTask.fitOverscan | ( | self, | |
overscanImage, | |||
isTransposed = False ) |
Definition at line 465 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTask.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 587 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 496 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 796 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTask.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 606 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTask.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.
Definition at line 529 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTask.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 565 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTask.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 824 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTask.run | ( | self, | |
exposure, | |||
amp, | |||
isTransposed = False ) |
Measure and remove an overscan from an amplifier image. 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). Raises ------ RuntimeError Raised if an invalid overscan type is set.
Definition at line 150 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 776 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTask.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 730 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTask.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 418 of file overscan.py.
|
staticprotected |
Definition at line 137 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTask.allowDebug |
Definition at line 141 of file overscan.py.
|
static |
Definition at line 136 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTask.splineEval |
Definition at line 880 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTask.splineFit |
Definition at line 880 of file overscan.py.
lsst.ip.isr.overscan.OverscanCorrectionTask.statControl |
Definition at line 144 of file overscan.py.