lsst.ip.isr g9ca82378b8+3880520dd2
Loading...
Searching...
No Matches
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, exposure, amp, isTransposed=False)
 
def correctOverscan (self, exposure, amp, imageBBox, overscanBBox, isTransposed=True)
 
def broadcastFitToImage (self, overscanValue, imageArray, transpose=False)
 
def trimOverscan (self, exposure, amp, bbox, skipLeading, skipTrailing, transpose=False)
 
def fitOverscan (self, overscanImage, isTransposed=False)
 
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, isTransposed=False)
 
def debugView (self, image, model, amp=None)
 

Static Public Member Functions

def integerConvert (image)
 
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 122 of file overscan.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 137 of file overscan.py.

Member Function Documentation

◆ broadcastFitToImage()

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

◆ 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 542 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 560 of file overscan.py.

◆ correctOverscan()

def lsst.ip.isr.overscan.OverscanCorrectionTask.correctOverscan (   self,
  exposure,
  amp,
  imageBBox,
  overscanBBox,
  isTransposed = True 
)
 

Definition at line 260 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 760 of file overscan.py.

◆ fitOverscan()

def lsst.ip.isr.overscan.OverscanCorrectionTask.fitOverscan (   self,
  overscanImage,
  isTransposed = False 
)

Definition at line 413 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 500 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 440 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 654 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 519 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`)
    - ``isTransposed``: Orientation of the overscan (`bool`)

Definition at line 474 of file overscan.py.

◆ measureVectorOverscan()

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

◆ run()

def 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 148 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 634 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 588 of file overscan.py.

◆ trimOverscan()

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

Member Data Documentation

◆ allowDebug

lsst.ip.isr.overscan.OverscanCorrectionTask.allowDebug

Definition at line 139 of file overscan.py.

◆ ConfigClass

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

Definition at line 134 of file overscan.py.

◆ statControl

lsst.ip.isr.overscan.OverscanCorrectionTask.statControl

Definition at line 142 of file overscan.py.


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