Skip to content

Commit

Permalink
Change EXTNAME keyword in extension 1 header from 'SCIENCE' to 'SCI' (#…
Browse files Browse the repository at this point in the history
…24)

Move S_REGION keyword from primary header to extension 1 header
Fix error in testing code
  • Loading branch information
stscirij authored Oct 23, 2023
1 parent ff06a19 commit 97aaad5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions hasp/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
from astropy.io import fits
from astropy.time import Time

import hasp

from ullyses.coadd import COSSegmentList, STISSegmentList, CCDSegmentList
from ullyses.coadd import SegmentList, Segment

Expand Down Expand Up @@ -198,7 +200,7 @@ def write(self, filename, overwrite=False, level=""):

# set up the header
hdr1 = fits.Header()
hdr1['EXTNAME'] = ('SCIENCE', 'Spectrum science arrays')
hdr1['EXTNAME'] = ('SCI', 'Spectrum science arrays')
hdr1['TIMESYS'] = ('UTC', 'Time system in use')
hdr1['TIMEUNIT'] = ('s', 'Time unit for durations')
hdr1['TREFPOS'] = ('GEOCENTER', 'Time reference position')
Expand All @@ -215,6 +217,7 @@ def write(self, filename, overwrite=False, level=""):
hdr1['MJD-BEG'] = (mjd_beg, 'MJD of first exposure start')
hdr1['MJD-END'] = (mjd_end, 'MJD of last exposure end')
hdr1['XPOSURE'] = (self.combine_keys("exptime", "sum"), '[s] Sum of exposure durations')
hdr1['S_REGION'] = (self.obs_footprint(), 'Region footprint')

# set up the table columns
nelements = len(self.output_wavelength)
Expand Down Expand Up @@ -263,7 +266,6 @@ def write(self, filename, overwrite=False, level=""):
hdr0['CENWAVE'] = (self.combine_keys("cenwave", "multi"), 'Central wavelength setting for disperser')
hdr0['SPORDER'] = (1, 'Spectral order')
hdr0['APERTURE'] = (','.join(self.aperturelist), 'Identifier(s) of entrance aperture')
hdr0['S_REGION'] = (self.obs_footprint(), 'Region footprint')
hdr0['OBSMODE'] = (self.combine_keys("obsmode", "multi"), 'Instrument operating mode (ACCUM | TIME-TAG)')
hdr0['TARGNAME'] = self.target
hdr0.add_blank(after='OBSMODE')
Expand Down Expand Up @@ -512,6 +514,7 @@ def main(indir, outdir, clobber=False, threshold=-50, snrmax=20, no_keyword_filt
# (target, instrument, grating, detector, visit)
# For single program products, the mode is
# (target, instrument, grating, detector)
print(f'HASP version {hasp.__version__}')
uniqmodes = []
uniqvisitmodes = []
uniqproposalmodes = []
Expand Down
2 changes: 1 addition & 1 deletion tests/test_swrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def compare_outputs(self, program):
fitsdiff_report = ''
keywords_to_ignore = ['DATE', 'FITS_SW', 'FILENAME',
'HLSP_VER', 'S_REGION']
new_hlsps = glob.glob(program + '/input/hst_')
new_hlsps = glob.glob(program + '/input/hst_*')
for new_product in new_hlsps:
truth_filename = self.get_truth_filename(program, new_product)
fdiff = FITSDiff(new_product, truth_filename,
Expand Down

0 comments on commit 97aaad5

Please sign in to comment.