MangoObject

class pyvo.mivot.writer.MangoObject(table, *, dmid=None)[source]

Bases: object

This class handles all the components of a MangoObject (properties, origin, instance identifier).

It is meant to be used by pyvo.mivot.writer.InstancesFromModels but not by end users.

  • There is one specific method for each supported property (EpochPosition, photometry and QueryOrigin).

  • The internal structure of the classes is hard-coded in the class logic.

Constructor parameters:

Parameters:
tableastropy.io.votable.tree.TableElement

VOTable table which data is mapped on Mango

dmid: stringn optional (default as None)

Reference of the column to be used as a MangoObject identifier

Methods Summary

add_brightness_property(filter_id, mapping)

Add a Brightness instance to the properties of the current MangoObject.

add_color_instance(filter_low_id, ...[, ...])

Add an Color instance to the properties of the current MangoObject.

add_epoch_position(space_frame_id, ...)

Add an EpochPosition instance to the properties of the current MangoObject.

get_mango_object([with_origin])

Make and return the XML serialization of the MangoObject.

Methods Documentation

add_brightness_property(filter_id, mapping, semantics={})[source]

Add a Brightness instance to the properties of the current MangoObject. Both mapping and semantics arguments inherit from pyvo.mivot.writer.InstancesFromModels.add_mango_brightness.

Parameters:
filter_idstring

Identifier (dmid) of the PhotCal INSTANCE located in the GLOBALS

mappingdict

Mapping of the EpochPosition fields

semanticsdict

Mapping of the MangoObject property

Returns:
Property

The Brightness instance

add_color_instance(filter_low_id, filter_high_id, mapping, semantics={})[source]

Add an Color instance to the properties of the current MangoObject. Both mapping and semantics arguments inherit from pyvo.mivot.writer.InstancesFromModels.add_mango_color.

Parameters:
filter_low_idstring

Identifier (dmid) of the low energy Photfilter INSTANCE located in the GLOBALS

filter_high_idstring

Identifier (dmid) of the high energy Photfilter INSTANCE located in the GLOBALS

mappingdict

Mapping of the EpochPosition fields

semanticsdict

Mapping of the MangoObject property

Returns:
Property

The Color instance

add_epoch_position(space_frame_id, time_frame_id, mapping, semantics)[source]

Add an EpochPosition instance to the properties of the current MangoObject. Both mapping and semantics arguments inherit from pyvo.mivot.writer.InstancesFromModels.add_mango_epoch_position.

Parameters:
space_frame_idstring

Identifier (dmid) of space system INSTANCE located in the GLOBALS

time_frame_idstring

Identifier (dmid) of time system INSTANCE located in the GLOBALS

mappingdict

Mapping of the EpochPosition fields

semanticsdict

Mapping of the MangoObject property

Returns:
Property

The EpochPosition instance

get_mango_object(with_origin=False)[source]

Make and return the XML serialization of the MangoObject.

Parameters:
with_originbool

Ask for adding a reference (_origin) to the query origin possibly located in the GLOBALS

Returns:
string

The XML serialization of the MangoObject