8000 get_horizons_coord error with step='60s' · Issue #8188 · sunpy/sunpy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

get_horizons_coord error with step='60s' #8188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rweigel opened this issue May 13, 2025 · 1 comment · Fixed by #8190
Closed

get_horizons_coord error with step='60s' #8188

rweigel opened this issue May 13, 2025 · 1 comment · Fixed by #8190
Labels
coordinates Affects the coordinates submodule

Comments

@rweigel
Copy link
rweigel commented May 13, 2025

Based on statement in docs

... step must be a string with either a number and interval length (e.g. for every 10 seconds, '10s'), ...

I expected the following to work (does not work with 10s either) (SunPy 6.0.0)

import datetime
from sunpy.coordinates import get_horizons_coord
satellite_id = -140482

t = {
  'start': datetime.datetime(2016, 9, 1, 0, 0, 30),
  'stop': datetime.datetime(2016, 9, 1, 23, 59, 30),
  'step': '60s'
}

data_jpl = get_horizons_coord(satellite_id, t).geocentricsolarecliptic.cartesian.xyz.to('km')

"""
File "/opt/miniconda3/lib/python3.12/site-packages/sunpy/coordinates/ephemeris.py", line 371, in get_horizons_coord
    raise RuntimeError(f"Unknown JPL HORIZONS error:\n{output.text}")
RuntimeError: Unknown JPL HORIZONS error:
API VERSION: 1.0
API SOURCE: NASA/JPL Horizons API
...
"""

t['step'] = '1m'

# (Same call as above, but with a different step size)
data_jpl = get_horizons_coord(satellite_id, t).geocentricsolarecliptic.cartesian.xyz.to('km')
# No error
@ayshih
Copy link
Member
ayshih commented May 13, 2025

Hmm, the (current) Horizons API documentation is clear that "s" is not a supported option. I don't know if "s" was ever supported in past, but certainly our docstring is now wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
coordinates Affects the coordinates submodule
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0