HeaderMapper

class pyvo.mivot.writer.HeaderMapper(votable)[source]

Bases: object

This utility class generates dictionaries from header elements of a VOTable. These dictionaries are used as input parameters by pyvo.mivot.writer.InstancesFromModels to create MIVOT instances that are placed in the GLOBALS block or in the TEMPLATES. In the current implementation, the following elements can be extracted:

  • COOSYS -> coords:SpaceSys

  • TIMESYS - coords:TimeSys

  • INFO -> mango:QueryOrigin

  • FIELD -> mango:EpochPosition

Constructor parameters:

Parameters:
votableastropy.io.votable.tree.VOTableFile

parsed votable from which INFO element are processed

Methods Summary

extract_coosys_mapping()

Create a mapping dictionary for each COOSYS element found in the first VOTable resource.

extract_epochposition_mapping()

Analyze the FIELD UCD-s to infer a data mapping to the EpochPosition class.

extract_origin_mapping()

Create a mapping dictionary from all VOTable INFO elements.

extract_timesys_mapping()

Create a mapping dictionary for each TIMESYS element found in the first VOTable resource.

Methods Documentation

extract_coosys_mapping()[source]

Create a mapping dictionary for each COOSYS element found in the first VOTable resource.

Returns:
[dict]

Array of dictionaries which items can be used as input parameter for pyvo.mivot.writer.InstancesFromModels.add_simple_space_frame()

extract_epochposition_mapping()[source]

Analyze the FIELD UCD-s to infer a data mapping to the EpochPosition class. This mapping covers the 6 parameters with the Epoch and their errors. The correlation part is not covered since there is no specific UCD for this. The UCD-s accepted for each parameter are defined in pyvo.mivot.glossary.

The error classes are hard-coded as the most likely types.

  • PErrorSym2D for 2D parameters

  • PErrorSym1D for 1D parameters

Returns:
(dict, dict)

A mapping proposal for the EpochPosiion + errors that can be used as input parameter by pyvo.mivot.writer.InstancesFromModels.add_mango_epoch_position().

extract_origin_mapping()[source]

Create a mapping dictionary from all VOTable INFO elements. This dictionary is used to build a mango:QueryOrigin INSTANCE

  • INFO elements located in the VOTable header are used to build the mango:QueryOrigin part which scope is the whole VOtable by construction (one query -> one VOTable)

  • INFO elements located in the resource header are used to build the mango:DataOrigin part which scope is the data located in this resource.

Returns:
dict

Dictionary that can be used as input parameter for pyvo.mivot.writer.InstancesFromModels.add_query_origin()

extract_timesys_mapping()[source]

Create a mapping dictionary for each TIMESYS element found in the first VOTable resource.

Note

the origin attribute is not supported yet

Returns:
[dict]

Array of dictionaries which items can be used as input parameter for pyvo.mivot.writer.InstancesFromModels.add_simple_time_frame()