Can I use Astroquery/Astropy to get the radius and mass of solar system objects? Or another common library?
I've been trying to use astroquery.horizons
I've tried elements() and ephemeris() but no dice, they don't contain columns for mass or radius. The only place I could find the values (and others, see below) is in the raw API response:
from astroquery.jplhorizons import Horizons
from astropy import units as u
object_id = "199" # Mercury
obj_id = Horizons(id=obj, id_type="majorbody", location="0") # Location 0 is the solar system barycenter
response = obj_id.ephemerides_async(get_raw_response=True)
Produces
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
*******************************************************************************
... More Lines Below
This is really hard to extract data from, being two columns of text with no clear delimiter.
- Is there a good way to get mass/radius?
Also
- Is there a better way to get the true ID for bodies by name (getting results for their barycenter which isn't useful)
The following Wikipedia article has both mass and radius.
Wikipedia – List of Solar System objects by size.
Here is a regex scrape.
The radius is in units of km, and the mass is in units of kg-1021.
The additional field there is the error, ±.
And, Saturn includes a comment for the radius, "136775 for A Ring".