Reference/API#
astropy.io.votable Package#
This package reads and writes data formats used by the Virtual Observatory (VO) initiative, particularly the VOTable XML format.
Functions#
|
Given an |
|
Reads the header of a file to determine if it is a VOTable file. |
|
Parses a VOTABLE xml file (or file-like object), and returns a |
|
Parses a VOTABLE xml file (or file-like object), reading and returning only the first |
|
Prints a validation report for the given file. |
|
Writes a |
Classes#
|
Configuration parameters for |
astropy.io.votable.tree Module#
Classes#
|
COOSYS element: defines a coordinate system. |
|
A base class for all classes that represent XML elements in the VOTABLE file. |
|
FIELD element: describes the datatype of a particular column of data. |
|
FIELDref element: used inside of GROUP elements to refer to remote FIELD elements. |
|
|
|
INFO elements: arbitrary key-value pairs for extensions to the standard. |
|
LINK elements: used to reference external documents and servers through a URI. |
|
MIVOT Block holder: Processing VO model views on data is out of the scope of Astropy. |
|
PARAM element: constant-valued columns in the data. |
|
PARAMref element: used inside of GROUP elements to refer to remote PARAM elements. |
|
|
|
TABLE element: optionally contains data. |
|
TIMESYS element: defines a time system. |
|
VOTABLE element: represents an entire file. |
|
VALUES element: used within FIELD and PARAM elements to define the domain of values. |
astropy.io.votable.converters Module#
This module handles the conversion of various VOTABLE datatypes to/from TABLEDATA and BINARY formats.
Functions#
|
Get an appropriate converter instance for a given field. |
|
Given a |
Classes#
|
The base class for all converters. |
astropy.io.votable.ucd Module#
This file contains routines to verify the correctness of UCD strings.
Functions#
|
Returns False if ucd is not a valid unified content descriptor. |
|
Parse the UCD into its component parts. |
astropy.io.votable.util Module#
Various utilities and cookbook-like things.
Functions#
|
Coerces and/or verifies the object p into a valid range-list-format parameter. |
|
Returns a writable file-like object suitable for streaming output. |
astropy.io.votable.validator Package#
Validates a large collection of web-accessible VOTable files, and generates a report as a directory tree of HTML files.
Functions#
|
Validates a large collection of web-accessible VOTable files. |
astropy.io.votable.xmlutil Module#
Various XML-related utilities.
Functions#
|
Raises a |
|
Raises a |
|
Raises a |
|
Raises a |
|
Given an arbitrary string, create one that can be used as an xml id. |
|
Validates the given file against the appropriate VOTable schema. |
astropy.io.votable.dataorigin Module#
Extract Data Origin in VOTable
References#
DataOrigin is a vocabulary described in the IVOA note: https://www.ivoa.net/documents/DataOrigin/
Notes#
This API retrieve Metadata from INFO in VOTable. The information can be found at different level in a VOTable :
global level
resource level
table level
Contents#
Query information: Each element is considered to be unique in the VOTable. Information concerns publisher, date of execution, contact, request, etc.
Dataset origin : basic provenance information.
Examples#
>>> from astropy.io.votable import parse
>>> from astropy.io.votable.dataorigin import extract_data_origin
>>> data_origin = extract_data_origin(parse("https://vizier.cds.unistra.fr/viz-bin/conesearch/II/246/out?RA=0&DEC=0&SR=0.1"))
>>> print(data_origin)
publisher: CDS
server_software: 7.4.5
service_protocol: ivo://ivoa.net/std/ConeSearch/v1.03
request: https://vizier.cds.unistra.fr/viz-bin/conesearch/II/246/out?RA=0&DEC=0&SR=0.1
request_date: 2025-03-03T12:54:26
contact: cds-question@unistra.fr
...
>>> uri_request = data_origin.query.request
>>> creators = data_origin.origin[0].creator
Functions#
|
Update VOTable element with information compatible |
|
Extract DataOrigin in a VO element |
Classes#
Data class storing both information about query execution |
|
|
Data class storing the basic provenance for a Dataset. |
Data class storing query execution information that generated the VOTable. |