|
| | run (self, exposure, amp, isTransposed=False) |
| |
| | correctOverscan (self, exposure, amp, imageBBox, overscanBBox, isTransposed=True, leadingToSkip=0, trailingToSkip=0, overscanFraction=1.0, imageThreshold=np.inf, maskedRowColumnGrowSize=0, medianSmoothingKernel=0, medianSmoothingOutlierThreshold=np.inf) |
| |
| | 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) |
| |
| | splineFit (self, indices, collapsed, numBins) |
| |
| | measureVectorOverscan (self, image, isTransposed=False) |
| |
| | debugView (self, image, model, amp=None, isTransposed=True) |
| |
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 1043 of file overscan.py.
| lsst.ip.isr.overscan.OverscanCorrectionTaskBase._maskRowsOrColumns |
( |
| exposure, |
|
|
| overscanBBox, |
|
|
| overscanMaskedImage, |
|
|
| overscanMask, |
|
|
| maxDeviation, |
|
|
| maskedRowColumnGrowSize, |
|
|
| medianSmoothingKernel, |
|
|
| medianSmoothingOutlierThreshold, |
|
|
| doAbsoluteMaxDeviation, |
|
|
| isTransposed ) |
|
staticprotectedinherited |
Mask overscan rows (~serial) or columns (~parallel).
Parameters
----------
exposure : `lsst.afw.image.Exposure`
Exposure containing the data.
overscanBBox: `lsst.geom.Box2I`
Bounding box for the overscan data.
overscanMaskedImage : `lsst.afw.image.MaskedImage`
Masked image containing the overscan data.
overscanMask : `np.ndarray`
Numpy array of the mask bits, anded with appropriate
mask planes.
maxDeviation : `float`
Maximum deviation from median (overscan units) to mask in overscan
correction. For parallel overscan this is a one-sided (positive
only) cut.
maskedRowColumnGrowSize : `int`
If a column (parallel overscan) or row (serial overscan) is
completely masked, then grow the mask by this radius. If the
value is <=0 then this will not be checked.
medianSmoothingKernel : `int`
Kernel (pixels) to smooth rows/columns. If <=0, median smoothing
is skipped. Otherwise must be odd.
medianSmoothingOutlierThreshold : `float`
Outlier threshold after median smoothing (overscan units). This
is applied only to positive outliers.
doAbsoluteMaxDeviation : `bool`
If true, deviation comparisons will use the absolute value;
otherwise it will cut positive outliers only.
isTransposed : `bool`
If true, then the data will be transposed before fitting
the overscan.
Returns
-------
badRowsOrColumns : `np.ndarray`
Array of bad rows (serial) or columns (parallel) that were
found, prior to dilation by maskedRowColumnGrowSize.
Definition at line 167 of file overscan.py.
| lsst.ip.isr.overscan.OverscanCorrectionTaskBase.broadcastFitToImage |
( |
| self, |
|
|
| overscanValue, |
|
|
| imageArray, |
|
|
| transpose = False ) |
|
inherited |
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 485 of file overscan.py.
| lsst.ip.isr.overscan.OverscanCorrectionTaskBase.correctOverscan |
( |
| self, |
|
|
| exposure, |
|
|
| amp, |
|
|
| imageBBox, |
|
|
| overscanBBox, |
|
|
| isTransposed = True, |
|
|
| leadingToSkip = 0, |
|
|
| trailingToSkip = 0, |
|
|
| overscanFraction = 1.0, |
|
|
| imageThreshold = np.inf, |
|
|
| maskedRowColumnGrowSize = 0, |
|
|
| medianSmoothingKernel = 0, |
|
|
| medianSmoothingOutlierThreshold = np.inf ) |
|
inherited |
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.
overscanFraction : `float`, optional
If the overscan region median is greater than overscanFraction
and the imaging region median is greater than imageThreshold
then overscan correction will be skipped.
maxLevel : `float`, optional
If the overscan region median is greater than overscanFraction
and the imaging region median is greater than imageThreshold
then overscan correction will be skipped.
maskedRowColumnGrowSize : `int`, optional
If a column (parallel overscan) or row (serial overscan) is
completely masked, then grow the mask by this radius. If the
value is <=0 then this will not be checked.
medianSmoothingKernel : `int`, optional
Kernel (pixels) to use to smooth rows/columns for row/column
outlier rejection. Must be odd if positive; if <=0 median
smoothing will not be used to find outliers.
medianSmoothingOutlierThreshold : `float`, optional
Threshold to look for outliers after median smoothing (adu).
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 297 of file overscan.py.
| 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 1060 of file overscan.py.
| lsst.ip.isr.overscan.OverscanCorrectionTaskBase.trimOverscan |
( |
| self, |
|
|
| exposure, |
|
|
| amp, |
|
|
| bbox, |
|
|
| skipLeading, |
|
|
| skipTrailing, |
|
|
| transpose = False ) |
|
inherited |
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 535 of file overscan.py.