From f415889473eec07c3bf40a663b5d40319609e9d9 Mon Sep 17 00:00:00 2001 From: David A Minton Date: Fri, 15 Sep 2023 09:17:58 -0400 Subject: [PATCH] Fixed problem with GMass unit conversion from JPL to system units --- swiftest/init_cond.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/swiftest/init_cond.py b/swiftest/init_cond.py index 978fe9808..87ebdaa33 100644 --- a/swiftest/init_cond.py +++ b/swiftest/init_cond.py @@ -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: @@ -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']