PerezHz / HORIZONS.jl

An interface to NASA-JPL HORIZONS system and other Solar System Dynamics APIs in Julia
Other
17 stars 6 forks source link

Geophysical properties from major bodies #30

Open cadojo opened 3 years ago

cadojo commented 3 years ago

Just found this package, this is wonderful. Thank you for your work!

Is there any way to extract geophysical properties from major solar system bodies via function call? I can get the geophysical properties via...

Horizons> Earth
*******************************************************************************
 Multiple major-bodies match string "EARTH*"

  ID#      Name                               Designation  IAU/aliases/other   
  -------  ---------------------------------- -----------  ------------------- 
        3  Earth-Moon Barycenter                           EMB                  
      399  Earth                                           Geocenter            

   Number of matches =  2. Use ID# to make unique selection.
*******************************************************************************
 Select ... [F]tp, [M]ail, [R]edisplay, ?, <cr>: 399
*******************************************************************************
 Revised: July 31, 2013                  Earth                              399

 GEOPHYSICAL PROPERTIES (revised Aug 15, 2018):
  Vol. Mean Radius (km)    = 6371.01+-0.02   Mass x10^24 (kg)= 5.97219+-0.0006
  Equ. radius, km          = 6378.137        Mass layers:
  Polar axis, km           = 6356.752          Atmos         = 5.1   x 10^18 kg
  Flattening               = 1/298.257223563   oceans        = 1.4   x 10^21 kg
  Density, g/cm^3          = 5.51              crust         = 2.6   x 10^22 kg
  J2 (IERS 2010)           = 0.00108262545     mantle        = 4.043 x 10^24 kg
  g_p, m/s^2  (polar)      = 9.8321863685      outer core    = 1.835 x 10^24 kg
  g_e, m/s^2  (equatorial) = 9.7803267715      inner core    = 9.675 x 10^22 kg
  g_o, m/s^2               = 9.82022         Fluid core rad  = 3480 km
  GM, km^3/s^2             = 398600.435436   Inner core rad  = 1215 km
  GM 1-sigma, km^3/s^2     =      0.0014     Escape velocity = 11.186 km/s
  Rot. Rate (rad/s)        = 0.00007292115   Surface area:
  Mean sidereal day, hr    = 23.9344695944     land          = 1.48 x 10^8 km
  Mean solar day 2000.0, s = 86400.002         sea           = 3.62 x 10^8 km
  Mean solar day 1820.0, s = 86400.0         Love no., k2    = 0.299
  Moment of inertia        = 0.3308          Atm. pressure   = 1.0 bar
  Mean temperature, K      = 270             Volume, km^3    = 1.08321 x 10^12
  Mean effect. IR temp, K  = 255             Magnetic moment = 0.61 gauss Rp^3
  Geometric albedo         = 0.367           Vis. mag. V(1,0)= -3.86
  Solar Constant (W/m^2)   = 1367.6 (mean), 1414 (perihelion), 1322 (aphelion)
 HELIOCENTRIC ORBIT CHARACTERISTICS:
  Obliquity to orbit, deg  = 23.4392911  Sidereal orb period  = 1.0000174 y
  Orbital speed, km/s      = 29.79       Sidereal orb period  = 365.25636 d
  Mean daily motion, deg/d = 0.9856474   Hill's sphere radius = 234.9       
*******************************************************************************
 Select ... [E]phemeris, [F]tp, [M]ail, [R]edisplay, ?, <cr>:                      

But I was wondering if there was already a feature to download this information without any ephemeris.

PerezHz commented 3 years ago

Hey, glad this package is being useful!

Currently, the expect-script-based functions smb_spk, etc., discard this output and return only the ephemeris, but it's definitely possible to adapt one of these scripts to capture this output. Maybe we can create a geophysical_properties function or something like that, which takes the NAIF ID as input and returns this output as a string; would that work for you?

cadojo commented 2 years ago

Yes that would work! I'd be happy to submit a PR for this, but I might need some help figuring out where the best spot is for this to go.

PerezHz commented 7 months ago

Yes that would work! I'd be happy to submit a PR for this, but I might need some help figuring out where the best spot is for this to go.

Hey, @cadojo! Sorry to the delay coming back to this, just wanted to let you know that we recently switched to the JPL's HTTP APIs and it might be a bit easier to implement this via this new interface. If you want to give it a go, we'd be happy to help! 😄

cadojo commented 7 months ago

No worries @PerezHz, I actually also switched to the REST API with HorizonsAPI.jl. Glad we converged on the same answer! I haven't yet written a parser for geophysical properties, I have also kind of switched to SPICE kernels with SPICEBodies.jl.

PerezHz commented 6 months ago

Hey, really neat work there in HorizonsAPi.jl @cadojo! Yes, these REST APIs are really a charm by JPL so I guess it makes sense to move forward in that direction 😄. Perhaps at some point down the road we could think about somehow merging HORIZONS and HorizonsAPI, if we ever find there's significant risk of overlap, scope and/or effort duplication (as is often the case in open source). If you don't mind, even if you managed to get your geophysical properties data in some other way, I'd prefer to keep this issue open, just because it'd really be a nice feature to add.