Skip to content

Commit

Permalink
add EXTNAME keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverba137 committed Nov 14, 2017
1 parent f626914 commit d5266ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions py/desisurvey/progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ def get_exposures(self, start=None, stop=None,
# Create the output table.
tileinfo = None
output = astropy.table.Table()
output.meta['EXTNAME'] = 'EXPOSURES'
for name in tile_fields.split(','):
name = name.lower()
if name == 'index':
Expand Down
2 changes: 2 additions & 0 deletions py/desisurvey/test/test_progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def test_get_exposures(self):
p.add_exposure(
tile_id, t0 + i * u.hour, 1e3 * u.s, 0.5, 1.5, 1.1, 1, 0, 0, 0)
explist = p.get_exposures()
self.assertEqual(explist.meta['EXTNAME'], 'EXPOSURES')
self.assertTrue(np.all(np.diff(explist['MJD']) > 0))
explist = p.get_exposures(tile_fields='index', exp_fields='lst')
self.assertTrue(np.all(np.diff(explist['LST']) > 0))
Expand All @@ -121,6 +122,7 @@ def test_get_exposures(self):
explist.write(expfile)
newexp = Table.read(expfile)

self.assertEqual(newexp.meta['EXTNAME'], 'EXPOSURES')
self.assertEqual(explist['PROGRAM'].dtype, newexp['PROGRAM'].dtype)
self.assertEqual(explist['NIGHT'].dtype, newexp['NIGHT'].dtype)
self.assertTrue(np.all(explist['PROGRAM'] == newexp['PROGRAM']))
Expand Down

0 comments on commit d5266ff

Please sign in to comment.