diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 187d95b4c..b2b45b998 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -59,7 +59,7 @@ jobs: python-version: 3.9 name: Py3.9 all dev toxenv: py39-test-viz-noviz-docs-dev - - os: ubuntu-18.04 + - os: ubuntu-latest python-version: 3.8 name: Py3.8 mindeps and CASA toxenv: py38-test-casa diff --git a/CHANGES.rst b/CHANGES.rst index 5f368b1a6..49e20fdb5 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,6 @@ 0.6.3.dev (unreleased) ---------------------- -- none yet +- Find beam table from EXT name and CI fix #879 0.6.2 (2023-06-23) ------------------ diff --git a/spectral_cube/conftest.py b/spectral_cube/conftest.py index 59fb59b68..0d7c158bf 100644 --- a/spectral_cube/conftest.py +++ b/spectral_cube/conftest.py @@ -69,7 +69,7 @@ def prepare_4_beams(): beams['BPA'] = [0,45,60,30] # degrees beams['CHAN'] = [0,1,2,3] beams['POL'] = [0,0,0,0] - beams = fits.BinTableHDU(beams) + beams = fits.BinTableHDU(beams, name='BEAMS') beams.header['TTYPE1'] = 'BMAJ' beams.header['TUNIT1'] = 'arcsec' @@ -100,7 +100,7 @@ def prepare_4_beams_withfullpol(): beams['POL'] = pol_codes - beams = fits.BinTableHDU(beams) + beams = fits.BinTableHDU(beams, name='BEAMS') beams.header['TTYPE1'] = 'BMAJ' beams.header['TUNIT1'] = 'arcsec' @@ -490,7 +490,7 @@ def prepare_5_beams(): beams['BPA'] = [0,45,60,30,0] # degrees beams['CHAN'] = [0,1,2,3,4] beams['POL'] = [0,0,0,0,0] - beams = fits.BinTableHDU(beams) + beams = fits.BinTableHDU(beams, name='BEAMS') beams.header['TTYPE1'] = 'BMAJ' beams.header['TUNIT1'] = 'arcsec' beams.header['TTYPE2'] = 'BMIN' @@ -576,7 +576,7 @@ def prepare_5_beams_with_pixscale(pixel_scale): beams['BPA'] = [0,45,60,30,0] # degrees beams['CHAN'] = [0,1,2,3,4] beams['POL'] = [0,0,0,0,0] - beams = fits.BinTableHDU(beams) + beams = fits.BinTableHDU(beams, name='BEAMS') beams.header['TTYPE1'] = 'BMAJ' beams.header['TUNIT1'] = 'arcsec' diff --git a/spectral_cube/io/fits.py b/spectral_cube/io/fits.py index 934534719..23daf0249 100644 --- a/spectral_cube/io/fits.py +++ b/spectral_cube/io/fits.py @@ -96,7 +96,8 @@ def read_data_fits(input, hdu=None, mode='denywrite', **kwargs): if isinstance(hdu_item, (fits.PrimaryHDU, fits.ImageHDU)): arrays[ihdu] = hdu_item elif isinstance(hdu_item, fits.BinTableHDU): - if 'BPA' in hdu_item.data.names: + # Check for CASA-standard beam table + if hdu_item.header.get('EXTNAME') == 'BEAMS': beam_table = hdu_item.data # Check that the table has the expected form for beam units: