Skip to content

Commit

Permalink
Merge pull request #355 from lsst/tickets/DM-46925
Browse files Browse the repository at this point in the history
DM-46925: Fix fitGains on load when stored incorrectly.
  • Loading branch information
erykoff authored Oct 17, 2024
2 parents 261e0ae + 15db866 commit 9234546
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions python/lsst/ip/isr/crosstalk.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,16 @@ def fromDict(cls, dictionary):
else:
calib.ampGainRatios = np.zeros_like(calib.coeffs)
if 'fitGains' in dictionary:
calib.fitGains = np.array(dictionary['fitGains']).reshape(calib.nAmp)
# Compatibility for matrices that were stored with fitGains
# of length 1.
fitGains = np.array(dictionary['fitGains'])
if len(fitGains) == 1:
# Expand to the correct number of amps, all zero (unknown).
calib.fitGains = np.zeros(calib.nAmp)
else:
calib.fitGains = np.array(dictionary['fitGains']).reshape(calib.nAmp)
else:
calib.fitGains = np.zeros_like(calib.nAmp)
calib.fitGains = np.zeros(calib.nAmp)

calib.interChip = dictionary.get('interChip', None)
if calib.interChip:
Expand Down

0 comments on commit 9234546

Please sign in to comment.