astropy / astropy/astroquery

JPL Horizons: Parse Physical Data table

Open
#2,895 2 comments 0 reactions 0 assignees View on GitHub
feature request jplhorizons
Dominant language
Python
Stars
791
Forks
451
Avg merge
1d 3h
Merged PRs (30d)
4

Description

There was a feature request on stackoverflow:
https://stackoverflow.com/questions/77509022/how-can-i-get-solar-system-body-mass-radius-in-python

```python
from astroquery.jplhorizons import Horizons
from astropy import units as u

object_id = "199" # Mercury
obj_id = Horizons(id=object_id, location="0") # Location 0 is the solar system barycenter

response = obj_id.ephemerides_async()

print(response.text)
```

```
API VERSION: 1.2
API SOURCE: NASA/JPL Horizons API

*******************************************************************************
Revised: April 12, 2021 Mercury 199 / 1

PHYSICAL DATA (updated 2021-Apr-12):
Vol. Mean Radius (km) = 2440+-1 Density (g cm^-3) = 5.427
Mass x10^23 (kg) = 3.302 Volume (x10^10 km^3) = 6.085
Sidereal rot. period = 58.6463 d Sid. rot. rate (rad/s)= 0.00000124001
Mean solar day = 175.9421 d Core radius (km) = ~1600
Geometric Albedo = 0.106 Surface emissivity = 0.77+-0.06
GM (km^3/s^2) = 22031.86855 Equatorial radius, Re = 2440 km
GM 1-sigma (km^3/s^2) = Mass ratio (Sun/plnt) = 6023682
Mom. of Inertia = 0.33 Equ. gravity m/s^2 = 3.701
Atmos. pressure (bar) = < 5x10^-15 Max. angular diam. = 11.0"
Mean Temperature (K) = 440 Visual mag. V(1,0) = -0.42
Obliquity to orbit[1] = 2.11' +/- 0.1' Hill's sphere rad. Rp = 94.4
Sidereal orb. per. = 0.2408467 y Mean Orbit vel. km/s = 47.362
Sidereal orb. per. = 87.969257 d Escape vel. km/s = 4.435
Perihelion Aphelion Mean
Solar Constant (W/m^2) 14462 6278 9126
Maximum Planetary IR (W/m^2) 12700 5500 8000
Minimum Planetary IR (W/m^2) 6 6 6
*******************************************************************************
```

This seems like a reasonable table to provide machine-readable access to, and afaict, we currently don't support that.

Contributor guide

Open the contributing guide

Research direction

Start with the Horizons response shown in the issue and the ephemerides_async() entry point. Trace how the response is currently parsed, then determine how the PHYSICAL DATA table should be represented as machine-readable output. Add coverage using the Mercury sample and verify that the extracted physical values are available without breaking existing ephemerides results.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.