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-42732: Add missing bias shift data #310

Merged
merged 4 commits into from
Feb 22, 2024
Merged
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
32 changes: 16 additions & 16 deletions python/lsst/ip/isr/isrStatistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,12 +780,9 @@ def measureAmpCorrelations(self, inputExp, overscanResults):
Based on eo_pipe implementation:
https://github.com/lsst-camera-dh/eo_pipe/blob/main/python/lsst/eo/pipe/raft_level_correlations.py # noqa: E501 W505
"""
outputStats = {}

detector = inputExp.getDetector()
rows = []

serialOSCorr = np.empty((len(detector), len(detector)))
imageCorr = np.empty((len(detector), len(detector)))
for ampId, overscan in enumerate(overscanResults):
rawOverscan = overscan.overscanImage.image.array + overscan.overscanFit
rawOverscan = rawOverscan.ravel()
Expand All @@ -794,25 +791,28 @@ def measureAmpCorrelations(self, inputExp, overscanResults):
ampImage = ampImage.image.array.ravel()

for ampId2, overscan2 in enumerate(overscanResults):

if ampId2 == ampId:
serialOSCorr[ampId, ampId2] = 1.0
imageCorr[ampId, ampId2] = 1.0
else:
osC = 1.0
imC = 1.0
if ampId2 != ampId:
rawOverscan2 = overscan2.overscanImage.image.array + overscan2.overscanFit
rawOverscan2 = rawOverscan2.ravel()

serialOSCorr[ampId, ampId2] = np.corrcoef(rawOverscan, rawOverscan2)[0, 1]
osC = np.corrcoef(rawOverscan, rawOverscan2)[0, 1]

ampImage2 = inputExp[detector[ampId2].getBBox()]
ampImage2 = ampImage2.image.array.ravel()

imageCorr[ampId, ampId2] = np.corrcoef(ampImage, ampImage2)[0, 1]

outputStats["OVERSCAN_CORR"] = serialOSCorr.tolist()
outputStats["IMAGE_CORR"] = imageCorr.tolist()

return outputStats
imC = np.corrcoef(ampImage, ampImage2)[0, 1]
rows.append(
{'detector': detector.getId(),
'detectorComp': detector.getId(),
'ampName': detector[ampId].getName(),
'ampComp': detector[ampId2].getName(),
'imageCorr': float(imC),
'overscanCorr': float(osC),
}
)
return rows

def measureDivisaderoStatistics(self, inputExp, **kwargs):
"""Measure Max Divisadero Tearing effect per amp.
Expand Down