Skip to content

Commit

Permalink
Fix overscan statistics units in metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Broughton committed Oct 10, 2024
1 parent f1323ff commit 57d4a08
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion python/lsst/ip/isr/isrTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -2274,7 +2274,9 @@ def overscanCorrection(self, ccdExposure, amp):
ampName = amp.getName()

keyBase = "LSST ISR OVERSCAN"
metadata[f"{keyBase} UNITS {amp.getName()}"] = "adu"
# The overscan statistics units will always match the units of
# the image at the point they are calculated.
metadata[f"{keyBase} UNITS"] = metadata["LSST ISR UNITS"]
# Updated quantities
if isinstance(overscanResults.overscanMean, float):
# Serial overscan correction only:
Expand Down
9 changes: 6 additions & 3 deletions python/lsst/ip/isr/isrTaskLSST.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,9 +888,12 @@ def overscanCorrection(self, mode, detectorConfig, detector, badAmpDict, ccdExpo

metadata = ccdExposure.metadata
keyBase = "LSST ISR OVERSCAN"
# The overscan is always in adu, and we will make this
# explicitly clear
metadata[f"{keyBase} UNITS"] = "adu"

# The overscan is always in adu for the serial mode, but it may be electron

Check failure on line 892 in python/lsst/ip/isr/isrTaskLSST.py

View workflow job for this annotation

GitHub Actions / call-workflow / lint

W505

doc line too long (95 > 79 characters)
# in the parallel mode if doApplyGains==True. If doApplyGains==True, then

Check failure on line 893 in python/lsst/ip/isr/isrTaskLSST.py

View workflow job for this annotation

GitHub Actions / call-workflow / lint

W505

doc line too long (93 > 79 characters)
# the gains are applied to the untrimmed image, so the overscan statistics

Check failure on line 894 in python/lsst/ip/isr/isrTaskLSST.py

View workflow job for this annotation

GitHub Actions / call-workflow / lint

W505

doc line too long (94 > 79 characters)
# units here will always match the units of the image at this point.

Check failure on line 895 in python/lsst/ip/isr/isrTaskLSST.py

View workflow job for this annotation

GitHub Actions / call-workflow / lint

W505

doc line too long (88 > 79 characters)
metadata[f"{keyBase} {mode} UNITS"] = ccdExposure.metadata["LSST ISR UNITS"]
metadata[f"{keyBase} {mode} MEAN {ampName}"] = results.overscanMean
metadata[f"{keyBase} {mode} MEDIAN {ampName}"] = results.overscanMedian
metadata[f"{keyBase} {mode} STDEV {ampName}"] = results.overscanSigma
Expand Down

0 comments on commit 57d4a08

Please sign in to comment.