lsst.ip.isr 22.0.1-31-g9cb7513+173247a6f9
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.ip.isr.overscan.OverscanCorrectionTask Class Reference
Inheritance diagram for lsst.ip.isr.overscan.OverscanCorrectionTask:

Public Member Functions

def __init__ (self, statControl=None, **kwargs)
 
def run (self, ampImage, overscanImage, amp=None)
 
def measureConstantOverscan (self, image)
 
def getImageArray (self, image)
 
def maskOutliers (self, imageArray)
 
def collapseArrayMedian (self, maskedArray)
 
def splineFit (self, indices, collapsed, numBins)
 
def measureVectorOverscan (self, image)
 
def debugView (self, image, model, amp=None)
 

Static Public Member Functions

def integerConvert (image)
 
def transpose (imageArray)
 
def collapseArray (maskedArray)
 
def splineEval (indices, interp)
 
def maskExtrapolated (collapsed)
 

Public Attributes

 allowDebug
 
 statControl
 

Static Public Attributes

 ConfigClass = OverscanCorrectionTaskConfig
 

Detailed Description

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 75 of file overscan.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.ip.isr.overscan.OverscanCorrectionTask.__init__ (   self,
  statControl = None,
**  kwargs 
)

Definition at line 90 of file overscan.py.

Member Function Documentation

◆ collapseArray()

def lsst.ip.isr.overscan.OverscanCorrectionTask.collapseArray (   maskedArray)
static
Collapse overscan array (and mask) to a 1-D vector of 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 mean.

Definition at line 311 of file overscan.py.

◆ collapseArrayMedian()

def 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 329 of file overscan.py.

◆ debugView()

def lsst.ip.isr.overscan.OverscanCorrectionTask.debugView (   self,
  image,
  model,
  amp = None 
)
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.

Definition at line 492 of file overscan.py.

◆ getImageArray()

def 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 248 of file overscan.py.

◆ integerConvert()

def lsst.ip.isr.overscan.OverscanCorrectionTask.integerConvert (   image)
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 185 of file overscan.py.

◆ maskExtrapolated()

def lsst.ip.isr.overscan.OverscanCorrectionTask.maskExtrapolated (   collapsed)
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 411 of file overscan.py.

◆ maskOutliers()

def 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 288 of file overscan.py.

◆ measureConstantOverscan()

def 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`)
    - ``maskArray``: Placeholder for a mask array (`list`)
    - ``isTransposed``: Orientation of the overscan (`bool`)

Definition at line 219 of file overscan.py.

◆ measureVectorOverscan()

def lsst.ip.isr.overscan.OverscanCorrectionTask.measureVectorOverscan (   self,
  image 
)
Calculate the 1-d vector overscan from the input overscan image.

Parameters
----------
image : `lsst.afw.image.MaskedImage`
    Image containing the overscan data.

Returns
-------
results : `lsst.pipe.base.Struct`
    Overscan result with entries:
    - ``overscanValue``: Overscan value to subtract (`float`)
    - ``maskArray`` : `list` [ `bool` ]
        List of rows that should be masked as ``SUSPECT`` when the
        overscan solution is applied.
    - ``isTransposed`` : `bool`
       Indicates if the overscan data was transposed during
       calcuation, noting along which axis the overscan should be
       subtracted.

Definition at line 439 of file overscan.py.

◆ run()

def lsst.ip.isr.overscan.OverscanCorrectionTask.run (   self,
  ampImage,
  overscanImage,
  amp = None 
)
Measure and remove an overscan from an amplifier image.

Parameters
----------
ampImage : `lsst.afw.image.Image`
    Image data that will have the overscan removed.
overscanImage : `lsst.afw.image.Image`
    Overscan data that the overscan is measured from.
amp : `lsst.afw.cameraGeom.Amplifier`, optional
    Amplifier to use for debugging purposes.

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 overscan image data
        (scalar or `lsst.afw.image.Image`).
    ``overscanImage``
        Image of the overscan region with the overscan
        correction applied (`lsst.afw.image.Image`). This
        quantity is used to estimate the amplifier read noise
        empirically.

Raises
------
RuntimeError
    Raised if an invalid overscan type is set.

Definition at line 101 of file overscan.py.

◆ splineEval()

def lsst.ip.isr.overscan.OverscanCorrectionTask.splineEval (   indices,
  interp 
)
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 391 of file overscan.py.

◆ splineFit()

def 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 357 of file overscan.py.

◆ transpose()

def lsst.ip.isr.overscan.OverscanCorrectionTask.transpose (   imageArray)
static
Transpose input numpy array if necessary.

Parameters
----------
imageArray : `numpy.ndarray`
    Image data to transpose.

Returns
-------
imageArray : `numpy.ndarray`
    Transposed image data.
isTransposed : `bool`
    Indicates whether the input data was transposed.

Definition at line 268 of file overscan.py.

Member Data Documentation

◆ allowDebug

lsst.ip.isr.overscan.OverscanCorrectionTask.allowDebug

Definition at line 92 of file overscan.py.

◆ ConfigClass

lsst.ip.isr.overscan.OverscanCorrectionTask.ConfigClass = OverscanCorrectionTaskConfig
static

Definition at line 87 of file overscan.py.

◆ statControl

lsst.ip.isr.overscan.OverscanCorrectionTask.statControl

Definition at line 95 of file overscan.py.


The documentation for this class was generated from the following file: