VOTableFile

class astropy.io.votable.tree.VOTableFile(ID=None, id=None, config={}, pos=None, version='1.2') [edit on github][source]

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

VOTABLE element: represents an entire file.

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

version is settable at construction time only, since conformance tests for building the rest of the structure depend on it.

Attributes Summary

coordinate_systems A list of coordinate system descriptions for the file.
groups A list of groups, in the order they appear in the file.
infos A list of informational parameters (key-value pairs) for the entire file.
version The version of the VOTable specification that the file uses.
params A list of parameters (constant-valued columns) that apply to the entire file.
resources A list of resources, in the order they appear in the file.

Methods Summary

get_first_table() Often, you know there is only one table in the file, and that’s all you need.
get_coosys_by_id(ref[, before]) Looks up a COOSYS element by the given ID.
parse(iterator, config)
get_field_by_id_or_name(ref[, before]) Looks up a FIELD element by the given ID or name.
get_table_by_id(ref[, before]) Looks up a TABLE element by the given ID.
to_xml(fd[, write_null_values, compressed, ...]) Write to an XML file.
iter_fields_and_params() Recursively iterate over all FIELD and PARAM elements in the VOTABLE file.
iter_values() Recursively iterate over all VALUES elements in the VOTABLE file.
get_values_by_id(ref[, before]) Looks up a VALUES element by the given ID.
set_all_tables_format(format) Set the output storage format of all tables in the file.
iter_tables() Iterates over all tables in the VOTable file in a “flat” way, ignoring the nesting of resources etc.
iter_coosys() Recursively iterate over all COOSYS elements in the VOTABLE file.
get_field_by_id(ref[, before]) Looks up a FIELD element by the given ID.
iter_groups() Recursively iterate over all GROUP elements in the VOTABLE file.
from_table(table[, table_id]) Create a VOTableFile instance from a given astropy.table.Table instance.
get_table_by_index(idx) Get a table by its ordinal position in the file.
get_group_by_id(ref[, before]) Looks up a GROUP element by the given ID.

Attributes Documentation

coordinate_systems[source]

A list of coordinate system descriptions for the file. Must contain only CooSys objects.

groups[source]

A list of groups, in the order they appear in the file. Only supported as a child of the VOTABLE element in VOTable 1.2 or later.

infos[source]

A list of informational parameters (key-value pairs) for the entire file. Must only contain Info objects.

version[source]

The version of the VOTable specification that the file uses.

params[source]

A list of parameters (constant-valued columns) that apply to the entire file. Must contain only Param objects.

resources[source]

A list of resources, in the order they appear in the file. Must only contain Resource objects.

Methods Documentation

get_first_table() [edit on github][source]

Often, you know there is only one table in the file, and that’s all you need. This method returns that first table.

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

Looks up a COOSYS element by the given ID.

parse(iterator, config) [edit on github][source]
get_field_by_id_or_name(ref, before=None) [edit on github]

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

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

Looks up a TABLE element by the given ID. Used by the table “ref” attribute.

to_xml(fd, write_null_values=False, compressed=False, _debug_python_based_parser=False, _astropy_version=None) [edit on github][source]

Write to an XML file.

Parameters :

fd : str path or writable file-like object

Where to write the file.

write_null_values : bool, optional

When True, write the ‘null’ value (specified in the null attribute of the VALUES element for each FIELD) for empty values. When False (default), simply write no value.

compressed : bool, optional

When True, write to a gzip-compressed file. (Default: False)

iter_fields_and_params() [edit on github][source]

Recursively iterate over all FIELD and PARAM elements in the VOTABLE file.

iter_values() [edit on github][source]

Recursively iterate over all VALUES elements in the VOTABLE file.

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

Looks up a VALUES element by the given ID. Used by the values “ref” attribute.

set_all_tables_format(format) [edit on github][source]

Set the output storage format of all tables in the file.

iter_tables() [edit on github][source]

Iterates over all tables in the VOTable file in a “flat” way, ignoring the nesting of resources etc.

iter_coosys() [edit on github][source]

Recursively iterate over all COOSYS elements in the VOTABLE file.

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

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

iter_groups() [edit on github][source]

Recursively iterate over all GROUP elements in the VOTABLE file.

classmethod from_table(table, table_id=None) [edit on github][source]

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

Parameters :

table_id : str, optional

Set the given ID attribute on the returned Table instance.

get_table_by_index(idx) [edit on github][source]

Get a table by its ordinal position in the file.

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

Page Contents