astropy / pyvo

An Astropy affiliated package providing access to remote data and services of the Virtual Observatory (VO) using Python.
https://pyvo.readthedocs.io/en/latest
BSD 3-Clause "New" or "Revised" License
74 stars 50 forks source link

MIVOT: making the descripton of the model elements available through the API #533

Open lmichel opened 3 months ago

lmichel commented 3 months ago

As PR #497 is very large, we have decided not to overload it with advanced features (see #532). This issue (suggested by @gilleslandais) proposes a feature that could be implemented once #497 is merged.

The MIVOT <MODEL> element provides access to the VO-DML file associated with the referenced model. These files contain a free text description of each model element. These descriptive items are part of the standard.

It would be valuable to make these descriptions available for the end users.


scs_srv = SCSService(viewer_url)
m_viewer = MivotViewer()
    scs_srv.search(
        pos=SkyCoord(ra=52.26708 * u.degree, dec=59.94027 * u.degree, frame='icrs'),
        radius=0.05
    )
)
mivot_instance = m_viewer.instance
while m_viewer.next():
    print(mivot_instance.latitude.value)
    >>> 59.94033461
    print(mivot_instance.latitude.description)
    >>> Right Ascension as defined in the Coords model (foo description).
    print(mivot_instance.longitude.value)
    >>> 52.26722684
    print(mivot_instance.longitude.description)
    >>> Declination as defined in the Coords model (foo description).