Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xds_from_table #153

Open
hrkloeck opened this issue Mar 19, 2021 · 3 comments
Open

xds_from_table #153

hrkloeck opened this issue Mar 19, 2021 · 3 comments

Comments

@hrkloeck
Copy link

Hi there, I'm just starting to play with daskms and I run into an error if I do the following (if I use e.g. FIELD that works). I'm currently working on a multi-source MS dataset.

xds_from_table(MSFN+'::SOURCE',group_cols='row')

ValueError: No known conversion from CASA Table type 'record' to python/numpy type. Perhaps it needs to be added to _TABLE_TO_PY?:
{'BOOL': 'bool',
'BOOLEAN': 'bool',
'BYTE': 'uint8',
'COMPLEX': 'complex64',
'DCOMPLEX': 'complex128',
'DOUBLE': 'float64',
'FCOMPLEX': 'complex64',
'FLOAT': 'float32',
'INT': 'int32',
'INTEGER': 'int32',
'SHORT': 'int16',
'SMALLINT': 'int16',
'STRING': 'object',
'UCHAR': 'uint8',
'UINT': 'uint32',
'UINTEGER': 'uint32',
'USHORT': 'uint16',
'USMALLINT': 'uint16'}

@sjperkins
Copy link
Member

Hi there, I'm just starting to play with daskms and I run into an error if I do the following (if I use e.g. FIELD that works). I'm currently working on a multi-source MS dataset.

xds_from_table(MSFN+'::SOURCE',group_cols='row')

ValueError: No known conversion from CASA Table type 'record' to python/numpy type. Perhaps it needs to be added to _TABLE_TO_PY?:
{'BOOL': 'bool',
'BOOLEAN': 'bool',
'BYTE': 'uint8',
'COMPLEX': 'complex64',
'DCOMPLEX': 'complex128',
'DOUBLE': 'float64',
'FCOMPLEX': 'complex64',
'FLOAT': 'float32',
'INT': 'int32',
'INTEGER': 'int32',
'SHORT': 'int16',
'SMALLINT': 'int16',
'STRING': 'object',
'UCHAR': 'uint8',
'UINT': 'uint32',
'UINTEGER': 'uint32',
'USHORT': 'uint16',
'USMALLINT': 'uint16'}

Thanks for the report @hrkloeck. I note that the in the definition of the SOURCE table, the optional SOURCE_MODEL column has a TableRecord type. I've never encountered an MS with this type of data in it, but it is still a valid case. dask-ms attempts to reproduce CASA columns as dask arrays and TableRecords are dictionaries, so some thought would be required to support this edge case.

Questions:

  1. Does your SOURCE table have a SOURCE_MODEL column in it?
  2. Do you need to access this column?
  3. If not, could you specify only the columns you are interested in via the columns keyword argument?

Does (3) solve your problem?

@hrkloeck
Copy link
Author

hrkloeck commented Mar 19, 2021 via email

@sjperkins
Copy link
Member

Hi Simon, thank’s for coming back. Q1: I don’t know I need to check (via CASA I guess) Q2: Not necessary yet, but maybe in the future. I just have started the dask-ms and CASA-MS endeavour, coming from AIPS and ParselTongue. Q3: ddids,cckey = xds_from_table(MSFN+'::SOURCE',column_keywords=True) have tried this but get the same error.

Ah should have mentioned the docs, I meant something like:

xds_from_table("BLAH.MS::SOURCE", columns=["TIME", "INTERVAL", "NAME", "CODE"])

So I guess there is no urgency to this, currently my first approach is to extract the information out of the data to get a first understanding and how that all works. However since the MS definition https://casa.nrao.edu/casadocs/casa-5.1.1/reference-material/measurement-set https://casa.nrao.edu/casadocs/casa-5.1.1/reference-material/measurement-set mentioned the SOURCE table I thought to be consistent it might be useful to raise it.

Yes, this is definitely something to keep track of, so I'll keep this issue open for now. I would bump the priority if the SOURCE_MODEL column was important to a number of people.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants