radio-astro-tools / casa-formats-io

Code to handle I/O from/to data in CASA format
Other
10 stars 7 forks source link

Missing `data_managers[0]` #29

Open keflavich opened 3 years ago

keflavich commented 3 years ago
In [9]: getdminfo('/orange/adamginsburg/ALMA_IMF/2017.1.01355.L/G353.41_B6_uid___A001_X1296_X1c9_continuum_merged_12M_selfcal.ms')
/blue/adamginsburg/adamginsburg/repos/casa-formats-io/casa_formats_io/casa_low_level_io/core.py:95: UserWarning: Endianness of IncrementalStMan did not match endianness of filehandle, correcting
  warnings.warn(f'Endianness of {name} did not match endianness of file'
/blue/adamginsburg/adamginsburg/repos/casa-formats-io/casa_formats_io/casa_low_level_io/core.py:95: UserWarning: Endianness of StandardStMan did not match endianness of filehandle, correcting
  warnings.warn(f'Endianness of {name} did not match endianness of file'
Traceback (most recent call last):
  File "<ipython-input-9-46e18ecad44f>", line 1, in <module>
    getdminfo('/orange/adamginsburg/ALMA_IMF/2017.1.01355.L/G353.41_B6_uid___A001_X1296_X1c9_continuum_merged_12M_selfcal.ms')
  File "/blue/adamginsburg/adamginsburg/repos/casa-formats-io/casa_formats_io/casa_low_level_io/casa_functions.py", line 18, in getdminfo
    dm = colset.data_managers[0]
KeyError: 0

MS file is here: https://data.rc.ufl.edu/pub/adamginsburg/ALMA-IMF/debug/debug_ms.tar.gz

Possible fix:

    keys = list(colset.data_managers.keys())
    dm = colset.data_managers[keys[0]]