LSST Applications 27.0.0,g0265f82a02+469cd937ee,g02d81e74bb+21ad69e7e1,g1470d8bcf6+cbe83ee85a,g2079a07aa2+e67c6346a6,g212a7c68fe+04a9158687,g2305ad1205+94392ce272,g295015adf3+81dd352a9d,g2bbee38e9b+469cd937ee,g337abbeb29+469cd937ee,g3939d97d7f+72a9f7b576,g487adcacf7+71499e7cba,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+df404f777f,g5a732f18d5+be83d3ecdb,g64a986408d+21ad69e7e1,g858d7b2824+21ad69e7e1,g8a8a8dda67+a6fc98d2e7,g99cad8db69+f62e5b0af5,g9ddcbc5298+d4bad12328,ga1e77700b3+9c366c4306,ga8c6da7877+71e4819109,gb0e22166c9+25ba2f69a1,gb6a65358fc+469cd937ee,gbb8dafda3b+69d3c0e320,gc07e1c2157+a98bf949bb,gc120e1dc64+615ec43309,gc28159a63d+469cd937ee,gcf0d15dbbd+72a9f7b576,gdaeeff99f8+a38ce5ea23,ge6526c86ff+3a7c1ac5f1,ge79ae78c31+469cd937ee,gee10cc3b42+a6fc98d2e7,gf1cff7945b+21ad69e7e1,gfbcc870c63+9a11dc8c8f
LSST Data Management Base Package
Loading...
Searching...
No Matches
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

 __call__ (self, image, **kwargs)
 

Static Public Attributes

str LinearityType = "LookupTable"
 

Detailed Description

Correct non-linearity with a persisted lookup table.

The lookup table consists of entries such that given
"coefficients" c0, c1:

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

- 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

Definition at line 544 of file linearize.py.

Member Function Documentation

◆ __call__()

lsst.ip.isr.linearize.LinearizeLookupTable.__call__ ( self,
image,
** kwargs )
Correct for non-linearity.

Parameters
----------
image : `lsst.afw.image.Image`
    Image to be corrected
kwargs : `dict`
    Dictionary of parameter keywords:

    ``coeffs``
        Columnation vector (`list` or `numpy.array`).
    ``table``
        Lookup table data (`numpy.array`).
    ``log``
        Logger to handle messages (`logging.Logger`).

Returns
-------
output : `tuple` [`bool`, `int`]
    If true, a correction was applied successfully.  The
    integer indicates the number of pixels that were
    uncorrectable by being out of range.

Raises
------
RuntimeError:
    Raised if the requested row index is out of the table
    bounds.

Reimplemented from lsst.ip.isr.linearize.LinearizeBase.

Definition at line 566 of file linearize.py.

566 def __call__(self, image, **kwargs):
567 """Correct for non-linearity.
568
569 Parameters
570 ----------
571 image : `lsst.afw.image.Image`
572 Image to be corrected
573 kwargs : `dict`
574 Dictionary of parameter keywords:
575
576 ``coeffs``
577 Columnation vector (`list` or `numpy.array`).
578 ``table``
579 Lookup table data (`numpy.array`).
580 ``log``
581 Logger to handle messages (`logging.Logger`).
582
583 Returns
584 -------
585 output : `tuple` [`bool`, `int`]
586 If true, a correction was applied successfully. The
587 integer indicates the number of pixels that were
588 uncorrectable by being out of range.
589
590 Raises
591 ------
592 RuntimeError:
593 Raised if the requested row index is out of the table
594 bounds.
595 """
596 numOutOfRange = 0
597
598 rowInd, colIndOffset = kwargs['coeffs'][0:2]
599 table = kwargs['table']
600 log = kwargs['log']
601
602 numTableRows = table.shape[0]
603 rowInd = int(rowInd)
604 if rowInd < 0 or rowInd > numTableRows:
605 raise RuntimeError("LinearizeLookupTable rowInd=%s not in range[0, %s)" %
606 (rowInd, numTableRows))
607 tableRow = np.array(table[rowInd, :], dtype=image.getArray().dtype)
608
609 numOutOfRange += applyLookupTable(image, tableRow, colIndOffset)
610
611 if numOutOfRange > 0 and log is not None:
612 log.warning("%s pixels were out of range of the linearization table",
613 numOutOfRange)
614 if numOutOfRange < image.getArray().size:
615 return True, numOutOfRange
616 else:
617 return False, numOutOfRange
618
619

Member Data Documentation

◆ LinearityType

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

Definition at line 564 of file linearize.py.


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