Skip to content

Commit

Permalink
header fixes as noted in issue #457
Browse files Browse the repository at this point in the history
  • Loading branch information
jchiang87 committed Apr 22, 2024
1 parent 59b20ab commit 138f47b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions imsim/ccd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
14 changes: 12 additions & 2 deletions imsim/readout.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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']
Expand All @@ -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']

Expand Down

0 comments on commit 138f47b

Please sign in to comment.