|
LSST Applications 29.0.1,g0fba68d861+132dd21e0a,g107a963962+1bb9f809a9,g1fd858c14a+005be21cae,g21d47ad084+8a07b29876,g325378336f+5d73323c8f,g330003fc43+40b4eaffc6,g35bb328faa+fcb1d3bbc8,g36ff55ed5b+9c28a42a87,g4e0f332c67+5fbd1e3e73,g53246c7159+fcb1d3bbc8,g60b5630c4e+9c28a42a87,g67b6fd64d1+a38b34ea13,g78460c75b0+2f9a1b4bcd,g786e29fd12+cf7ec2a62a,g7b71ed6315+fcb1d3bbc8,g86c591e316+6b2b2d0295,g8852436030+bf14db0e33,g89139ef638+a38b34ea13,g8b8da53e10+e3777245af,g9125e01d80+fcb1d3bbc8,g989de1cb63+a38b34ea13,g9f1445be69+9c28a42a87,g9f33ca652e+52c8f07962,ga9baa6287d+9c28a42a87,ga9e4eb89a6+9f84bd6575,gabe3b4be73+1e0a283bba,gb037a4e798+f3cbcd26c0,gb1101e3267+e7be8da0f8,gb58c049af0+f03b321e39,gb89ab40317+a38b34ea13,gcf25f946ba+bf14db0e33,gd6cbbdb0b4+bce7f7457e,gd9a9a58781+fcb1d3bbc8,gde0f65d7ad+53d424b1ae,ge278dab8ac+222406d50a,ge410e46f29+a38b34ea13,ge80e9994a3+664d6357dc,gf67bdafdda+a38b34ea13
LSST Data Management Base Package
|
Public Member Functions | |
| 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) | |
Static Public Member Functions | |
| splineEval (indices, interp) | |
| maskExtrapolated (collapsed) | |
Public Attributes | |
| bool | allowDebug = True |
| statControl = statControl | |
Static Public Attributes | |
| ConfigClass = OverscanCorrectionTaskConfigBase | |
Static Protected Member Functions | |
| _maskRowsOrColumns (exposure, overscanBBox, overscanMaskedImage, overscanMask, maxDeviation, maskedRowColumnGrowSize, medianSmoothingKernel, medianSmoothingOutlierThreshold, doAbsoluteMaxDeviation, isTransposed) | |
Static Protected Attributes | |
| str | _DefaultName = "overscanBase" |
Correction task for serial overscan.
Parameters
----------
statControl : `lsst.afw.math.StatisticsControl`, optional
Statistics control object.
Definition at line 1225 of file overscan.py.
|
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.
|
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.
|
inherited |
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 763 of file overscan.py.
|
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.
|
inherited |
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 967 of file overscan.py.
|
inherited |
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 722 of file overscan.py.
|
inherited |
Definition at line 582 of file overscan.py.
|
inherited |
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 671 of file overscan.py.
|
staticinherited |
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 852 of file overscan.py.
|
inherited |
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 690 of file overscan.py.
|
inherited |
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 612 of file overscan.py.
|
inherited |
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 649 of file overscan.py.
|
inherited |
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 880 of file overscan.py.
| lsst.ip.isr.overscan.SerialOverscanCorrectionTask.run | ( | self, | |
| exposure, | |||
| amp, | |||
| isTransposed = False ) |
Measure and remove serial 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.
``overscanMean``
Mean of the fit serial overscan region.
``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 1236 of file overscan.py.
|
staticinherited |
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 832 of file overscan.py.
|
inherited |
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 786 of file overscan.py.
|
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.
|
staticprotectedinherited |
Definition at line 150 of file overscan.py.
|
inherited |
Definition at line 154 of file overscan.py.
|
staticinherited |
Definition at line 149 of file overscan.py.
|
inherited |
Definition at line 157 of file overscan.py.