Skip to content

Commit e259d4b

Browse files
committed
Update Miriade url and upstream and making relevant changes that parses the different response format
1 parent 5b8545d commit e259d4b

File tree

4 files changed

+25
-17
lines changed

4 files changed

+25
-17
lines changed

astroquery/imcce/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Conf(_config.ConfigNamespace):
1818

1919
# server settings
2020
ephemcc_server = _config.ConfigItem(
21-
'http://vo.imcce.fr/webservices/miriade/ephemcc_query.php',
21+
'https://ssp.imcce.fr/webservices/miriade/api/ephemcc.php',
2222
'IMCCE/Miriade.ephemcc base server')
2323
skybot_server = _config.ConfigItem(
2424
['http://vo.imcce.fr/webservices/skybot/skybotconesearch_query.php'],

astroquery/imcce/core.py

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
class MiriadeClass(BaseQuery):
2424
"""
2525
A class for querying the
26-
`IMCCE/Miriade <http://vo.imcce.fr/webservices/miriade/>`_ service.
26+
`IMCCE/Miriade <https://ssp.imcce.fr/webservices/miriade/>`_ service.
2727
"""
2828

2929
_query_uri = None # uri used in query
@@ -49,8 +49,8 @@ def get_ephemerides_async(self, targetname, *, objtype='asteroid',
4949
get_raw_response=False, cache=True):
5050
"""
5151
Query the
52-
`IMCCE Miriade <http://vo.imcce.fr/webservices/miriade/>`_
53-
`ephemcc <http://vo.imcce.fr/webservices/miriade/?ephemcc>`_
52+
`IMCCE Miriade <https://ssp.imcce.fr/webservices/miriade/>`_
53+
`ephemcc <https://ssp.imcce.fr/webservices/miriade/api/ephemcc>`_
5454
service.
5555
5656
@@ -85,7 +85,7 @@ def get_ephemerides_async(self, targetname, *, objtype='asteroid',
8585
location : str, optional
8686
Location of the observer on Earth as a code or a set of
8787
coordinates. See the
88-
`Miriade manual <http://vo.imcce.fr/webservices/miriade/?documentation#field_7>`_
88+
`Miriade manual <https://ssp.imcce.fr/webservices/miriade/?documentation#field_7>`_
8989
for details. Default: geocentric location (``'500'``)
9090
9191
coordtype : int, optional
@@ -299,17 +299,27 @@ def _parse_result(self, response, *, verbose=None):
299299
votable = parse(voraw)
300300
data = votable.get_first_table().to_table()
301301

302-
# modify table columns
302+
# modify table columns. This is an ugly hack as astropy's votable parser
303+
# is not yet capable of parsing some of these properly.
304+
# Also, not clear why some of the columns are now parsed as object as
305+
# opposed to strings, workaround here is to do .astype()
306+
307+
data['date'] = Time(data['date'].astype('str'), format='isot')
308+
309+
# Adding for backwards compatibility
310+
data['epoch'] = data['date'].jd
303311
data['epoch'].unit = u.d
304312

305-
if 'ra' in data.columns:
306-
data['ra'] = Angle(data['ra'], unit=u.hourangle).deg*u.deg
307-
data.rename_column('ra', 'RA')
313+
if 'RA' in data.columns:
314+
data['RA'] = Angle(data['RA'].astype('str'), unit=u.hourangle).deg*u.deg
315+
316+
if 'DEC' in data.columns:
317+
data['DEC'] = Angle(data['DEC'], unit=u.deg).deg*u.deg
308318

309319
if 'dec' in data.columns:
310-
data['dec'] = Angle(data['dec'], unit=u.deg).deg*u.deg
311320
data.rename_column('dec', 'DEC')
312321

322+
# These don't seem to be returned with the new API/url, as of 2025-04-07
313323
if 'raJ2000' in data.columns and 'decJ2000' in data.columns:
314324
data['raJ2000'] = Angle(
315325
data['raJ2000'], unit=u.hourangle).deg*u.deg

astroquery/imcce/tests/test_miriade_remote.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import numpy.testing as npt
55
import pytest
66

7-
from .. import core
7+
from astroquery.imcce import Miriade
88

99

1010
@pytest.mark.remote_data
@@ -13,10 +13,8 @@ class TestMiriadeClass:
1313
def test_ephemerides(self):
1414
# check values of Ceres for a given epoch
1515
# orbital uncertainty of Ceres is basically zero
16-
res = core.Miriade.get_ephemerides('Ceres', location='500',
17-
epoch=2451544.5)
18-
19-
assert res['target'] == "Ceres"
16+
res = Miriade.get_ephemerides('Ceres', location='500',
17+
epoch=2451544.5)
2018

2119
npt.assert_allclose(
2220
[2451544.5, 188.70280, 9.09829],

docs/imcce/imcce.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ Pallas over an entire year with a time step of 1 day:
205205
The observer location is defined through the ``location`` keyword,
206206
expecting a string containing the official IAU observatory code, a
207207
spacecraft name, or a set of coordinates (see the `Miriade manual
208-
<http://vo.imcce.fr/webservices/miriade/?documentation#field_7>`_ for
208+
<https://ssp.imcce.fr/webservices/miriade/?documentation#field_7>`_ for
209209
details).
210210

211211

@@ -219,7 +219,7 @@ query, the coordinate type in
219219
`~astroquery.imcce.MiriadeClass.get_ephemerides` is defined through
220220
an integer value. For a full discussion of the different coordinate
221221
types we refer to `this section
222-
<http://vo.imcce.fr/webservices/miriade/?ephemcc#outputparam>`_ of the
222+
<https://ssp.imcce.fr/webservices/miriade/?ephemcc#outputparam>`_ of the
223223
Miriade website. The keyword ``coordtype`` controls which set of
224224
coordinates and properties are queried.
225225

0 commit comments

Comments
 (0)