lsst.ip.isr  16.0-20-g8d11721+1
Public Member Functions | Static Public Attributes | List of all members
lsst.ip.isr.linearize.LinearizeLookupTable Class Reference
Inheritance diagram for lsst.ip.isr.linearize.LinearizeLookupTable:
lsst.ip.isr.linearize.LinearizeBase

Public Member Functions

def __init__ (self, table, detector)
 
def __call__ (self, image, detector, log=None)
 
def checkDetector (self, detector)
 
def checkLinearityType (self, detector)
 

Static Public Attributes

string LinearityType = "LookupTable"
 

Detailed Description

Correct non-linearity with a persisted lookup table

for each i,j of image:
    rowInd = int(c0)
    colInd = int(c1 + uncorrImage[i,j])
    corrImage[i,j] = uncorrImage[i,j] + table[rowInd, colInd]

where c0, c1 are collimation coefficients from the AmpInfoTable of the detector:
- c0: row index; used to identify which row of the table to use (typically one per amplifier,
        though one can have multiple amplifiers use the same table)
- c1: column index offset; added to the uncorrected image value before truncation;
        this supports tables that can handle negative image values; also, if the c1 ends with .5
        then the nearest index is used instead of truncating to the next smaller index

In order to keep related data together, the coefficients are persisted along with the table.

Definition at line 92 of file linearize.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.ip.isr.linearize.LinearizeLookupTable.__init__ (   self,
  table,
  detector 
)
Construct a LinearizeLookupTable

@param[in] table  lookup table; a 2-dimensional array of floats:
    - one row for each row index (value of coef[0] in the amp info catalog)
    - one column for each image value
    To avoid copying the table the last index should vary fastest (numpy default "C" order)
@param[in] detector  detector information (an instance of lsst::afw::cameraGeom::Detector);
    the name, serial, and amplifier linearization type and coefficients are saved

@throw RuntimeError if table is not 2-dimensional,
table has fewer columns than rows (indicating that the indices are swapped),
or if any row index (linearity coefficient 0) is out of range

Definition at line 111 of file linearize.py.

Member Function Documentation

◆ __call__()

def lsst.ip.isr.linearize.LinearizeLookupTable.__call__ (   self,
  image,
  detector,
  log = None 
)
Correct for non-linearity

@param[in] image  image to be corrected (an lsst.afw.image.Image)
@param[in] detector  detector info about image (an lsst.afw.cameraGeom.Detector);
    the name, serial and number of amplifiers must match persisted data;
    the bbox from each amplifier is read;
    the linearization coefficients are ignored in favor of the persisted values
@param[in] log  logger (an lsst.log.Log), or None to disable logging;
    a warning is logged if any pixels are out of range of their lookup table

@return an lsst.pipe.base.Struct containing:
- numAmps number of amplifiers found
- numLinearized  number of amplifiers linearized (always equal to numAmps for this linearizer)
- numOutOfRange  number of pixels out of range of their lookup table (summed across all amps)

@throw RuntimeError if the linearity type is wrong or if the detector name, serial
    or number of amplifiers does not match the saved data

Definition at line 151 of file linearize.py.

◆ checkDetector()

def lsst.ip.isr.linearize.LinearizeLookupTable.checkDetector (   self,
  detector 
)
Check detector name and serial number, ampInfo table length and linearity type

@param[in] detector  detector info about image (an lsst.afw.cameraGeom.Detector);

@throw RuntimeError if anything doesn't match

Definition at line 189 of file linearize.py.

◆ checkLinearityType()

def lsst.ip.isr.linearize.LinearizeBase.checkLinearityType (   self,
  detector 
)
inherited
Verify that the linearity type is correct for this detector

@warning only checks the first record of the amp info catalog

@param[in] detector  detector information (an instance of lsst::afw::cameraGeom::Detector)

@throw RuntimeError if anything doesn't match

Definition at line 78 of file linearize.py.

Member Data Documentation

◆ LinearityType

string lsst.ip.isr.linearize.LinearizeLookupTable.LinearityType = "LookupTable"
static

Definition at line 109 of file linearize.py.


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