Skip to content

Commit 9e0aee4

Browse files
committed
Adding CCDNUM to HDU-0 of headers
1 parent 60647ce commit 9e0aee4

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

python/immask/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import os
66

77
__author__ = "Felipe Menanteau, Alex Drlica-Wagner, Eli Rykoff"
8-
__version__ = '3.0.2'
8+
__version__ = '3.0.3'
99
__revision__= '0'
1010
version = __version__
1111

python/immask/immasklib.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,15 @@ def write_streak_objects(self):
837837
outname = os.path.join(self.outdir, outbase)
838838

839839
logging.info("Writing streak objects: %s", outname)
840-
fitsio.write(outname, self.mask_objs, clobber=True)
840+
fits = fitsio.FITS(outname, 'rw', clobber=True)
841+
fits.write(self.mask_objs)
842+
# Make sure that CCDNUM is in the header.
843+
# It's needed for connect_streaks later on
844+
try:
845+
fits[0].write_key('ccdnum', self.image.header['CCDNUM'], comment="CCD number")
846+
except:
847+
logging.info("CCDNUM could be inserted in HDU-0 header")
848+
fits.close()
841849

842850
def write_streak_mask(self):
843851
""" Write out streak mask """
@@ -1824,6 +1832,7 @@ def run(inargs):
18241832
commands = [inargs.command]
18251833
kwargs = vars(inargs)
18261834
image = DESImage.load(inargs.filename)
1835+
18271836
# passing outname into the class
18281837
image.outname = inargs.outname
18291838
if 'all' in commands:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# The main call
55
setup(name='immask',
6-
version ='3.0.2',
6+
version ='3.0.3',
77
license = "GPL",
88
description = "The Image Masking Module for DESDM.",
99
author = "Felipe Menanteau, Alex Drlica-Wagner, Eli Rykoff",

0 commit comments

Comments
 (0)