Skip to content

Commit

Permalink
Merge branch 'u/jchiang/add_version_info' into u/jchiang/disable_read…
Browse files Browse the repository at this point in the history
…_noise_and_bias_option
  • Loading branch information
jchiang87 committed Jul 8, 2019
2 parents b19d587 + d13908d commit 4b3e1f0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/desc/imsim/camera_readout.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
from .camera_info import CameraInfo, getHourAngle
from .imSim import get_logger, get_config, airmass
from .cosmic_rays import CosmicRays
from .version import __version__ as imsim_version

__all__ = ['ImageSource', 'set_itl_bboxes', 'set_e2v_bboxes',
'set_phosim_bboxes', 'set_noao_keywords', 'cte_matrix']
Expand Down Expand Up @@ -475,6 +476,7 @@ def write_fits_file(self, outfile, overwrite=True, run_number=None,
output[0].header.insert(5, ('WCSAXES', wcsaxes, ''))
if run_number is None:
run_number = self.visit
output[0].header['IMSIMVER'] = imsim_version
output[0].header['RUNNUM'] = str(run_number)
output[0].header['DARKTIME'] = output[0].header['EXPTIME']
output[0].header['TIMESYS'] = 'TAI'
Expand Down
Binary file modified tests/data/lsst_e_161899_R22_S11_r.fits.gz
Binary file not shown.
8 changes: 8 additions & 0 deletions tests/test_camera_readout.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ def test_get_amp_image(self):
image = self.image_source.get_amp_image(amp_info_record)
self.assertTupleEqual(image.getArray().shape, (2048, 544))

def test_raw_file_headers(self):
"Test contents of raw file headers."
outfile = 'raw_file_test.fits'
self.image_source.write_fits_file(outfile)
with fits.open(outfile) as hdus:
self.assertEqual(hdus[0].header['IMSIMVER'], desc.imsim.__version__)
os.remove(outfile)


class NoaoKeywordTestCase(unittest.TestCase):
"TestCase class for raft-level NOAO mosaicking keywords"
Expand Down

0 comments on commit 4b3e1f0

Please sign in to comment.