Skip to content

Commit

Permalink
masked header cards
Browse files Browse the repository at this point in the history
  • Loading branch information
rcooke-ast committed Oct 12, 2024
1 parent 4e10c8b commit e80f42e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pypeit/specobjs.py
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,13 @@ def write_to_fits(self, subheader, outfile, overwrite=True, update_det=None,
for line in str(subheader[key.upper()]).split('\n'):
header[key.upper()] = line
else:
_value = ('', subheader[key][1]) if np.ma.is_masked(subheader[key][0]) else subheader[key]
if isinstance(subheader[key], (tuple, list)):
# value + comment
_value = ('', subheader[key][1]) if np.ma.is_masked(subheader[key][0]) else subheader[key]
else:
# value only
_value = '' if np.ma.is_masked(subheader[key]) else subheader[key]
# Update the header card with the corresponding value
header[key.upper()] = _value
# Also store the datetime in ISOT format
if key.upper() == 'MJD':
Expand Down

0 comments on commit e80f42e

Please sign in to comment.