Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Fixed problem with GMass unit conversion from JPL to system units
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Sep 15, 2023
1 parent bf4fd8c commit f415889
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion swiftest/init_cond.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def get_rotpole(jpl):
rot = np.full(3,np.nan)
else:
print(f"Physical properties found for {namelist[0]}")
Gmass *= 1e-9 # JPL returns GM in units of km**3 / s**2
Gmass *= 1e9 # JPL returns GM in units of km**3 / s**2, so convert to SI

rotrate = get_rotrate(jpl.raw_response)
if rotrate is None:
Expand Down Expand Up @@ -389,6 +389,9 @@ def solar_system_horizons(name: str,
Gmass += Gmass_charon

if Gmass is not None:
# Convert from SI to system units
Gmass *= param['TU2S'] ** 2 / param['DU2M'] ** 3

if param['CHK_CLOSE']:
Rpl /= param['DU2M']

Expand Down

0 comments on commit f415889

Please sign in to comment.