Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-37819: Fix crosstalk measurement issues #270

Merged
merged 2 commits into from
Jun 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions python/lsst/ip/isr/crosstalk.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,15 +551,15 @@ def subtractCrosstalk(self, thisExposure, sourceExposure=None, crosstalkCoeffs=N
subtrahend.set((0, 0, 0))

coeffs = coeffs.transpose()
for ii, iAmp in enumerate(sourceDetector):
iImage = subtrahend[iAmp.getBBox() if isTrimmed else iAmp.getRawDataBBox()]
for jj, jAmp in enumerate(detector):
if coeffs[ii, jj] == 0.0:
for ss, sAmp in enumerate(sourceDetector):
sImage = subtrahend[sAmp.getBBox() if isTrimmed else sAmp.getRawDataBBox()]
for tt, tAmp in enumerate(detector):
if coeffs[ss, tt] == 0.0:
continue
jImage = self.extractAmp(mi, jAmp, iAmp, isTrimmed)
jImage.getMask().getArray()[:] &= crosstalk # Remove all other masks
jImage -= backgrounds[jj]
iImage.scaledPlus(coeffs[ii, jj], jImage)
tImage = self.extractAmp(mi, tAmp, sAmp, isTrimmed)
tImage.getMask().getArray()[:] &= crosstalk # Remove all other masks
tImage -= backgrounds[tt]
sImage.scaledPlus(coeffs[ss, tt], tImage)

# Set crosstalkStr bit only for those pixels that have been
# significantly modified (i.e., those masked as such in 'subtrahend'),
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/ip/isr/isrMock.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ def makeImage(self):
if self.config.isTrimmed else ampT.getRawDataBBox()]
outAmp = ctCalib.extractAmp(exposure.getImage(), ampS, ampT,
isTrimmed=self.config.isTrimmed)
self.amplifierAddCT(outAmp, ampDataT, self.crosstalkCoeffs[idxT][idxS])
self.amplifierAddCT(outAmp, ampDataT, self.crosstalkCoeffs[idxS][idxT])

for amp in exposure.getDetector():
bbox = None
Expand Down