Skip to content

Commit

Permalink
support reading ASCII tables when opening FITS files with astrodata
Browse files Browse the repository at this point in the history
  • Loading branch information
phirstgemini committed Jul 28, 2023
1 parent c24f330 commit de137fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion astrodata/fits.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def add_header_to_table(table):


def _process_table(table, name=None, header=None):
if isinstance(table, BinTableHDU):
if isinstance(table, (BinTableHDU, TableHDU)):
obj = Table(table.data, meta={'header': header or table.header})
for i, col in enumerate(obj.columns, start=1):
try:
Expand Down
6 changes: 3 additions & 3 deletions astrodata/tests/test_fits.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,10 +453,10 @@ def test_from_hdulist3():
),
])

with pytest.warns(UserWarning, match='Discarding ASCIITAB'):
ad = astrodata.open(hdul)
ad = astrodata.open(hdul)

assert len(ad) == 1
assert hasattr(ad, 'ASCIITAB')
assert len(ad.ASCIITAB) == 2


def test_can_make_and_write_ad_object(tmpdir):
Expand Down

0 comments on commit de137fa

Please sign in to comment.