|
| | __init__ (self, statControl=None, **kwargs) |
| |
| | 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) |
| |
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 137 of file overscan.py.
| lsst.ip.isr.overscan.OverscanCorrectionTaskBase._maskRowsOrColumns |
( |
| exposure, |
|
|
| overscanBBox, |
|
|
| overscanMaskedImage, |
|
|
| overscanMask, |
|
|
| maxDeviation, |
|
|
| maskedRowColumnGrowSize, |
|
|
| medianSmoothingKernel, |
|
|
| medianSmoothingOutlierThreshold, |
|
|
| doAbsoluteMaxDeviation, |
|
|
| isTransposed ) |
|
staticprotected |
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 ) |
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 ) |
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.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 535 of file overscan.py.