[AstroPy] How to append to a astropy.io.votable

JJ Kavelaars jjk at uvic.ca
Tue Apr 16 17:43:10 EDT 2013


Hi,

i've been using atpy for VOTable manipulation and I'm working to switch to astropy.io.votable.

I don't see how 'add_column' to a table object? 

et.

>>> from astropy.io.votable import parse
>>> from astropy.io.votable.tree import Field

>>> t = parse('filename.vot').get_first_table()
>>> t.fields.append(Field(t,name='newColumn',datatype='int'))
>>> print t.array['newColumn']
ERROR: ValueError: field named newColumn not found. [numpy.ma.core]

??? 

I'd like to add a column to t where that column contains a computed value based on one of t's other columns. 


Hints appreciated.

JJ

--





More information about the AstroPy mailing list