1
+ .. _mivot-annoter :
2
+
1
3
******************************************************
2
4
MIVOT (``pyvo.mivot ``): Annotation Writer - Public API
3
5
******************************************************
@@ -11,7 +13,7 @@ Mango objects are made of a property container, a description of the data origin
11
13
on other Mango objects (not implemented yet).
12
14
13
15
In this current implementation, only 3 properties are supported (Epoch position, photometry, and color)
14
- in addition to the data origin that can be added as literal values (not connected with table data).
16
+ in addition to the data origin that can be added as literal values (not connected with table data).
15
17
16
18
The pseudo codes below show the way to use this API.
17
19
@@ -27,26 +29,26 @@ The ``dmid`` optional parameter gives the column (ID or name) to be used as iden
27
29
The builder is then ready to get the properties to add to the Mango object.
28
30
29
31
.. code-block :: python
30
-
32
+
31
33
builder.add_mango_magnitude(photcal_id = photcal_id, mapping = mapping, semantics = semantics)
32
34
builder.add_mango_magnitude(photcal_id = other_photcal_id, mapping = other_mapping, semantics = other_semantics)
33
35
builder.add_mango_color(filter_ids = filter_ids, mapping = mapping, semantics = semantics)
34
36
builder.add_mango_epoch_position(frames = frames, mapping = mapping, semantics = semantics)
35
37
36
- We can now add the description of the data origin.
38
+ We can now add the description of the data origin.
37
39
38
40
.. code-block :: python
39
-
41
+
40
42
builder.add_query_origin(mapping)
41
-
43
+
42
44
- The order in which the components are added does not matter.
43
45
- The details of the parameters are described below.
44
46
45
47
Now the MIVOT block can be completed and inserted into the VOtable.
46
48
47
49
48
50
.. code-block :: python
49
-
51
+
50
52
builder.pack_into_votable()
51
53
votable.to_xml(" MY/ANNOTATED/VOTABLE" )
52
54
@@ -61,37 +63,37 @@ The lists of supported roles are given in the :py:mod:`pyvo.mivot.glossary`.
61
63
The 3 functions adding properties have all 3 arguments
62
64
63
65
- ``filter/frame ``: Map of the coordinate systems or photometric calibrations that apply to the property.
64
- All values specified here are considered literal.
66
+ All values specified here are considered literal.
65
67
The corresponding Mivot instances are placed in the GLOBALS block.
66
-
68
+
67
69
- **Photometric filter **: must be given as a filter profile service identifier (filter id followed with the photometric system)
68
-
70
+
69
71
- Identifiers can be found on the SVO `page <http://svo2.cab.inta-csic.es/theory/fps/ >`_
70
- (example: ``GAIA/GAIA3.Grp/AB ``)
71
- - The FPS service returns a full calibration instance, which is then split into a filter object
72
+ (example: ``GAIA/GAIA3.Grp/AB ``)
73
+ - The FPS service returns a full calibration instance, which is then split into a filter object
72
74
and a calibration object that refers to that filter.
73
75
- Each one of these components has its own ``dmid `` generated by the API. ``dmid `` can be used to reference them.
74
- Example for filter ``GAIA/GAIA3.Grp/AB ``:
75
-
76
+ Example for filter ``GAIA/GAIA3.Grp/AB ``:
77
+
76
78
- photometric calibration identifer: ``dmid="_photcal_GAIA_GAIA3_Grvs_AB" ``
77
- - filter identifier ``dmid="_filter_GAIA_GAIA3_Grvs_AB" ``
78
-
79
+ - filter identifier ``dmid="_filter_GAIA_GAIA3_Grvs_AB" ``
80
+
79
81
- **Coordinate systems **: Can be given either by ``dmid `` or by parameters
80
- (see `pyvo.mivot.writer.InstancesFromModels.add_simple_space_frame `
82
+ (see `pyvo.mivot.writer.InstancesFromModels.add_simple_space_frame `
81
83
and `pyvo.mivot.writer.InstancesFromModels.add_simple_time_frame `).
82
84
83
- - by ``dmid ``: Identifiers are generated by the API when a frame is added in the GLOBALS.
85
+ - by ``dmid ``: Identifiers are generated by the API when a frame is added in the GLOBALS.
84
86
(example ``{"dmid": "_spaceframe_spaceRefFrame_equinox_refPosition"} ``)
85
87
- by parameters: The mapping parameters are given as dictionaries as for the mapping (see below)
86
88
(example ``{"spaceRefFrame": "ICRS", "refPosition": 'BARYCENTER'} ``)
87
89
88
- - ``Mapping ``: Mapping of the table data to the property attributes.
90
+ - ``Mapping ``: Mapping of the table data to the property attributes.
89
91
The fine structure of these dictionaries is specific to each mapped class,
90
92
but all follow the same pattern.
91
93
Values specified as strings are considered to be column identifiers,
92
94
unless the string starts with a '*'. In this case, the stripped string is taken as the literal value.
93
- Other value types (numeric or boolean) are all considered as literals.
94
-
95
+ Other value types (numeric or boolean) are all considered as literals.
96
+
95
97
+-------------+---------------------------------+
96
98
| **value ** | **attribute value ** |
97
99
+=============+=================================+
@@ -107,7 +109,7 @@ The 3 functions adding properties have all 3 arguments
107
109
+-------------+---------------------------------+
108
110
109
111
- ``semantics ``: Semantic tags (text + vocabulary entry) that apply to the property.
110
-
112
+
111
113
+-------------+---------------------------------------------------------+
112
114
+ **key** | **value** +
113
115
+=============+=========================================================+
@@ -118,7 +120,7 @@ The 3 functions adding properties have all 3 arguments
118
120
+ label + vocabulary term to which the property refers +
119
121
+-------------+---------------------------------------------------------+
120
122
121
- All ``semantics `` fields are considered literal values.
123
+ All ``semantics `` fields are considered literal values.
122
124
123
125
Add Query origin
124
126
----------------
@@ -127,7 +129,7 @@ Add the Mango ``QueryOrigin`` instance to the current ``MangoObject``.
127
129
128
130
.. figure :: _images/mangoDataOrigin.png
129
131
:width: 500
130
-
132
+
131
133
DataOrigin package of Mango.
132
134
133
135
@@ -142,7 +144,7 @@ of the MangoObject. It is always identified with ``dmid="_origin"``
142
144
The detail of the ``mapping `` parameter is given in the `pyvo.mivot.writer.InstancesFromModels.add_query_origin ` documentation
143
145
144
146
The ``QueryOrigin `` object can be automatically built from the INFO tags of the VOtable. The success of this operation depends
145
- on the way INFO tags are populated.
147
+ on the way INFO tags are populated.
146
148
147
149
The method below, analyzes the INFO tags and insert the resulting query origin into the annotations.
148
150
@@ -155,20 +157,20 @@ The method below, analyzes the INFO tags and insert the resulting query origin i
155
157
- INFO tags of the header of the first resource are analyzed to set the ``DataOrigin `` objects.
156
158
- The automatic mapping does not work for VOtable joining several tables yet.
157
159
158
-
160
+
159
161
Add Properties
160
162
--------------
161
163
162
164
The main purpose of the ``MangoObject `` is to collect various properties contained in the data row,
163
165
although synthetic properties (literal value only) can be added as well.
164
166
165
- - The properties are stored in a container named ``propertyDock ``.
166
- - During he annotation process, properties are added one by one by specific methods.
167
+ - The properties are stored in a container named ``propertyDock ``.
168
+ - During he annotation process, properties are added one by one by specific methods.
167
169
168
170
.. figure :: _images/mangoProperties.png
169
171
:width: 500
170
-
171
-
172
+
173
+
172
174
Properties supported by Mango.
173
175
174
176
Add EpochPosition
@@ -178,8 +180,8 @@ The ``EpochPosition`` property describes the astrometry of a moving source.
178
180
179
181
.. figure :: _images/mangoEpochPosition.png
180
182
:width: 500
181
-
182
-
183
+
184
+
183
185
EpochPosition components of Mango.
184
186
185
187
It handles six parameters (position, proper motion, parallax and radial velocity) valid at a given epoch
@@ -189,7 +191,7 @@ It handles six parameters (position, proper motion, parallax and radial velocity
189
191
190
192
builder.add_epoch_position(frames, mapping, semantics)
191
193
192
- The detail of the parameters is given with the description of the
194
+ The detail of the parameters is given with the description of the
193
195
:py:meth: `pyvo.mivot.writer.InstancesFromModels.add_mango_epoch_position ` method.
194
196
195
197
The first parameter (``frames ``) specifies both space and time frames.
@@ -226,7 +228,7 @@ The ``Brightness`` binds a flux or a magnitude with an error and a photometric c
226
228
227
229
builder.add_mango_brightness(photcal_id, mapping, semantics)
228
230
229
- The detail of the parameters is given with the
231
+ The detail of the parameters is given with the
230
232
:py:meth: `pyvo.mivot.writer.InstancesFromModels.add_mango_brightness ` docstring.
231
233
232
234
Add Color
@@ -238,7 +240,7 @@ The ``Color`` binds to a Color index or an hardness ratio value with an error an
238
240
239
241
builder.add_mango_color(filter_ids, mapping, semantics)
240
242
241
- The detail of the parameters is given with the
243
+ The detail of the parameters is given with the
242
244
:py:meth: `pyvo.mivot.writer.InstancesFromModels.add_mango_color ` docstring.
243
245
244
246
0 commit comments