lsst.ip.isr gc1a459825e+232ccdafb1
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
lsst.ip.isr.crosstalk.CrosstalkCalib Class Reference
Inheritance diagram for lsst.ip.isr.crosstalk.CrosstalkCalib:
lsst.ip.isr.calibType.IsrCalib

Public Member Functions

def __init__ (self, detector=None, nAmp=0, **kwargs)
 
def updateMetadata (self, setDate=False, **kwargs)
 
def fromDetector (self, detector, coeffVector=None)
 
def fromDict (cls, dictionary)
 
def toDict (self)
 
def fromTable (cls, tableList)
 
def toTable (self)
 
def subtractCrosstalk (self, thisExposure, sourceExposure=None, crosstalkCoeffs=None, badPixels=["BAD"], minPixelToMask=45000, crosstalkStr="CROSSTALK", isTrimmed=False, backgroundMethod="None")
 

Static Public Member Functions

def extractAmp (image, amp, ampTarget, isTrimmed=False)
 
def calculateBackground (mi, badPixels=["BAD"])
 

Public Attributes

 hasCrosstalk
 
 nAmp
 
 crosstalkShape
 
 coeffs
 
 coeffErr
 
 coeffNum
 
 coeffValid
 
 interChip
 

Detailed Description

Calibration of amp-to-amp crosstalk coefficients.

Parameters
----------
detector : `lsst.afw.cameraGeom.Detector`, optional
    Detector to use to pull coefficients from.
nAmp : `int`, optional
    Number of amplifiers to initialize.
log : `logging.Logger`, optional
    Log to write messages to.
**kwargs :
    Parameters to pass to parent constructor.

Notes
-----
The crosstalk attributes stored are:

hasCrosstalk : `bool`
    Whether there is crosstalk defined for this detector.
nAmp : `int`
    Number of amplifiers in this detector.
crosstalkShape : `tuple` [`int`, `int`]
    A tuple containing the shape of the ``coeffs`` matrix.  This
    should be equivalent to (``nAmp``, ``nAmp``).
coeffs : `numpy.ndarray`
    A matrix containing the crosstalk coefficients.  coeff[i][j]
    contains the coefficients to calculate the contribution
    amplifier_j has on amplifier_i (each row[i] contains the
    corrections for detector_i).
coeffErr : `numpy.ndarray`, optional
    A matrix (as defined by ``coeffs``) containing the standard
    distribution of the crosstalk measurements.
coeffNum : `numpy.ndarray`, optional
    A matrix containing the number of pixel pairs used to measure
    the ``coeffs`` and ``coeffErr``.
coeffValid : `numpy.ndarray`, optional
    A matrix of Boolean values indicating if the coefficient is
    valid, defined as abs(coeff) > coeffErr / sqrt(coeffNum).
interChip : `dict` [`numpy.ndarray`]
    A dictionary keyed by detectorName containing ``coeffs``
    matrices used to correct for inter-chip crosstalk with a
    source on the detector indicated.

Definition at line 41 of file crosstalk.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.ip.isr.crosstalk.CrosstalkCalib.__init__ (   self,
  detector = None,
  nAmp = 0,
**  kwargs 
)

Reimplemented from lsst.ip.isr.calibType.IsrCalib.

Definition at line 90 of file crosstalk.py.

Member Function Documentation

◆ calculateBackground()

def lsst.ip.isr.crosstalk.CrosstalkCalib.calculateBackground (   mi,
  badPixels = ["BAD"] 
)
static
Estimate median background in image.

Getting a great background model isn't important for crosstalk
correction, since the crosstalk is at a low level. The median should
be sufficient.

Parameters
----------
mi : `lsst.afw.image.MaskedImage`
    MaskedImage for which to measure background.
badPixels : `list` of `str`
    Mask planes to ignore.
Returns
-------
bg : `float`
    Median background level.

Definition at line 435 of file crosstalk.py.

◆ extractAmp()

def lsst.ip.isr.crosstalk.CrosstalkCalib.extractAmp (   image,
  amp,
  ampTarget,
  isTrimmed = False 
)
static
Extract the image data from an amp, flipped to match ampTarget.

Parameters
----------
image : `lsst.afw.image.Image` or `lsst.afw.image.MaskedImage`
    Image containing the amplifier of interest.
amp : `lsst.afw.cameraGeom.Amplifier`
    Amplifier on image to extract.
ampTarget : `lsst.afw.cameraGeom.Amplifier`
    Target amplifier that the extracted image will be flipped
    to match.
isTrimmed : `bool`
    The image is already trimmed.
    TODO : DM-15409 will resolve this.

Returns
-------
output : `lsst.afw.image.Image`
    Image of the amplifier in the desired configuration.

Definition at line 394 of file crosstalk.py.

◆ fromDetector()

def lsst.ip.isr.crosstalk.CrosstalkCalib.fromDetector (   self,
  detector,
  coeffVector = None 
)
Set calibration parameters from the detector.

Parameters
----------
detector : `lsst.afw.cameraGeom.Detector`
    Detector to use to set parameters from.
coeffVector : `numpy.array`, optional
    Use the detector geometry (bounding boxes and flip
    information), but use ``coeffVector`` instead of the
    output of ``detector.getCrosstalk()``.

Returns
-------
calib : `lsst.ip.isr.CrosstalkCalib`
    The calibration constructed from the detector.

Reimplemented from lsst.ip.isr.calibType.IsrCalib.

Definition at line 134 of file crosstalk.py.

◆ fromDict()

def lsst.ip.isr.crosstalk.CrosstalkCalib.fromDict (   cls,
  dictionary 
)
Construct a calibration from a dictionary of properties.

Must be implemented by the specific calibration subclasses.

Parameters
----------
dictionary : `dict`
    Dictionary of properties.

Returns
-------
calib : `lsst.ip.isr.CalibType`
    Constructed calibration.

Raises
------
RuntimeError
    Raised if the supplied dictionary is for a different
    calibration.

Reimplemented from lsst.ip.isr.calibType.IsrCalib.

Definition at line 182 of file crosstalk.py.

◆ fromTable()

def lsst.ip.isr.crosstalk.CrosstalkCalib.fromTable (   cls,
  tableList 
)
Construct calibration from a list of tables.

This method uses the `fromDict` method to create the
calibration, after constructing an appropriate dictionary from
the input tables.

Parameters
----------
tableList : `list` [`lsst.afw.table.Table`]
    List of tables to use to construct the crosstalk
    calibration.

Returns
-------
calib : `lsst.ip.isr.CrosstalkCalib`
    The calibration defined in the tables.

Reimplemented from lsst.ip.isr.calibType.IsrCalib.

Definition at line 314 of file crosstalk.py.

◆ subtractCrosstalk()

def lsst.ip.isr.crosstalk.CrosstalkCalib.subtractCrosstalk (   self,
  thisExposure,
  sourceExposure = None,
  crosstalkCoeffs = None,
  badPixels = ["BAD"],
  minPixelToMask = 45000,
  crosstalkStr = "CROSSTALK",
  isTrimmed = False,
  backgroundMethod = "None" 
)
Subtract the crosstalk from thisExposure, optionally using a
different source.

We set the mask plane indicated by ``crosstalkStr`` in a target
amplifier for pixels in a source amplifier that exceed
``minPixelToMask``. Note that the correction is applied to all pixels
in the amplifier, but only those that have a substantial crosstalk
are masked with ``crosstalkStr``.

The uncorrected image is used as a template for correction. This is
good enough if the crosstalk is small (e.g., coefficients < ~ 1e-3),
but if it's larger you may want to iterate.

Parameters
----------
thisExposure : `lsst.afw.image.Exposure`
    Exposure for which to subtract crosstalk.
sourceExposure : `lsst.afw.image.Exposure`, optional
    Exposure to use as the source of the crosstalk.  If not set,
    thisExposure is used as the source (intra-detector crosstalk).
crosstalkCoeffs : `numpy.ndarray`, optional.
    Coefficients to use to correct crosstalk.
badPixels : `list` of `str`
    Mask planes to ignore.
minPixelToMask : `float`
    Minimum pixel value (relative to the background level) in
    source amplifier for which to set ``crosstalkStr`` mask plane
    in target amplifier.
crosstalkStr : `str`
    Mask plane name for pixels greatly modified by crosstalk
    (above minPixelToMask).
isTrimmed : `bool`
    The image is already trimmed.
    This should no longer be needed once DM-15409 is resolved.
backgroundMethod : `str`
    Method used to subtract the background.  "AMP" uses
    amplifier-by-amplifier background levels, "DETECTOR" uses full
    exposure/maskedImage levels.  Any other value results in no
    background subtraction.

Definition at line 458 of file crosstalk.py.

◆ toDict()

def lsst.ip.isr.crosstalk.CrosstalkCalib.toDict (   self)
Return a dictionary containing the calibration properties.

The dictionary should be able to be round-tripped through
`fromDict`.

Returns
-------
dictionary : `dict`
    Dictionary of properties.

Reimplemented from lsst.ip.isr.calibType.IsrCalib.

Definition at line 275 of file crosstalk.py.

◆ toTable()

def lsst.ip.isr.crosstalk.CrosstalkCalib.toTable (   self)
Construct a list of tables containing the information in this
calibration.

The list of tables should create an identical calibration
after being passed to this class's fromTable method.

Returns
-------
tableList : `list` [`lsst.afw.table.Table`]
    List of tables containing the crosstalk calibration
    information.

Reimplemented from lsst.ip.isr.calibType.IsrCalib.

Definition at line 357 of file crosstalk.py.

◆ updateMetadata()

def lsst.ip.isr.crosstalk.CrosstalkCalib.updateMetadata (   self,
  setDate = False,
**  kwargs 
)
Update calibration metadata.

This calls the base class's method after ensuring the required
calibration keywords will be saved.

Parameters
----------
setDate : `bool`, optional
    Update the CALIBDATE fields in the metadata to the current
    time. Defaults to False.
kwargs :
    Other keyword parameters to set in the metadata.

Reimplemented from lsst.ip.isr.calibType.IsrCalib.

Definition at line 110 of file crosstalk.py.

Member Data Documentation

◆ coeffErr

lsst.ip.isr.crosstalk.CrosstalkCalib.coeffErr

Definition at line 96 of file crosstalk.py.

◆ coeffNum

lsst.ip.isr.crosstalk.CrosstalkCalib.coeffNum

Definition at line 97 of file crosstalk.py.

◆ coeffs

lsst.ip.isr.crosstalk.CrosstalkCalib.coeffs

Definition at line 95 of file crosstalk.py.

◆ coeffValid

lsst.ip.isr.crosstalk.CrosstalkCalib.coeffValid

Definition at line 99 of file crosstalk.py.

◆ crosstalkShape

lsst.ip.isr.crosstalk.CrosstalkCalib.crosstalkShape

Definition at line 93 of file crosstalk.py.

◆ hasCrosstalk

lsst.ip.isr.crosstalk.CrosstalkCalib.hasCrosstalk

Definition at line 91 of file crosstalk.py.

◆ interChip

lsst.ip.isr.crosstalk.CrosstalkCalib.interChip

Definition at line 101 of file crosstalk.py.

◆ nAmp

lsst.ip.isr.crosstalk.CrosstalkCalib.nAmp

Definition at line 92 of file crosstalk.py.


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