Closed modhurita closed 9 years ago
You guess correctly, you have to use the shape option; it uses the shape of DATA by default. Specify the type of the data for the column via the valuetype option; default is complex.
Anyway, you shouldn't need to add bitflag columns by hand. There's an addbitflagcolumn
utility that'll do it for you.
I think that's taken care of by the shape
argument -- looks like it
will make a vector or matrix column automatically based on that.
However, @SpheMakh: take a look at addtiledmscol --help
. The xxx_DATA
columns can be "tiled" for performance reasons. I don't know if there's a
way to create a tiled column from pyrap, at least there wasn't one at the
time, so I wrote the addtiedmscol utility (in C++) to do this. You might
want to integrate that into addcol() somehow.
On Wed, Dec 24, 2014 at 9:53 AM, Modhurita Mitra notifications@github.com wrote:
@SpheMakh https://github.com/SpheMakh, you might also want to add a vector option to data_desc_type, as the column elements could be scalar, vector, or matrix:
In [12]: t = table('3C147-C-LO.MS') Successful readonly open of default-locked table 3C147-C-LO.MS: 28 columns, 1279516 rows
In [13]: d = t.getcol('WEIGHT_SPECTRUM')
In [14]: d.shape Out[14]: (1279516, 64, 4)
In [15]: d = t.getcol('IMAGING_WEIGHT')
In [16]: d.shape Out[16]: (1279516, 64)
In [17]: d = t.getcol('BITFLAG_ROW')
In [18]: d.shape Out[18]: (1279516,)`
— Reply to this email directly or view it on GitHub https://github.com/ska-sa/pyxis/issues/19#issuecomment-68034332.
For a simulated MS, if I add a BITFLAG_ROW column:
And then do:
I get:
On the other hand, for the 3C147 data:
gives
I guess I am supposed to use the shape parameter of addcol to specify the shape of an element? How do I tell it that each element has to be a scalar?