AmpOffsetTask#
- class lsst.ip.isr.AmpOffsetTask(*args, **kwargs)#
Bases:
TaskCalculate and apply amp offset corrections to an exposure.
Methods Summary
getAmpAssociations(amps)Determine amp geometry and amp associations from a list of amplifiers.
getAmpEdges(im, amps, ampSides)Calculate the amp edges for all amplifiers.
getAmpOffsets(im, amps, associations, sides)Calculate the amp offsets for all amplifiers.
getInterfaceOffset(ampNameA, ampNameB, ...)Calculate the amp offset for a given interface between two amplifiers.
getNeighbors(ampIds, ampId)Get the neighbor amplifiers and their sides for a given amplifier.
run(exposure)Calculate amp offset values, determine corrective pedestals for each amp, and update the input exposure in-place.
Methods Documentation
- getAmpAssociations(amps)#
Determine amp geometry and amp associations from a list of amplifiers.
Parse an input list of amplifiers to determine the layout of amps within a detector, and identify all amp sides (i.e., the horizontal and vertical junctions between amps).
Returns a matrix with a shape corresponding to the geometry of the amps in the detector.
Parameters#
- amps
list[lsst.afw.cameraGeom.Amplifier] List of amplifier objects used to deduce associations.
Returns#
- ampAssociations
numpy.ndarray An N x N matrix (N = number of amplifiers) that illustrates the connections between amplifiers within the detector layout. Each row and column index corresponds to the ampIds of a specific pair of amplifiers, and the matrix elements indicate their associations as follows:
0: No association
-1: Association exists (direction specified in the ampSides matrix)
n >= 1: Diagonal elements indicate the number of neighboring amplifiers for the corresponding ampId==row==column number.
- ampSides
numpy.ndarray An N x N matrix (N = the number of amplifiers) representing the amp side information corresponding to the
ampAssociationsmatrix. The elements are integers defined as below:-1: No side due to no association or the same amp (diagonals)
0: Side on the bottom
1: Side on the right
2: Side on the top
3: Side on the left
- amps
- getAmpEdges(im, amps, ampSides)#
Calculate the amp edges for all amplifiers.
Parameters#
- im
lsst.afw.image._image.ImageF Amplifier image to extract data from.
- amps
list[lsst.afw.cameraGeom.Amplifier] List of amplifier objects.
- ampSides
numpy.ndarray An N x N matrix containing amp side information, where N is the number of amplifiers.
Returns#
- ampEdges
dict[int,dict[int,numpy.ndarray]] A dictionary containing amp edge(s) for each amplifier, corresponding to one or more potential sides, where each edge is associated with a side. The outer dictionary has integer keys representing amplifier IDs, and the inner dictionary has integer keys representing side IDs for each amplifier and values that are 1D arrays of floats representing the median values of strips from the amp image, referred to as an “amp edge”: {ampID: {sideID: numpy.ndarray}, …}
- im
- getAmpOffsets(im, amps, associations, sides)#
Calculate the amp offsets for all amplifiers.
Parameters#
- im
lsst.afw.image._image.ImageF Amplifier image to extract data from.
- amps
list[lsst.afw.cameraGeom.Amplifier] List of amplifier objects.
- associationsnumpy.ndarray
An N x N matrix containing amp association information, where N is the number of amplifiers.
- sidesnumpy.ndarray
An N x N matrix containing amp side information, where N is the number of amplifiers.
Returns#
- ampOffsets
numpy.ndarray 1D float array containing the calculated amp offsets for all amplifiers (optionally weighted by interface length).
- interfaceOffsetDict
dict[str,float] Dictionary mapping interface IDs to their corresponding raw (uncapped) offset values.
- im
- getInterfaceOffset(ampNameA, ampNameB, edgeA, edgeB)#
Calculate the amp offset for a given interface between two amplifiers.
Parameters#
- ampNameAstr
Name of the first amplifier.
- ampNameBstr
Name of the second amplifier.
- edgeAnumpy.ndarray
Amp edge for the first amplifier.
- edgeBnumpy.ndarray
Amp edge for the second amplifier.
Returns#
- interfaceIdstr
Identifier for the interface between amps A and B, formatted as “A-B”, where A and B are the respective amp names.
- interfaceOffsetfloat
The calculated amp offset value for the given interface between amps A and B.
- interfaceOffsetOriginalfloat
The original calculated amp offset value for the given interface between amps A and B.
- ampEdgeGoodFracfloat
Fraction of viable pixel rows along the amp edge.
- minFracFailbool
True if the fraction of unmasked pixel rows is below the ampEdgeMinFrac threshold.
- maxOffsetFailbool
True if the absolute offset value exceeds the ampEdgeMaxOffset threshold.
- getNeighbors(ampIds, ampId)#
Get the neighbor amplifiers and their sides for a given amplifier.
Parameters#
- ampIds
numpy.ndarray Matrix with amp side association information.
- ampId
int The amplifier ID for which neighbor amplifiers and side IDs are to be found.
Returns#
- neighbors
list[int] List of neighbor amplifier IDs.
- sides
list[int] List of side IDs, with each ID corresponding to its respective neighbor amplifier.
- ampIds