Skip to content

Commit

Permalink
Merge pull request #79 from lsst-camera-dh/u/jchiang/mondiode_and_mas…
Browse files Browse the repository at this point in the history
…k_file_fixes

mondiode and mask file fixes
  • Loading branch information
jchiang87 authored Jul 12, 2019
2 parents e3b4d81 + c4edc98 commit 412c873
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 7 additions & 2 deletions python/lsst/eotest/sensor/flatPairTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,13 @@ def extract_det_response(self, use_exptime):
pd1 = flat1.md.get('MONDIODE')
pd2 = flat2.md.get('MONDIODE')
else:
pd1 = self.mondiode_func(file1, exptime1)
pd2 = self.mondiode_func(file2, exptime2)
try:
pd1 = self.mondiode_func(file1, exptime1)
pd2 = self.mondiode_func(file2, exptime2)
except KeyError as eobj:
self.log.info("KeyError exception computing pd current:\n"
+ str(eobj))
continue

if use_exptime:
flux = exptime1
Expand Down
3 changes: 3 additions & 0 deletions python/lsst/eotest/sensor/generate_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,8 @@ def generate_mask(infile, outfile, mask_plane, pixels=None, columns=None,
mask = afwImage.MaskU(maskedCCD[amp].getDimensions())
fp_set.setMask(mask, mask_plane)
hdus[amp].data = mask.array
# add mask plane keywords
for key, value in mask.getMaskPlaneDict().items():
hdus[amp].header['MP_' + key] = value
hdus.writeto(outfile, overwrite=True)
os.remove(temp_mask_image)

0 comments on commit 412c873

Please sign in to comment.