From 138f47bdab4347d4b4c83fdc79e4bfdd43c76f0f Mon Sep 17 00:00:00 2001 From: James Chiang Date: Sun, 21 Apr 2024 18:29:59 -0700 Subject: [PATCH] header fixes as noted in issue #457 --- imsim/ccd.py | 2 ++ imsim/readout.py | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/imsim/ccd.py b/imsim/ccd.py index 6f0de38e..c4b73a94 100644 --- a/imsim/ccd.py +++ b/imsim/ccd.py @@ -192,6 +192,8 @@ def parse(item, type, default): image.header['AMSTART'] = airmass image.header['AMEND'] = airmass # wrong, does anyone care? image.header['FOCUSZ'] = parse('focusZ', float, 0.0) + image.header['ALTITUDE'] = parse('altitude', float, None) + image.header['AZIMUTH'] = parse('azimuth', float, None) # If there's anything left in header_vals, add it to the header. for k in header_vals: diff --git a/imsim/readout.py b/imsim/readout.py index f38c25a1..7e7b7c9d 100644 --- a/imsim/readout.py +++ b/imsim/readout.py @@ -270,7 +270,6 @@ def get_primary_hdu(eimage, lsst_num, camera_name=None, telcode = 'MC' elif camera_name == 'LsstComCamSim' : phdu.header['FILTER'] = ComCam_filter_map.get(band, None) - phdu.header['TELESCOP'] = SIMONYI_TELESCOPE phdu.header['INSTRUME'] = 'ComCamSim' phdu.header['RAFTBAY'] = raft phdu.header['CCDSLOT'] = sensor @@ -287,10 +286,21 @@ def get_primary_hdu(eimage, lsst_num, camera_name=None, phdu.header['RA'] = ratel phdu.header['DEC'] = dectel phdu.header['ROTCOORD'] = 'sky' + phdu.header['ROTPA'] = rotang telcode = 'MC' dayobs = eimage.header['DAYOBS'] seqnum = eimage.header['SEQNUM'] contrllr = eimage.header['CONTRLLR'] + phdu.header['TELESCOP'] = SIMONYI_TELESCOPE + phdu.header['RASTART'] = ratel + phdu.header['DECSTART'] = dectel + phdu.header['ELSTART'] = eimage.header['ALTITUDE'] + phdu.header['AZSTART'] = eimage.header['AZIMUTH'] + if eimage.header['IMGTYPE'] == 'SKYEXP': + phdu.header['RADESYS'] = 'ICRS' + phdu.header['TRACKSYS'] = 'RADEC' + else: + phdu.header['TRACKSYS'] = 'LOCAL' phdu.header['OBSID'] = f"{telcode}_{contrllr}_{dayobs}_{seqnum:06d}" phdu.header['MJD-OBS'] = mjd_obs phdu.header['HASTART'] = eimage.header['HASTART'] @@ -301,7 +311,7 @@ def get_primary_hdu(eimage, lsst_num, camera_name=None, phdu.header['AMEND'] = eimage.header['AMEND'] phdu.header['IMSIMVER'] = __version__ phdu.header['PKG00000'] = 'throughputs' - phdu.header['VER00000'] = '1.4' + phdu.header['VER00000'] = '1.9' phdu.header['CHIPID'] = det_name phdu.header['FOCUSZ'] = eimage.header['FOCUSZ']