radio-astro-tools / spectral-cube

Library for reading and analyzing astrophysical spectral data cubes
http://spectral-cube.rtfd.org
BSD 3-Clause "New" or "Revised" License
98 stars 65 forks source link

CASA Beamtable is not properly identified #878

Closed AlecThomson closed 1 year ago

AlecThomson commented 1 year ago

Hi all,

I've just found that SpectralCube does not respect the definition (which is hard to find) of CASA beamtables. These tables require that in the primary header

CASAMBM =                    T / CASA Multiple beams table present              

and in the beamtable extension that

EXTNAME = 'BEAMS   '           / name of this binary table extension  

Currently, spectral-cube identifies a beam table by looking for a BPA column, vis:

https://github.com/radio-astro-tools/spectral-cube/blob/4793c278def736fec8cc20a47ddfbf8ef0940806/spectral_cube/io/fits.py#L99

This can, of course, pick up any old table with BPA - which may not be a proper beamtable!

The fix should be as simple as looking for the correct EXTNAME. I'll open a simple PR with this fix

e-koch commented 1 year ago

Fixed in #879