Table

class astropy.io.votable.tree.Table(votable, ID=None, name=None, ref=None, ucd=None, utype=None, nrows=None, id=None, config={}, pos=None, **extra) [edit on github][source]

Bases: astropy.io.votable.tree.Element, astropy.io.votable.tree._IDProperty, astropy.io.votable.tree._NameProperty, astropy.io.votable.tree._UcdProperty, astropy.io.votable.tree._DescriptionProperty

TABLE element: optionally contains data.

It contains the following publicly-accessible and mutable attribute:

array: A Numpy masked array of the data itself, where each row is a row of votable data, and columns are named and typed based on the <FIELD> elements of the table. The mask is parallel to the data array, except for variable-length fields. For those fields, the numpy array’s column type is “object” ("O"), and another masked array is stored there.

If the Table contains no data, (for example, its enclosing Resource has type == ‘meta’) array will have zero-length.

The keyword arguments correspond to setting members of the same name, documented below.

Attributes Summary

links A list of Link objects (pointers to other documents or servers through a URI) for the table.
params A list of parameters (constant-valued columns) for the table.
ref
format [required] The serialization format of the table. Must be
nrows [immutable] The number of rows in the table, as specified in
groups A list of Group objects describing how the columns and parameters are grouped.
infos A list of Info objects for the table.
fields A list of Field objects describing the types of each of the data columns.

Methods Summary

parse(iterator, config)
to_table() Convert this VO Table to an astropy.table.Table instance.
get_field_by_id(ref[, before]) Looks up a FIELD or PARAM element by the given ID.
iter_groups() Recursively iterate over all GROUP elements in the TABLE.
create_arrays([nrows, config]) Create a new array to hold the data based on the current set of fields, and store them in the array and member variable.
get_group_by_id(ref[, before]) Looks up a GROUP element by the given ID.
is_empty() Returns True if this table doesn’t contain any real data because it was skipped over by the parser (through use of the table_number kwarg).
to_xml(w, **kwargs)
iter_fields_and_params() Recursively iterate over all FIELD and PARAM elements in the TABLE.
get_field_by_id_or_name(ref[, before]) Looks up a FIELD or PARAM element by the given ID or name.
from_table(votable, table) Create a Table instance from a given astropy.table.Table instance.

Attributes Documentation

A list of Link objects (pointers to other documents or servers through a URI) for the table.

params[source]

A list of parameters (constant-valued columns) for the table. Must contain only Param objects.

ref[source]
format[source]

[required] The serialization format of the table. Must be one of:

‘tabledata’ (TABLEDATA), ‘binary’ (BINARY), ‘fits’ (FITS).

Note that the ‘fits’ format, since it requires an external file, can not be written out. Any file read in with ‘fits’ format will be read out, by default, in ‘tabledata’ format.

nrows[source]

[immutable] The number of rows in the table, as specified in the XML file.

groups[source]

A list of Group objects describing how the columns and parameters are grouped. Currently this information is only kept around for round-tripping and informational purposes.

infos[source]

A list of Info objects for the table. Allows for post-operational diagnostics.

fields[source]

A list of Field objects describing the types of each of the data columns.

Methods Documentation

parse(iterator, config) [edit on github][source]
to_table() [edit on github][source]

Convert this VO Table to an astropy.table.Table instance.

Warning

Variable-length array fields may not be restored identically when round-tripping through the astropy.table.Table instance.

get_field_by_id(ref, before=None) [edit on github]

Looks up a FIELD or PARAM element by the given ID.

iter_groups() [edit on github][source]

Recursively iterate over all GROUP elements in the TABLE.

create_arrays(nrows=0, config={}) [edit on github][source]

Create a new array to hold the data based on the current set of fields, and store them in the array and member variable. Any data in the existing array will be lost.

nrows, if provided, is the number of rows to allocate.

get_group_by_id(ref, before=None) [edit on github]

Looks up a GROUP element by the given ID. Used by the group’s “ref” attribute

is_empty() [edit on github][source]

Returns True if this table doesn’t contain any real data because it was skipped over by the parser (through use of the table_number kwarg).

to_xml(w, **kwargs) [edit on github][source]
iter_fields_and_params() [edit on github][source]

Recursively iterate over all FIELD and PARAM elements in the TABLE.

get_field_by_id_or_name(ref, before=None) [edit on github]

Looks up a FIELD or PARAM element by the given ID or name.

classmethod from_table(votable, table) [edit on github][source]

Create a Table instance from a given astropy.table.Table instance.

Page Contents