JPL Horizon Elements query fails with "body" reference plane
- Dominant language
- Python
- Stars
- 791
- Forks
- 451
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 4
Description
I'm trying to get, through the `astroquery.jplhorizons`' `Horizons` object, the elements of Europa w.r.t. Jupiter in the Jupiter Equator of Date. To do that i first created the `Horizons `object:
```
horizon = Horizons(
id="502", location="5",
epochs={"start": "2020-01-01 00:00:00 TDB", "stop": "2022-01-01 00:00:00", "step": "10 day"}
)
```
and then call it:
`elms = horizon.elements(refsystem="ICRF", refplane="body")`
and I get the following error:
> ValueError: Query failed without known error message; received the following response:
API VERSION: 1.1
API SOURCE: NASA/JPL Horizons API
INPUT ERROR in VLADD in following line:
REF_PLANE=BODY EQUATOR
^ Too many constants
BATVAR: problem loading execution-control setting:
LINE=REF_PLANE=BODY EQUATOR
WLDINI: error loading execution-control file.
Performing some traceback of the errors I've found that it is probably due to the way the payload is requested to JPL Horizon. In particular it seems that the `REF_PLANE` signature `BODY EQUATOR` is not accepted:
https://github.com/astropy/astroquery/blob/b787ee22766d8d71f09e55de304619a0d3e72418/astroquery/jplhorizons/core.py#L768
https://github.com/astropy/astroquery/blob/b787ee22766d8d71f09e55de304619a0d3e72418/astroquery/jplhorizons/core.py#L997
while changing it to `BODY` it works (despite the fact that the body frame is not available for this particular example). Anyone else experienced this issue? Is the Horizon call signature changed?
Contributor guide
Research direction
Reproduce the Horizons.elements call in astroquery/jplhorizons/core.py using refsystem="ICRF" and refplane="body". Inspect the payload construction around lines 768 and 997, compare the generated REF_PLANE value with the JPL error, and confirm the corrected request behavior against the example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100