radio-astro-tools / casa-formats-io

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

Tables should parse XML #31

Open keflavich opened 3 years ago

keflavich commented 3 years ago
>>> tbl = Table.read('/orange/adamginsburg/ALMA_IMF/2017.1.01355.L/G353.41_B6_uid___A001_X1296_X1c9_continuum_merged_12M_selfcal.ms/ASDM_SBSUMMARY')
>>> tbl.as_astropy_tables()

[<Table length=1>
 sBSummaryId                                                   sbSummaryUID                                                                                                     projectUID                                                    ... centerDirectionCode centerDirectionEquinox
   bytes11                                                       bytes111                                                                                                        bytes112                                                     ...        bytes4              float64
 ----------- --------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------- ... ------------------- ----------------------
 SBSummary_0 <EntityRef entityId="uid://A001/X1296/Xe4" partId="X00000000" entityTypeName="SchedBlock" documentVersion="1"/> <EntityRef entityId="uid://A001/X1220/Xdd9" partId="X00000000" entityTypeName="ObsProject" documentVersion="1"/> ...                ICRS         4453444735.816]

Those individual entries under, e.g., sbSummaryUID should be parsed into something more human-readable. I'm not actually sure what they're supposed to return, though - we probably have to do some research into the spec to figure this out.

For example:

>>> tbl.as_astropy_tables()[0]['obsUnitSetUID'][0]
'<EntityRef entityId="uid://A001/X1220/Xdd9" partId="X00000000" entityTypeName="ObsProject" documentVersion="1"/>'

I'd likely expect that to return instead just "uid://A001/X1220/Xdd9"

astrofrog commented 3 years ago

What does the CASA table browser show?