Skip to content

Commit

Permalink
Merge pull request #7 from lsst/tickets/DM-4322
Browse files Browse the repository at this point in the history
fix cfhtIsrTask in order to handle situations where the RDNOISEA/B va…
  • Loading branch information
boutigny committed Nov 12, 2015
2 parents 5d86c55 + ef4dc8f commit 74d64f1
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions python/lsst/obs/cfht/cfhtIsrTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,20 @@ def run(self, ccdExposure, bias=None, dark=None, flat=None, defects=None, fring
amp.setSaturation(saturate)
if amp.getName() == "A":
amp.setGain(metadata.get("GAINA"))
amp.setReadNoise(metadata.get("RDNOISEA"))
rdnA = metadata.get("RDNOISEA")
# Check if the noise value is making sense for this amp. If not, replace with value stored in RDNOISE slot
# this change is necessary to process some old CFHT images (visit : 7xxxxx) where RDNOISEA/B = 65535
if rdnA > 60000.0 :
rdnA = metadata.get("RDNOISE")
amp.setReadNoise(rdnA)
elif amp.getName() == "B":
amp.setGain(metadata.get("GAINB"))
amp.setReadNoise(metadata.get("RDNOISEB"))
rdnB = metadata.get("RDNOISEB")
# Check if the noise value is making sense for this amp. If not, replace with value stored in RDNOISE slot
# this change is necessary to process some old CFHT images (visit : 7xxxxx) where RDNOISEA/B = 65535
if rdnB > 60000.0 :
rdnB = metadata.get("RDNOISE")
amp.setReadNoise(rdnB)
else :
raise ValueError("Unexpected amplifier name : %s"%(amp.getName()))

Expand All @@ -70,4 +80,4 @@ def run(self, ccdExposure, bias=None, dark=None, flat=None, defects=None, fring
flat = flat,
defects = defects,
fringes = fringes,
)
)

0 comments on commit 74d64f1

Please sign in to comment.