Loading [MathJax]/extensions/tex2jax.js
LSST Applications g0000d66e7c+ce78115f25,g0485b4d2cb+c8d56b10d4,g0fba68d861+fcbc158cd0,g1ec0fe41b4+3e153770da,g1fd858c14a+57ee4e1624,g2440f9efcc+8c5ae1fdc5,g35bb328faa+8c5ae1fdc5,g4d2262a081+1e04cc5a47,g53246c7159+8c5ae1fdc5,g55585698de+7a33f081c8,g56a49b3a55+b9d5cac73f,g60b5630c4e+7a33f081c8,g67b6fd64d1+035c836e50,g78460c75b0+7e33a9eb6d,g786e29fd12+668abc6043,g7ac00fbb6c+b938379438,g8352419a5c+8c5ae1fdc5,g8852436030+5ba78a36c9,g89139ef638+035c836e50,g94187f82dc+7a33f081c8,g989de1cb63+035c836e50,g9d31334357+7a33f081c8,g9f33ca652e+e34120223a,ga815be3f0b+911242149a,gabe3b4be73+8856018cbb,gabf8522325+21619da9f3,gb1101e3267+0b44b44611,gb89ab40317+035c836e50,gc91f06edcd+e59fb3c9bc,gcf25f946ba+5ba78a36c9,gd6cbbdb0b4+958adf5c1f,gde0f65d7ad+6c98dcc924,ge278dab8ac+83c63f4893,ge410e46f29+035c836e50,gf35d7ec915+97dd712d81,gf5e32f922b+8c5ae1fdc5,gf67bdafdda+035c836e50,gf6800124b1+1714c04baa,w.2025.19
LSST Data Management Base Package
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
lsst.ip.isr.linearize.Linearizer Class Reference
Inheritance diagram for lsst.ip.isr.linearize.Linearizer:
lsst.ip.isr.calibType.IsrCalib

Public Member Functions

 __init__ (self, table=None, **kwargs)
 
 updateMetadata (self, setDate=False, **kwargs)
 
 fromDetector (self, detector)
 
 fromDict (cls, dictionary)
 
 toDict (self)
 
 fromTable (cls, tableList)
 
 toTable (self)
 
 getLinearityTypeByName (self, linearityTypeName)
 
 validate (self, detector=None, amplifier=None)
 
 applyLinearity (self, image, detector=None, log=None, gains=None)
 
 requiredAttributes (self)
 
 requiredAttributes (self, value)
 
 __str__ (self)
 
 __eq__ (self, other)
 
 metadata (self)
 
 getMetadata (self)
 
 setMetadata (self, metadata)
 
 updateMetadataFromExposures (self, exposures)
 
 calibInfoFromDict (self, dictionary)
 
 determineCalibClass (cls, metadata, message)
 
 readText (cls, filename, **kwargs)
 
 writeText (self, filename, format="auto")
 
 readFits (cls, filename, **kwargs)
 
 writeFits (self, filename)
 
 apply (self, target)
 

Public Attributes

bool hasLinearity = False
 
bool override = False
 
 ampNames = list()
 
 linearityCoeffs = dict()
 
 linearityType = dict()
 
 linearityBBox = dict()
 
 fitParams = dict()
 
 fitParamsErr = dict()
 
 fitChiSq = dict()
 
 fitResiduals = dict()
 
 fitResidualsSigmaMad = dict()
 
 linearFit = dict()
 
 linearityTurnoff = dict()
 
 linearityMaxSignal = dict()
 
 tableData = None
 
str linearityUnits = 'adu'
 
 requiredAttributes = set(["_OBSTYPE", "_SCHEMA", "_VERSION"])
 
 log = log if log else logging.getLogger(__name__)
 

Protected Attributes

 _instrument = None
 
 _raftName = None
 
 _slotName = None
 
 _detectorName = None
 
 _detectorSerial = None
 
 _detectorId = None
 
 _filter = None
 
str _calibId = None
 
 _seqfile = None
 
 _seqname = None
 
 _seqcksum = None
 
 _metadata = PropertyList()
 
 _requiredAttributes
 

Static Protected Attributes

str _OBSTYPE = "generic"
 
str _SCHEMA = "NO SCHEMA"
 
int _VERSION = 0
 

Detailed Description

Parameter set for linearization.

These parameters are included in `lsst.afw.cameraGeom.Amplifier`, but
should be accessible externally to allow for testing.

Parameters
----------
table : `numpy.array`, optional
    Lookup table; a 2-dimensional array of floats:

    - one row for each row index (value of coef[0] in the amplifier)
    - one column for each image value

    To avoid copying the table the last index should vary fastest
    (numpy default "C" order)
detector : `lsst.afw.cameraGeom.Detector`, optional
    Detector object.  Passed to self.fromDetector() on init.
log : `logging.Logger`, optional
    Logger to handle messages.
kwargs : `dict`, optional
    Other keyword arguments to pass to the parent init.

Raises
------
RuntimeError
    Raised if the supplied table is not 2D, or if the table has fewer
    columns than rows (indicating that the indices are swapped).

Notes
-----
The linearizer attributes stored are:

hasLinearity : `bool`
    Whether a linearity correction is defined for this detector.
override : `bool`
    Whether the detector parameters should be overridden.
ampNames : `list` [`str`]
    List of amplifier names to correct.
linearityCoeffs : `dict` [`str`, `numpy.array`]
    Coefficients to use in correction.  Indexed by amplifier
    names.  The format of the array depends on the type of
    correction to apply.
linearityType : `dict` [`str`, `str`]
    Type of correction to use, indexed by amplifier names.
linearityBBox : `dict` [`str`, `lsst.geom.Box2I`]
    Bounding box the correction is valid over, indexed by
    amplifier names.
fitParams : `dict` [`str`, `numpy.array`], optional
    Linearity fit parameters used to construct the correction
    coefficients, indexed as above.
fitParamsErr : `dict` [`str`, `numpy.array`], optional
    Uncertainty values of the linearity fit parameters used to
    construct the correction coefficients, indexed as above.
fitChiSq : `dict` [`str`, `float`], optional
    Chi-squared value of the linearity fit, indexed as above.
fitResiduals : `dict` [`str`, `numpy.array`], optional
    Residuals of the fit, indexed as above. Used for
    calculating photdiode corrections
fitResidualsSigmaMad : `dict` [`str`, `float`], optional
    Robust median-absolute-deviation of fit residuals, scaled
    by the signal level.
linearFit : The linear fit to the low flux region of the curve.
    [intercept, slope].
tableData : `numpy.array`, optional
    Lookup table data for the linearity correction.

Version 1.4 adds ``linearityTurnoff`` and ``linearityMaxSignal``.

Definition at line 40 of file linearize.py.

Constructor & Destructor Documentation

◆ __init__()

lsst.ip.isr.linearize.Linearizer.__init__ ( self,
table = None,
** kwargs )

Definition at line 113 of file linearize.py.

113 def __init__(self, table=None, **kwargs):
114 self.hasLinearity = False
115 self.override = False
116
117 self.ampNames = list()
118 self.linearityCoeffs = dict()
119 self.linearityType = dict()
120 self.linearityBBox = dict()
121 self.fitParams = dict()
122 self.fitParamsErr = dict()
123 self.fitChiSq = dict()
124 self.fitResiduals = dict()
125 self.fitResidualsSigmaMad = dict()
126 self.linearFit = dict()
127 self.linearityTurnoff = dict()
128 self.linearityMaxSignal = dict()
129 self.tableData = None
130 if table is not None:
131 if len(table.shape) != 2:
132 raise RuntimeError("table shape = %s; must have two dimensions" % (table.shape,))
133 if table.shape[1] < table.shape[0]:
134 raise RuntimeError("table shape = %s; indices are switched" % (table.shape,))
135 self.tableData = np.array(table, order="C")
136
137 # The linearizer is always natively in adu because it
138 # is computed prior to computing gains.
139 self.linearityUnits = 'adu'
140
141 super().__init__(**kwargs)
142 self.requiredAttributes.update(['hasLinearity', 'override',
143 'ampNames',
144 'linearityCoeffs', 'linearityType', 'linearityBBox',
145 'fitParams', 'fitParamsErr', 'fitChiSq',
146 'fitResiduals', 'fitResidualsSigmaMad', 'linearFit', 'tableData',
147 'units', 'linearityTurnoff', 'linearityMaxSignal'])
148

Member Function Documentation

◆ __eq__()

lsst.ip.isr.calibType.IsrCalib.__eq__ ( self,
other )
inherited
Calibration equivalence.

Running ``calib.log.setLevel(0)`` enables debug statements to
identify problematic fields.

Definition at line 103 of file calibType.py.

103 def __eq__(self, other):
104 """Calibration equivalence.
105
106 Running ``calib.log.setLevel(0)`` enables debug statements to
107 identify problematic fields.
108 """
109 if not isinstance(other, self.__class__):
110 self.log.debug("Incorrect class type: %s %s", self.__class__, other.__class__)
111 return False
112
113 for attr in self._requiredAttributes:
114 attrSelf = getattr(self, attr)
115 attrOther = getattr(other, attr)
116
117 if isinstance(attrSelf, dict):
118 # Dictionary of arrays.
119 if attrSelf.keys() != attrOther.keys():
120 self.log.debug("Dict Key Failure: %s %s %s", attr, attrSelf.keys(), attrOther.keys())
121 return False
122 for key in attrSelf:
123 try:
124 if not np.allclose(attrSelf[key], attrOther[key], equal_nan=True):
125 self.log.debug("Array Failure: %s %s %s", key, attrSelf[key], attrOther[key])
126 return False
127 except TypeError:
128 # If it is not something numpy can handle
129 # (it's not a number or array of numbers),
130 # then it needs to have its own equivalence
131 # operator.
132 if np.all(attrSelf[key] != attrOther[key]):
133 return False
134 elif isinstance(attrSelf, np.ndarray):
135 # Bare array.
136 if isinstance(attrSelf[0], (str, np.str_, np.bytes_)):
137 if not np.all(attrSelf == attrOther):
138 self.log.debug("Array Failure: %s %s %s", attr, attrSelf, attrOther)
139 return False
140 else:
141 if not np.allclose(attrSelf, attrOther, equal_nan=True):
142 self.log.debug("Array Failure: %s %s %s", attr, attrSelf, attrOther)
143 return False
144 elif type(attrSelf) is not type(attrOther):
145 if set([attrSelf, attrOther]) == set([None, ""]):
146 # Fits converts None to "", but None is not "".
147 continue
148 self.log.debug("Type Failure: %s %s %s %s %s", attr, type(attrSelf), type(attrOther),
149 attrSelf, attrOther)
150 return False
151 else:
152 if attrSelf != attrOther:
153 self.log.debug("Value Failure: %s %s %s", attr, attrSelf, attrOther)
154 return False
155
156 return True
157

◆ __str__()

lsst.ip.isr.calibType.IsrCalib.__str__ ( self)
inherited

Definition at line 100 of file calibType.py.

100 def __str__(self):
101 return f"{self.__class__.__name__}(obstype={self._OBSTYPE}, detector={self._detectorName}, )"
102

◆ apply()

lsst.ip.isr.calibType.IsrCalib.apply ( self,
target )
inherited
Method to apply the calibration to the target object.

Parameters
----------
target : `object`
    Thing to validate against.

Returns
-------
valid : `bool`
    Returns true if the calibration was applied correctly.

Raises
------
NotImplementedError
    Raised if not implemented.

Definition at line 685 of file calibType.py.

685 def apply(self, target):
686 """Method to apply the calibration to the target object.
687
688 Parameters
689 ----------
690 target : `object`
691 Thing to validate against.
692
693 Returns
694 -------
695 valid : `bool`
696 Returns true if the calibration was applied correctly.
697
698 Raises
699 ------
700 NotImplementedError
701 Raised if not implemented.
702 """
703 raise NotImplementedError("Must be implemented by subclass.")
704
705

◆ applyLinearity()

lsst.ip.isr.linearize.Linearizer.applyLinearity ( self,
image,
detector = None,
log = None,
gains = None )
Apply the linearity to an image.

If the linearity parameters are populated, use those,
otherwise use the values from the detector.

Parameters
----------
image : `~lsst.afw.image.image`
    Image to correct.
detector : `~lsst.afw.cameraGeom.detector`, optional
    Detector to use to determine exposure trimmed state.  If
    supplied, but no other linearity information is provided
    by the calibration, then the static solution stored in the
    detector will be used.
log : `~logging.Logger`, optional
    Log object to use for logging.
gains : `dict` [`str`, `float`], optional
    Dictionary of amp name to gain. If this is provided then
    linearity terms will be converted from adu to electrons.
    Only used for Spline linearity corrections.

Definition at line 497 of file linearize.py.

497 def applyLinearity(self, image, detector=None, log=None, gains=None):
498 """Apply the linearity to an image.
499
500 If the linearity parameters are populated, use those,
501 otherwise use the values from the detector.
502
503 Parameters
504 ----------
505 image : `~lsst.afw.image.image`
506 Image to correct.
507 detector : `~lsst.afw.cameraGeom.detector`, optional
508 Detector to use to determine exposure trimmed state. If
509 supplied, but no other linearity information is provided
510 by the calibration, then the static solution stored in the
511 detector will be used.
512 log : `~logging.Logger`, optional
513 Log object to use for logging.
514 gains : `dict` [`str`, `float`], optional
515 Dictionary of amp name to gain. If this is provided then
516 linearity terms will be converted from adu to electrons.
517 Only used for Spline linearity corrections.
518 """
519 if log is None:
520 log = self.log
521 if detector and not self.hasLinearity:
522 self.fromDetector(detector)
523
524 self.validate(detector)
525
526 # Check if the image is trimmed.
527 isTrimmed = None
528 if detector:
529 isTrimmed = isTrimmedImage(image, detector)
530
531 numAmps = 0
532 numLinearized = 0
533 numOutOfRange = 0
534 for ampName in self.linearityType.keys():
535 linearizer = self.getLinearityTypeByName(self.linearityType[ampName])
536 numAmps += 1
537
538 if gains and self.linearityUnits == 'adu':
539 gainValue = gains[ampName]
540 else:
541 gainValue = 1.0
542
543 if linearizer is not None:
544 match isTrimmed:
545 case True:
546 bbox = detector[ampName].getBBox()
547 case False:
548 bbox = detector[ampName].getRawBBox()
549 case None:
550 bbox = self.linearityBBox[ampName]
551
552 ampView = image.Factory(image, bbox)
553 success, outOfRange = linearizer()(ampView, **{'coeffs': self.linearityCoeffs[ampName],
554 'table': self.tableData,
555 'log': self.log,
556 'gain': gainValue})
557 numOutOfRange += outOfRange
558 if success:
559 numLinearized += 1
560 elif log is not None:
561 log.warning("Amplifier %s did not linearize.",
562 ampName)
563 return Struct(
564 numAmps=numAmps,
565 numLinearized=numLinearized,
566 numOutOfRange=numOutOfRange
567 )
568
569

◆ calibInfoFromDict()

lsst.ip.isr.calibType.IsrCalib.calibInfoFromDict ( self,
dictionary )
inherited
Handle common keywords.

This isn't an ideal solution, but until all calibrations
expect to find everything in the metadata, they still need to
search through dictionaries.

Parameters
----------
dictionary : `dict` or `lsst.daf.base.PropertyList`
    Source for the common keywords.

Raises
------
RuntimeError
    Raised if the dictionary does not match the expected OBSTYPE.

Definition at line 322 of file calibType.py.

322 def calibInfoFromDict(self, dictionary):
323 """Handle common keywords.
324
325 This isn't an ideal solution, but until all calibrations
326 expect to find everything in the metadata, they still need to
327 search through dictionaries.
328
329 Parameters
330 ----------
331 dictionary : `dict` or `lsst.daf.base.PropertyList`
332 Source for the common keywords.
333
334 Raises
335 ------
336 RuntimeError
337 Raised if the dictionary does not match the expected OBSTYPE.
338 """
339
340 def search(haystack, needles):
341 """Search dictionary 'haystack' for an entry in 'needles'
342 """
343 test = [haystack.get(x) for x in needles]
344 test = set([x for x in test if x is not None])
345 if len(test) == 0:
346 if "metadata" in haystack:
347 return search(haystack["metadata"], needles)
348 else:
349 return None
350 elif len(test) == 1:
351 value = list(test)[0]
352 if value == "":
353 return None
354 else:
355 return value
356 else:
357 raise ValueError(f"Too many values found: {len(test)} {test} {needles}")
358
359 if "metadata" in dictionary:
360 metadata = dictionary["metadata"]
361
362 if self._OBSTYPE != metadata["OBSTYPE"]:
363 raise RuntimeError(f"Incorrect calibration supplied. Expected {self._OBSTYPE}, "
364 f"found {metadata['OBSTYPE']}")
365
366 if (value := search(dictionary, ["INSTRUME", "instrument"])) is not None:
367 self._instrument = value
368 if (value := search(dictionary, ["RAFTNAME"])) is not None:
369 self._slotName = value
370 if (value := search(dictionary, ["DETECTOR", "detectorId"])) is not None:
371 self._detectorId = value
372 if (value := search(dictionary, ["DET_NAME", "DETECTOR_NAME", "detectorName"])) is not None:
373 self._detectorName = value
374 if (value := search(dictionary, ["DET_SER", "DETECTOR_SERIAL", "detectorSerial"])) is not None:
375 self._detectorSerial = value
376 if (value := search(dictionary, ["FILTER", "filterName"])) is not None:
377 self._filter = value
378 if (value := search(dictionary, ["CALIB_ID"])) is not None:
379 self._calibId = value
380 if (value := search(dictionary, ["SEQFILE"])) is not None:
381 self._seqfile = value
382 if (value := search(dictionary, ["SEQNAME"])) is not None:
383 self._seqname = value
384 if (value := search(dictionary, ["SEQCKSUM"])) is not None:
385 self._seqcksum = value
386

◆ determineCalibClass()

lsst.ip.isr.calibType.IsrCalib.determineCalibClass ( cls,
metadata,
message )
inherited
Attempt to find calibration class in metadata.

Parameters
----------
metadata : `dict` or `lsst.daf.base.PropertyList`
    Metadata possibly containing a calibration class entry.
message : `str`
    Message to include in any errors.

Returns
-------
calibClass : `object`
    The class to use to read the file contents.  Should be an
    `lsst.ip.isr.IsrCalib` subclass.

Raises
------
ValueError
    Raised if the resulting calibClass is the base
    `lsst.ip.isr.IsrClass` (which does not implement the
    content methods).

Definition at line 388 of file calibType.py.

388 def determineCalibClass(cls, metadata, message):
389 """Attempt to find calibration class in metadata.
390
391 Parameters
392 ----------
393 metadata : `dict` or `lsst.daf.base.PropertyList`
394 Metadata possibly containing a calibration class entry.
395 message : `str`
396 Message to include in any errors.
397
398 Returns
399 -------
400 calibClass : `object`
401 The class to use to read the file contents. Should be an
402 `lsst.ip.isr.IsrCalib` subclass.
403
404 Raises
405 ------
406 ValueError
407 Raised if the resulting calibClass is the base
408 `lsst.ip.isr.IsrClass` (which does not implement the
409 content methods).
410 """
411 calibClassName = metadata.get("CALIBCLS")
412 calibClass = doImport(calibClassName) if calibClassName is not None else cls
413 if calibClass is IsrCalib:
414 raise ValueError(f"Cannot use base class to read calibration data: {message}")
415 return calibClass
416

◆ fromDetector()

lsst.ip.isr.linearize.Linearizer.fromDetector ( self,
detector )
Read linearity parameters from a detector.

Parameters
----------
detector : `lsst.afw.cameraGeom.detector`
    Input detector with parameters to use.

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

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

Definition at line 170 of file linearize.py.

170 def fromDetector(self, detector):
171 """Read linearity parameters from a detector.
172
173 Parameters
174 ----------
175 detector : `lsst.afw.cameraGeom.detector`
176 Input detector with parameters to use.
177
178 Returns
179 -------
180 calib : `lsst.ip.isr.Linearizer`
181 The calibration constructed from the detector.
182 """
183 self._detectorName = detector.getName()
184 self._detectorSerial = detector.getSerial()
185 self._detectorId = detector.getId()
186 self.hasLinearity = True
187
188 # Do not translate Threshold, Maximum, Units.
189 for amp in detector.getAmplifiers():
190 ampName = amp.getName()
191 self.ampNames.append(ampName)
192 self.linearityType[ampName] = amp.getLinearityType()
193 self.linearityCoeffs[ampName] = amp.getLinearityCoeffs()
194 self.linearityBBox[ampName] = amp.getBBox()
195
196 # Detector linearizers (legacy) are assumed to be adu units.
197 self.linearityUnits = 'adu'
198
199 return self
200

◆ fromDict()

lsst.ip.isr.linearize.Linearizer.fromDict ( cls,
dictionary )
Construct a calibration from a dictionary of properties

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

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

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

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

Definition at line 202 of file linearize.py.

202 def fromDict(cls, dictionary):
203 """Construct a calibration from a dictionary of properties
204
205 Parameters
206 ----------
207 dictionary : `dict`
208 Dictionary of properties
209
210 Returns
211 -------
212 calib : `lsst.ip.isr.Linearity`
213 Constructed calibration.
214
215 Raises
216 ------
217 RuntimeError
218 Raised if the supplied dictionary is for a different
219 calibration.
220 """
221
222 calib = cls()
223
224 if calib._OBSTYPE != dictionary['metadata']['OBSTYPE']:
225 raise RuntimeError(f"Incorrect linearity supplied. Expected {calib._OBSTYPE}, "
226 f"found {dictionary['metadata']['OBSTYPE']}")
227
228 calib.setMetadata(dictionary['metadata'])
229
230 calib.hasLinearity = dictionary.get('hasLinearity',
231 dictionary['metadata'].get('HAS_LINEARITY', False))
232 calib.override = dictionary.get('override', True)
233
234 # Old linearizers which do not have linearityUnits are
235 # assumed to be adu because that's all that has been
236 # supported.
237 calib.linearityUnits = dictionary.get('linearityUnits', 'adu')
238
239 if calib.hasLinearity:
240 for ampName in dictionary['amplifiers']:
241 amp = dictionary['amplifiers'][ampName]
242 calib.ampNames.append(ampName)
243 calib.linearityCoeffs[ampName] = np.array(amp.get('linearityCoeffs', [0.0]))
244 calib.linearityType[ampName] = amp.get('linearityType', 'None')
245 calib.linearityBBox[ampName] = amp.get('linearityBBox', None)
246
247 calib.fitParams[ampName] = np.array(amp.get('fitParams', [0.0]))
248 calib.fitParamsErr[ampName] = np.array(amp.get('fitParamsErr', [0.0]))
249 calib.fitChiSq[ampName] = amp.get('fitChiSq', np.nan)
250 calib.fitResiduals[ampName] = np.array(amp.get('fitResiduals', [0.0]))
251 calib.fitResidualsSigmaMad[ampName] = np.array(amp.get('fitResidualsSigmaMad', np.nan))
252 calib.linearFit[ampName] = np.array(amp.get('linearFit', [0.0]))
253
254 calib.linearityTurnoff[ampName] = np.array(amp.get('linearityTurnoff', np.nan))
255 calib.linearityMaxSignal[ampName] = np.array(amp.get('linearityMaxSignal', np.nan))
256
257 calib.tableData = dictionary.get('tableData', None)
258 if calib.tableData:
259 calib.tableData = np.array(calib.tableData)
260
261 return calib
262

◆ fromTable()

lsst.ip.isr.linearize.Linearizer.fromTable ( cls,
tableList )
Read linearity from a FITS file.

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

Parameters
----------
tableList : `list` [`astropy.table.Table`]
    afwTable read from input file name.

Returns
-------
linearity : `~lsst.ip.isr.linearize.Linearizer``
    Linearity parameters.

Notes
-----
The method reads a FITS file with 1 or 2 extensions. The metadata is
read from the header of extension 1, which must exist.  Then the table
is loaded, and  the ['AMPLIFIER_NAME', 'TYPE', 'COEFFS', 'BBOX_X0',
'BBOX_Y0', 'BBOX_DX', 'BBOX_DY'] columns are read and used to set each
dictionary by looping over rows.
Extension 2 is then attempted to read in the try block (which only
exists for lookup tables). It has a column named 'LOOKUP_VALUES' that
contains a vector of the lookup entries in each row.

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

Definition at line 300 of file linearize.py.

300 def fromTable(cls, tableList):
301 """Read linearity from a FITS file.
302
303 This method uses the `fromDict` method to create the
304 calibration, after constructing an appropriate dictionary from
305 the input tables.
306
307 Parameters
308 ----------
309 tableList : `list` [`astropy.table.Table`]
310 afwTable read from input file name.
311
312 Returns
313 -------
314 linearity : `~lsst.ip.isr.linearize.Linearizer``
315 Linearity parameters.
316
317 Notes
318 -----
319 The method reads a FITS file with 1 or 2 extensions. The metadata is
320 read from the header of extension 1, which must exist. Then the table
321 is loaded, and the ['AMPLIFIER_NAME', 'TYPE', 'COEFFS', 'BBOX_X0',
322 'BBOX_Y0', 'BBOX_DX', 'BBOX_DY'] columns are read and used to set each
323 dictionary by looping over rows.
324 Extension 2 is then attempted to read in the try block (which only
325 exists for lookup tables). It has a column named 'LOOKUP_VALUES' that
326 contains a vector of the lookup entries in each row.
327 """
328 coeffTable = tableList[0]
329
330 metadata = coeffTable.meta
331 inDict = dict()
332 inDict['metadata'] = metadata
333 inDict['hasLinearity'] = metadata.get('HAS_LINEARITY', False)
334 inDict['amplifiers'] = dict()
335 inDict['linearityUnits'] = metadata.get('LINEARITY_UNITS', 'adu')
336
337 for record in coeffTable:
338 ampName = record['AMPLIFIER_NAME']
339
340 fitParams = record['FIT_PARAMS'] if 'FIT_PARAMS' in record.columns else np.array([0.0])
341 fitParamsErr = record['FIT_PARAMS_ERR'] if 'FIT_PARAMS_ERR' in record.columns else np.array([0.0])
342 fitChiSq = record['RED_CHI_SQ'] if 'RED_CHI_SQ' in record.columns else np.nan
343 fitResiduals = record['FIT_RES'] if 'FIT_RES' in record.columns else np.array([0.0])
344 fitResidualsSigmaMad = record['FIT_RES_SIGMAD'] if 'FIT_RES_SIGMAD' in record.columns else np.nan
345 linearFit = record['LIN_FIT'] if 'LIN_FIT' in record.columns else np.array([0.0])
346
347 linearityTurnoff = record['LINEARITY_TURNOFF'] if 'LINEARITY_TURNOFF' in record.columns \
348 else np.nan
349 linearityMaxSignal = record['LINEARITY_MAX_SIGNAL'] if 'LINEARITY_MAX_SIGNAL' in record.columns \
350 else np.nan
351
352 inDict['amplifiers'][ampName] = {
353 'linearityType': record['TYPE'],
354 'linearityCoeffs': record['COEFFS'],
355 'linearityBBox': Box2I(Point2I(record['BBOX_X0'], record['BBOX_Y0']),
356 Extent2I(record['BBOX_DX'], record['BBOX_DY'])),
357 'fitParams': fitParams,
358 'fitParamsErr': fitParamsErr,
359 'fitChiSq': fitChiSq,
360 'fitResiduals': fitResiduals,
361 'fitResidualsSigmaMad': fitResidualsSigmaMad,
362 'linearFit': linearFit,
363 'linearityTurnoff': linearityTurnoff,
364 'linearityMaxSignal': linearityMaxSignal,
365 }
366
367 if len(tableList) > 1:
368 tableData = tableList[1]
369 inDict['tableData'] = [record['LOOKUP_VALUES'] for record in tableData]
370
371 return cls().fromDict(inDict)
372

◆ getLinearityTypeByName()

lsst.ip.isr.linearize.Linearizer.getLinearityTypeByName ( self,
linearityTypeName )
Determine the linearity class to use from the type name.

Parameters
----------
linearityTypeName : str
    String name of the linearity type that is needed.

Returns
-------
linearityType : `~lsst.ip.isr.linearize.LinearizeBase`
    The appropriate linearity class to use.  If no matching class
    is found, `None` is returned.

Definition at line 413 of file linearize.py.

413 def getLinearityTypeByName(self, linearityTypeName):
414 """Determine the linearity class to use from the type name.
415
416 Parameters
417 ----------
418 linearityTypeName : str
419 String name of the linearity type that is needed.
420
421 Returns
422 -------
423 linearityType : `~lsst.ip.isr.linearize.LinearizeBase`
424 The appropriate linearity class to use. If no matching class
425 is found, `None` is returned.
426 """
427 for t in [LinearizeLookupTable,
428 LinearizeSquared,
429 LinearizePolynomial,
430 LinearizeProportional,
431 LinearizeSpline,
432 LinearizeNone]:
433 if t.LinearityType == linearityTypeName:
434 return t
435 return None
436

◆ getMetadata()

lsst.ip.isr.calibType.IsrCalib.getMetadata ( self)
inherited
Retrieve metadata associated with this calibration.

Returns
-------
meta : `lsst.daf.base.PropertyList`
    Metadata. The returned `~lsst.daf.base.PropertyList` can be
    modified by the caller and the changes will be written to
    external files.

Definition at line 171 of file calibType.py.

171 def getMetadata(self):
172 """Retrieve metadata associated with this calibration.
173
174 Returns
175 -------
176 meta : `lsst.daf.base.PropertyList`
177 Metadata. The returned `~lsst.daf.base.PropertyList` can be
178 modified by the caller and the changes will be written to
179 external files.
180 """
181 return self._metadata
182

◆ metadata()

lsst.ip.isr.calibType.IsrCalib.metadata ( self)
inherited

Definition at line 168 of file calibType.py.

168 def metadata(self):
169 return self._metadata
170

◆ readFits()

lsst.ip.isr.calibType.IsrCalib.readFits ( cls,
filename,
** kwargs )
inherited
Read calibration data from a FITS file.

Parameters
----------
filename : `str`
    Filename to read data from.
kwargs : `dict` or collections.abc.Mapping`, optional
    Set of key=value pairs to pass to the ``fromTable``
    method.

Returns
-------
calib : `lsst.ip.isr.IsrCalib`
    Calibration contained within the file.

Definition at line 505 of file calibType.py.

505 def readFits(cls, filename, **kwargs):
506 """Read calibration data from a FITS file.
507
508 Parameters
509 ----------
510 filename : `str`
511 Filename to read data from.
512 kwargs : `dict` or collections.abc.Mapping`, optional
513 Set of key=value pairs to pass to the ``fromTable``
514 method.
515
516 Returns
517 -------
518 calib : `lsst.ip.isr.IsrCalib`
519 Calibration contained within the file.
520 """
521 tableList = []
522 tableList.append(Table.read(filename, hdu=1, mask_invalid=False))
523 extNum = 2 # Fits indices start at 1, we've read one already.
524 keepTrying = True
525
526 while keepTrying:
527 with warnings.catch_warnings():
528 warnings.simplefilter("error")
529 try:
530 newTable = Table.read(filename, hdu=extNum, mask_invalid=False)
531 tableList.append(newTable)
532 extNum += 1
533 except Exception:
534 keepTrying = False
535
536 for table in tableList:
537 for k, v in table.meta.items():
538 if isinstance(v, fits.card.Undefined):
539 table.meta[k] = None
540
541 calibClass = cls.determineCalibClass(tableList[0].meta, "readFits")
542 return calibClass.fromTable(tableList, **kwargs)
543

◆ readText()

lsst.ip.isr.calibType.IsrCalib.readText ( cls,
filename,
** kwargs )
inherited
Read calibration representation from a yaml/ecsv file.

Parameters
----------
filename : `str`
    Name of the file containing the calibration definition.
kwargs : `dict` or collections.abc.Mapping`, optional
    Set of key=value pairs to pass to the ``fromDict`` or
    ``fromTable`` methods.

Returns
-------
calib : `~lsst.ip.isr.IsrCalibType`
    Calibration class.

Raises
------
RuntimeError
    Raised if the filename does not end in ".ecsv" or ".yaml".

Definition at line 418 of file calibType.py.

418 def readText(cls, filename, **kwargs):
419 """Read calibration representation from a yaml/ecsv file.
420
421 Parameters
422 ----------
423 filename : `str`
424 Name of the file containing the calibration definition.
425 kwargs : `dict` or collections.abc.Mapping`, optional
426 Set of key=value pairs to pass to the ``fromDict`` or
427 ``fromTable`` methods.
428
429 Returns
430 -------
431 calib : `~lsst.ip.isr.IsrCalibType`
432 Calibration class.
433
434 Raises
435 ------
436 RuntimeError
437 Raised if the filename does not end in ".ecsv" or ".yaml".
438 """
439 if filename.endswith((".ecsv", ".ECSV")):
440 data = Table.read(filename, format="ascii.ecsv")
441 calibClass = cls.determineCalibClass(data.meta, "readText/ECSV")
442 return calibClass.fromTable([data], **kwargs)
443 elif filename.endswith((".yaml", ".YAML")):
444 with open(filename, "r") as f:
445 data = yaml.load(f, Loader=yaml.CLoader)
446 calibClass = cls.determineCalibClass(data["metadata"], "readText/YAML")
447 return calibClass.fromDict(data, **kwargs)
448 else:
449 raise RuntimeError(f"Unknown filename extension: {filename}")
450

◆ requiredAttributes() [1/2]

lsst.ip.isr.calibType.IsrCalib.requiredAttributes ( self)
inherited

Definition at line 159 of file calibType.py.

159 def requiredAttributes(self):
160 return self._requiredAttributes
161

◆ requiredAttributes() [2/2]

lsst.ip.isr.calibType.IsrCalib.requiredAttributes ( self,
value )
inherited

Definition at line 163 of file calibType.py.

163 def requiredAttributes(self, value):
164 self._requiredAttributes = value
165

◆ setMetadata()

lsst.ip.isr.calibType.IsrCalib.setMetadata ( self,
metadata )
inherited
Store a copy of the supplied metadata with this calibration.

Parameters
----------
metadata : `lsst.daf.base.PropertyList`
    Metadata to associate with the calibration.  Will be copied and
    overwrite existing metadata.

Reimplemented in lsst.ip.isr.transmissionCurve.IntermediateTransmissionCurve.

Definition at line 183 of file calibType.py.

183 def setMetadata(self, metadata):
184 """Store a copy of the supplied metadata with this calibration.
185
186 Parameters
187 ----------
188 metadata : `lsst.daf.base.PropertyList`
189 Metadata to associate with the calibration. Will be copied and
190 overwrite existing metadata.
191 """
192 if metadata is not None:
193 self._metadata.update(metadata)
194
195 # Ensure that we have the obs type required by calibration ingest
196 self._metadata["OBSTYPE"] = self._OBSTYPE
197 self._metadata[self._OBSTYPE + "_SCHEMA"] = self._SCHEMA
198 self._metadata[self._OBSTYPE + "_VERSION"] = self._VERSION
199
200 if isinstance(metadata, dict):
201 self.calibInfoFromDict(metadata)
202 elif isinstance(metadata, PropertyList):
203 self.calibInfoFromDict(metadata.toDict())
204

◆ toDict()

lsst.ip.isr.linearize.Linearizer.toDict ( self)
Return linearity parameters as a dict.

Returns
-------
outDict : `dict`:

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

Definition at line 263 of file linearize.py.

263 def toDict(self):
264 """Return linearity parameters as a dict.
265
266 Returns
267 -------
268 outDict : `dict`:
269 """
270 self.updateMetadata()
271
272 outDict = {'metadata': self.getMetadata(),
273 'detectorName': self._detectorName,
274 'detectorSerial': self._detectorSerial,
275 'detectorId': self._detectorId,
276 'hasTable': self.tableData is not None,
277 'amplifiers': dict(),
278 'linearityUnits': self.linearityUnits,
279 }
280 for ampName in self.linearityType:
281 outDict['amplifiers'][ampName] = {
282 'linearityType': self.linearityType[ampName],
283 'linearityCoeffs': self.linearityCoeffs[ampName].tolist(),
284 'linearityBBox': self.linearityBBox[ampName],
285 'fitParams': self.fitParams[ampName].tolist(),
286 'fitParamsErr': self.fitParamsErr[ampName].tolist(),
287 'fitChiSq': self.fitChiSq[ampName],
288 'fitResiduals': self.fitResiduals[ampName].tolist(),
289 'fitResidualsSigmaMad': self.fitResiduals[ampName],
290 'linearFit': self.linearFit[ampName].tolist(),
291 'linearityTurnoff': self.linearityTurnoff[ampName],
292 'linearityMaxSignal': self.linearityMaxSignal[ampName],
293 }
294 if self.tableData is not None:
295 outDict['tableData'] = self.tableData.tolist()
296
297 return outDict
298

◆ toTable()

lsst.ip.isr.linearize.Linearizer.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` [`astropy.table.Table`]
    List of tables containing the linearity calibration
    information.

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

Definition at line 373 of file linearize.py.

373 def toTable(self):
374 """Construct a list of tables containing the information in this
375 calibration.
376
377 The list of tables should create an identical calibration
378 after being passed to this class's fromTable method.
379
380 Returns
381 -------
382 tableList : `list` [`astropy.table.Table`]
383 List of tables containing the linearity calibration
384 information.
385 """
386
387 tableList = []
388 self.updateMetadata()
389 catalog = Table([{'AMPLIFIER_NAME': ampName,
390 'TYPE': self.linearityType[ampName],
391 'COEFFS': self.linearityCoeffs[ampName],
392 'BBOX_X0': self.linearityBBox[ampName].getMinX(),
393 'BBOX_Y0': self.linearityBBox[ampName].getMinY(),
394 'BBOX_DX': self.linearityBBox[ampName].getWidth(),
395 'BBOX_DY': self.linearityBBox[ampName].getHeight(),
396 'FIT_PARAMS': self.fitParams[ampName],
397 'FIT_PARAMS_ERR': self.fitParamsErr[ampName],
398 'RED_CHI_SQ': self.fitChiSq[ampName],
399 'FIT_RES': self.fitResiduals[ampName],
400 'FIT_RES_SIGMAD': self.fitResidualsSigmaMad[ampName],
401 'LIN_FIT': self.linearFit[ampName],
402 'LINEARITY_TURNOFF': self.linearityTurnoff[ampName],
403 'LINEARITY_MAX_SIGNAL': self.linearityMaxSignal[ampName],
404 } for ampName in self.ampNames])
405 catalog.meta = self.getMetadata().toDict()
406 tableList.append(catalog)
407
408 if self.tableData is not None:
409 catalog = Table([{'LOOKUP_VALUES': value} for value in self.tableData])
410 tableList.append(catalog)
411 return tableList
412

◆ updateMetadata()

lsst.ip.isr.linearize.Linearizer.updateMetadata ( self,
setDate = False,
** kwargs )
Update metadata keywords with new values.

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 149 of file linearize.py.

149 def updateMetadata(self, setDate=False, **kwargs):
150 """Update metadata keywords with new values.
151
152 This calls the base class's method after ensuring the required
153 calibration keywords will be saved.
154
155 Parameters
156 ----------
157 setDate : `bool`, optional
158 Update the CALIBDATE fields in the metadata to the current
159 time. Defaults to False.
160 kwargs :
161 Other keyword parameters to set in the metadata.
162 """
163 kwargs['HAS_LINEARITY'] = self.hasLinearity
164 kwargs['OVERRIDE'] = self.override
165 kwargs['HAS_TABLE'] = self.tableData is not None
166 kwargs['LINEARITY_UNITS'] = self.linearityUnits
167
168 super().updateMetadata(setDate=setDate, **kwargs)
169

◆ updateMetadataFromExposures()

lsst.ip.isr.calibType.IsrCalib.updateMetadataFromExposures ( self,
exposures )
inherited
Extract and unify metadata information.

Parameters
----------
exposures : `list`
    Exposures or other calibrations to scan.

Definition at line 291 of file calibType.py.

291 def updateMetadataFromExposures(self, exposures):
292 """Extract and unify metadata information.
293
294 Parameters
295 ----------
296 exposures : `list`
297 Exposures or other calibrations to scan.
298 """
299 # This list of keywords is the set of header entries that
300 # should be checked and propagated. Not having an entry is
301 # not a failure, as they may not be defined for the exposures
302 # being used.
303 keywords = ["SEQNAME", "SEQFILE", "SEQCKSUM", "ODP", "AP0_RC"]
304 metadata = {}
305
306 for exp in exposures:
307 try:
308 expMeta = exp.getMetadata()
309 except AttributeError:
310 continue
311 for key in keywords:
312 if key in expMeta:
313 if key in metadata:
314 if metadata[key] != expMeta[key]:
315 self.log.warning("Metadata mismatch! Have: %s Found %s",
316 metadata[key], expMeta[key])
317 else:
318 metadata[key] = expMeta[key]
319
320 self.updateMetadata(**metadata, setCalibInfo=True)
321

◆ validate()

lsst.ip.isr.linearize.Linearizer.validate ( self,
detector = None,
amplifier = None )
Validate linearity for a detector/amplifier.

Parameters
----------
detector : `lsst.afw.cameraGeom.Detector`, optional
    Detector to validate, along with its amplifiers.
amplifier : `lsst.afw.cameraGeom.Amplifier`, optional
    Single amplifier to validate.

Raises
------
RuntimeError
    Raised if there is a mismatch in linearity parameters, and
    the cameraGeom parameters are not being overridden.

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

Definition at line 437 of file linearize.py.

437 def validate(self, detector=None, amplifier=None):
438 """Validate linearity for a detector/amplifier.
439
440 Parameters
441 ----------
442 detector : `lsst.afw.cameraGeom.Detector`, optional
443 Detector to validate, along with its amplifiers.
444 amplifier : `lsst.afw.cameraGeom.Amplifier`, optional
445 Single amplifier to validate.
446
447 Raises
448 ------
449 RuntimeError
450 Raised if there is a mismatch in linearity parameters, and
451 the cameraGeom parameters are not being overridden.
452 """
453 amplifiersToCheck = []
454 if detector:
455 if self._detectorName != detector.getName():
456 raise RuntimeError("Detector names don't match: %s != %s" %
457 (self._detectorName, detector.getName()))
458 if int(self._detectorId) != int(detector.getId()):
459 raise RuntimeError("Detector IDs don't match: %s != %s" %
460 (int(self._detectorId), int(detector.getId())))
461 # TODO: DM-38778: This check fails on LATISS due to an
462 # error in the camera configuration.
463 # if self._detectorSerial != detector.getSerial():
464 # raise RuntimeError(
465 # "Detector serial numbers don't match: %s != %s" %
466 # (self._detectorSerial, detector.getSerial()))
467 if len(detector.getAmplifiers()) != len(self.linearityCoeffs.keys()):
468 raise RuntimeError("Detector number of amps = %s does not match saved value %s" %
469 (len(detector.getAmplifiers()),
470 len(self.linearityCoeffs.keys())))
471 amplifiersToCheck.extend(detector.getAmplifiers())
472
473 if amplifier:
474 amplifiersToCheck.extend(amplifier)
475
476 for amp in amplifiersToCheck:
477 ampName = amp.getName()
478 if ampName not in self.linearityCoeffs.keys():
479 raise RuntimeError("Amplifier %s is not in linearity data" %
480 (ampName, ))
481 if amp.getLinearityType() != self.linearityType[ampName]:
482 if self.override:
483 self.log.debug("Overriding amplifier defined linearityType (%s) for %s",
484 self.linearityType[ampName], ampName)
485 else:
486 raise RuntimeError("Amplifier %s type %s does not match saved value %s" %
487 (ampName, amp.getLinearityType(), self.linearityType[ampName]))
488 if (amp.getLinearityCoeffs().shape != self.linearityCoeffs[ampName].shape or not
489 np.allclose(amp.getLinearityCoeffs(), self.linearityCoeffs[ampName], equal_nan=True)):
490 if self.override:
491 self.log.debug("Overriding amplifier defined linearityCoeffs (%s) for %s",
492 self.linearityCoeffs[ampName], ampName)
493 else:
494 raise RuntimeError("Amplifier %s coeffs %s does not match saved value %s" %
495 (ampName, amp.getLinearityCoeffs(), self.linearityCoeffs[ampName]))
496

◆ writeFits()

lsst.ip.isr.calibType.IsrCalib.writeFits ( self,
filename )
inherited
Write calibration data to a FITS file.

Parameters
----------
filename : `str`
    Filename to write data to.

Returns
-------
used : `str`
    The name of the file used to write the data.

Reimplemented in lsst.ip.isr.transmissionCurve.IntermediateTransmissionCurve.

Definition at line 544 of file calibType.py.

544 def writeFits(self, filename):
545 """Write calibration data to a FITS file.
546
547 Parameters
548 ----------
549 filename : `str`
550 Filename to write data to.
551
552 Returns
553 -------
554 used : `str`
555 The name of the file used to write the data.
556 """
557 tableList = self.toTable()
558 with warnings.catch_warnings():
559 warnings.filterwarnings("ignore", category=Warning, module="astropy.io")
560 astropyList = [fits.table_to_hdu(table) for table in tableList]
561 astropyList.insert(0, fits.PrimaryHDU())
562
563 writer = fits.HDUList(astropyList)
564 writer.writeto(filename, overwrite=True)
565 return filename
566

◆ writeText()

lsst.ip.isr.calibType.IsrCalib.writeText ( self,
filename,
format = "auto" )
inherited
Write the calibration data to a text file.

Parameters
----------
filename : `str`
    Name of the file to write.
format : `str`
    Format to write the file as.  Supported values are:
        ``"auto"`` : Determine filetype from filename.
        ``"yaml"`` : Write as yaml.
        ``"ecsv"`` : Write as ecsv.

Returns
-------
used : `str`
    The name of the file used to write the data.  This may
    differ from the input if the format is explicitly chosen.

Raises
------
RuntimeError
    Raised if filename does not end in a known extension, or
    if all information cannot be written.

Notes
-----
The file is written to YAML/ECSV format and will include any
associated metadata.

Definition at line 451 of file calibType.py.

451 def writeText(self, filename, format="auto"):
452 """Write the calibration data to a text file.
453
454 Parameters
455 ----------
456 filename : `str`
457 Name of the file to write.
458 format : `str`
459 Format to write the file as. Supported values are:
460 ``"auto"`` : Determine filetype from filename.
461 ``"yaml"`` : Write as yaml.
462 ``"ecsv"`` : Write as ecsv.
463
464 Returns
465 -------
466 used : `str`
467 The name of the file used to write the data. This may
468 differ from the input if the format is explicitly chosen.
469
470 Raises
471 ------
472 RuntimeError
473 Raised if filename does not end in a known extension, or
474 if all information cannot be written.
475
476 Notes
477 -----
478 The file is written to YAML/ECSV format and will include any
479 associated metadata.
480 """
481 if format == "yaml" or (format == "auto" and filename.lower().endswith((".yaml", ".YAML"))):
482 outDict = self.toDict()
483 path, ext = os.path.splitext(filename)
484 filename = path + ".yaml"
485 with open(filename, "w") as f:
486 yaml.dump(outDict, f)
487 elif format == "ecsv" or (format == "auto" and filename.lower().endswith((".ecsv", ".ECSV"))):
488 tableList = self.toTable()
489 if len(tableList) > 1:
490 # ECSV doesn't support multiple tables per file, so we
491 # can only write the first table.
492 raise RuntimeError(f"Unable to persist {len(tableList)}tables in ECSV format.")
493
494 table = tableList[0]
495 path, ext = os.path.splitext(filename)
496 filename = path + ".ecsv"
497 table.write(filename, format="ascii.ecsv")
498 else:
499 raise RuntimeError(f"Attempt to write to a file {filename} "
500 "that does not end in '.yaml' or '.ecsv'")
501
502 return filename
503

Member Data Documentation

◆ _calibId

str lsst.ip.isr.calibType.IsrCalib._calibId = None
protectedinherited

Definition at line 74 of file calibType.py.

◆ _detectorId

lsst.ip.isr.calibType.IsrCalib._detectorId = None
protectedinherited

Definition at line 72 of file calibType.py.

◆ _detectorName

lsst.ip.isr.calibType.IsrCalib._detectorName = None
protectedinherited

Definition at line 70 of file calibType.py.

◆ _detectorSerial

lsst.ip.isr.calibType.IsrCalib._detectorSerial = None
protectedinherited

Definition at line 71 of file calibType.py.

◆ _filter

lsst.ip.isr.calibType.IsrCalib._filter = None
protectedinherited

Definition at line 73 of file calibType.py.

◆ _instrument

lsst.ip.isr.calibType.IsrCalib._instrument = None
protectedinherited

Definition at line 67 of file calibType.py.

◆ _metadata

lsst.ip.isr.calibType.IsrCalib._metadata = PropertyList()
protectedinherited

Definition at line 78 of file calibType.py.

◆ _OBSTYPE

str lsst.ip.isr.calibType.IsrCalib._OBSTYPE = "generic"
staticprotectedinherited

Definition at line 62 of file calibType.py.

◆ _raftName

lsst.ip.isr.calibType.IsrCalib._raftName = None
protectedinherited

Definition at line 68 of file calibType.py.

◆ _requiredAttributes

lsst.ip.isr.calibType.IsrCalib._requiredAttributes
protectedinherited

Definition at line 113 of file calibType.py.

◆ _SCHEMA

str lsst.ip.isr.calibType.IsrCalib._SCHEMA = "NO SCHEMA"
staticprotectedinherited

Definition at line 63 of file calibType.py.

◆ _seqcksum

lsst.ip.isr.calibType.IsrCalib._seqcksum = None
protectedinherited

Definition at line 77 of file calibType.py.

◆ _seqfile

lsst.ip.isr.calibType.IsrCalib._seqfile = None
protectedinherited

Definition at line 75 of file calibType.py.

◆ _seqname

lsst.ip.isr.calibType.IsrCalib._seqname = None
protectedinherited

Definition at line 76 of file calibType.py.

◆ _slotName

lsst.ip.isr.calibType.IsrCalib._slotName = None
protectedinherited

Definition at line 69 of file calibType.py.

◆ _VERSION

int lsst.ip.isr.calibType.IsrCalib._VERSION = 0
staticprotectedinherited

Definition at line 64 of file calibType.py.

◆ ampNames

lsst.ip.isr.linearize.Linearizer.ampNames = list()

Definition at line 117 of file linearize.py.

◆ fitChiSq

lsst.ip.isr.linearize.Linearizer.fitChiSq = dict()

Definition at line 123 of file linearize.py.

◆ fitParams

lsst.ip.isr.linearize.Linearizer.fitParams = dict()

Definition at line 121 of file linearize.py.

◆ fitParamsErr

lsst.ip.isr.linearize.Linearizer.fitParamsErr = dict()

Definition at line 122 of file linearize.py.

◆ fitResiduals

lsst.ip.isr.linearize.Linearizer.fitResiduals = dict()

Definition at line 124 of file linearize.py.

◆ fitResidualsSigmaMad

lsst.ip.isr.linearize.Linearizer.fitResidualsSigmaMad = dict()

Definition at line 125 of file linearize.py.

◆ hasLinearity

bool lsst.ip.isr.linearize.Linearizer.hasLinearity = False

Definition at line 114 of file linearize.py.

◆ linearFit

lsst.ip.isr.linearize.Linearizer.linearFit = dict()

Definition at line 126 of file linearize.py.

◆ linearityBBox

lsst.ip.isr.linearize.Linearizer.linearityBBox = dict()

Definition at line 120 of file linearize.py.

◆ linearityCoeffs

lsst.ip.isr.linearize.Linearizer.linearityCoeffs = dict()

Definition at line 118 of file linearize.py.

◆ linearityMaxSignal

lsst.ip.isr.linearize.Linearizer.linearityMaxSignal = dict()

Definition at line 128 of file linearize.py.

◆ linearityTurnoff

lsst.ip.isr.linearize.Linearizer.linearityTurnoff = dict()

Definition at line 127 of file linearize.py.

◆ linearityType

lsst.ip.isr.linearize.Linearizer.linearityType = dict()

Definition at line 119 of file linearize.py.

◆ linearityUnits

str lsst.ip.isr.linearize.Linearizer.linearityUnits = 'adu'

Definition at line 139 of file linearize.py.

◆ log

lsst.ip.isr.calibType.IsrCalib.log = log if log else logging.getLogger(__name__)
inherited

Definition at line 94 of file calibType.py.

◆ override

bool lsst.ip.isr.linearize.Linearizer.override = False

Definition at line 115 of file linearize.py.

◆ requiredAttributes

lsst.ip.isr.calibType.IsrCalib.requiredAttributes = set(["_OBSTYPE", "_SCHEMA", "_VERSION"])
inherited

Definition at line 88 of file calibType.py.

◆ tableData

lsst.ip.isr.linearize.Linearizer.tableData = None

Definition at line 129 of file linearize.py.


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