Skip to content

Commit

Permalink
Fix problems with the crosstalk calibration.
Browse files Browse the repository at this point in the history
- Did not set detectorId from an inherited detector.
- Did not set ERROR, NUM, and VALID fields when inheriting from a detector.
- Look for table names in astropy Table.columns to avoid an annoying warning.
  • Loading branch information
czwa committed Apr 9, 2021
1 parent 2d4bb9b commit 9ff8090
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions python/lsst/ip/isr/crosstalk.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def fromDetector(self, detector, coeffVector=None):
"""
if detector.hasCrosstalk() or coeffVector:
self._detectorId = detector.getId()
self._detectorName = detector.getName()
self._detectorSerial = detector.getSerial()

Expand All @@ -168,7 +169,11 @@ def fromDetector(self, detector, coeffVector=None):
raise RuntimeError("Crosstalk coefficients do not match detector shape. "
f"{self.crosstalkShape} {self.nAmp}")

self.coeffErr = np.zeros(self.crosstalkShape)
self.coeffNum = np.zeros(self.crosstalkShape, dtype=int)
self.coeffValid = np.ones(self.crosstalkShape, dtype=bool)
self.interChip = {}

self.hasCrosstalk = True
self.updateMetadata()
return self
Expand Down Expand Up @@ -334,11 +339,11 @@ def fromTable(cls, tableList):
inDict['nAmp'] = metadata['NAMP']

inDict['coeffs'] = coeffTable['CT_COEFFS']
if 'CT_ERRORS' in coeffTable:
if 'CT_ERRORS' in coeffTable.columns:
inDict['coeffErr'] = coeffTable['CT_ERRORS']
if 'CT_COUNTS' in coeffTable:
if 'CT_COUNTS' in coeffTable.columns:
inDict['coeffNum'] = coeffTable['CT_COUNTS']
if 'CT_VALID' in coeffTable:
if 'CT_VALID' in coeffTable.columns:
inDict['coeffValid'] = coeffTable['CT_VALID']

if len(tableList) > 1:
Expand Down

0 comments on commit 9ff8090

Please sign in to comment.