-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add methods for creating a default MS #72
Conversation
Added two methods for creating canonical MeasurementSets - pyrap.tables.default_ms(name, table_description) - pyrap.tables.msutils.required_ms_desc(table)
Still a WIP, I'll request a review when I'm ready. Depends on casacore/casacore#559. |
default_ms_subtable("ANTENNA") will create an ANTENNA subtable, for example. Additional table descriptions can be added by calling default_ms_subtable("ANTENNA", {...}) for example.
56554f8
to
468a124
Compare
@ludwigschwardt @o-smirnov @brentjens. Can you think of anything other simple things that would be useful here? |
The following Dockerfile allows one to play with the new functionality
|
Empty HCcoordnames and HCidnames list aren't accepted by casacore, strip them out of hypercolumn definitions so that the table description can be reused when creating a table.
makedminfo infers the basic data manager outline from a tabledesc and allows the user to supply SPEC dictionary entries for a Data Manager group. In practice, this allows the user to set the following on Tiled Storage Managers - DEFAULTTILESIZE - MAXIMUMCACHESIZE where DEFAULTTILESIZE is likely most useful.
don't merge this yet please |
Still adding some testcases |
dd47ecb
to
7378080
Compare
I'd like a review on this PR please. |
Hmmm test build failures. This isn't going to build against casacore until casacore/casacore#559 makes it into an official release. Guess we'll have to wait until then I've done a fair amount of testing with in ska-sa/katdal#75 to test this works and am using it in production. I'm away until late March, can pick this up again then. |
I've found an interesting issue related to this PR that I'd like input on resolving. The MeasurementSet class has an addCat method that adds the CATEGORY keyword to the FLAG_CATEGORY column of an MS if it does not exist. It has type Vector<String>, but zero length. Now, in the functionality added in this PR, this MS column description gets translated into the python column description as: 'FLAG_CATEGORY': {'_c_order': True,
'comment': 'The flag category, NUM_CAT flags for each datum',
'dataManagerGroup': 'FlagCategory',
'dataManagerType': 'TiledColumnStMan',
'keywords': {'CATEGORY': []},
'maxlen': 0,
'ndim': 3,
'option': 0,
'options': 4,
'shape': [1, 767, 4],
'valueType': 'boolean'}, If this column description then gets inserted back into the C++ layer, the CATEGORY keyword is converted into a Vector of some other type, which (much later) results in this kind of exception:
I can think of 3 options here:
I've test (2) and (3) and confirm they solve the |
It automatically gets add in the C++ ms layer. See casacore/python-casacore#72 (comment) for more information.
It automatically gets add in the C++ ms layer. See casacore/python-casacore#72 (comment) for more information.
That just happened in casacore 2.3.0. Given that; I'd prefer any solution that doesn't involve changing casacore. |
Remove the keyword from the column description. This empty Vector<String> gets converted to a python dictionary as 'FLAG_CATEGORY' : { ... keywords': {'CATEGORY' : []}, ... } Due to the missing type information this gets converted into something like Vector<int> when passed back to the C++ layer, which results in Table Conformance errors. This is a reasonable solution since the C++ layer always adds this keyword if it is missing from the MS (see addCat())
@tammojan OK, I've pushed a fix into this branch. Tests run against casacore master branch. |
@tammojan We've done an imaging run with these changes and it worked well. From my side, I'm happy for this to be merged. |
Added three methods for creating canonical MeasurementSets and their subtables.
pyrap.tables.default_ms(name, tabdesc)
. This creates an MS called 'name' and associated subtables. Extra columns, hypercolumns and keywords can be specified in tabdesc which will overwrite/merge into the standard definition for the MS.pyrap.tables.default_ms_subtable(subtable, tabdesc)
. This creates an MS subtable. For e.g.default_ms_subtable("ANTENNA")
will created an ANTENNA subtable. Extra columns, hypercolumns and keywords can be specified in tabdesc which will overwrite/merge into the standard definition for the subtable.pyrap.tables.msutils.required_ms_desc(table)
. Returns a dictionary table description for the specified table.required_ms_desc("MAIN")
will return a description for a Measurement Set, whilerequired_ms_desc("ANTENNA")
will return a description for the ANTENNA subtable.