From 0fb9a2cc4501aacf6d8ba06bf236d0aff06ce2a2 Mon Sep 17 00:00:00 2001 From: David Minton Date: Fri, 27 Aug 2021 14:43:41 -0400 Subject: [PATCH] Auto stash before merge of "IO" and "origin/IO" --- python/swiftest/swiftest/init_cond.py | 8 ++++---- python/swiftest/swiftest/simulation_class.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/python/swiftest/swiftest/init_cond.py b/python/swiftest/swiftest/init_cond.py index b98680f62..ca959f3f9 100644 --- a/python/swiftest/swiftest/init_cond.py +++ b/python/swiftest/swiftest/init_cond.py @@ -118,7 +118,7 @@ def solar_system_horizons(plname, idval, param, ephemerides_start_date, ds): rotcb = solarpole.cartesian * solarrot Ipsun = np.array([0.0, 0.0, planetIpz['Sun']]) - cbid = np.array([1]) + cbid = np.array([0]) cvec = np.vstack([GMcb, Rcb, J2RP2, J4RP4]) if param['ROTATION'] == 'YES': cvec = np.vstack([cvec, Ipsun[0], Ipsun[1], Ipsun[2], rotcb.x, rotcb.y, rotcb.z]) @@ -264,9 +264,9 @@ def solar_system_horizons(plname, idval, param, ephemerides_start_date, ds): plab = tlab.copy() if idval is None: - plid = np.array([planetid[key]], dtype=int) + 1 + plid = np.array([planetid[key]], dtype=int) else: - plid = np.array([idval]+1, dtype=int) + plid = np.array([idval], dtype=int) # Prepare frames by adding an extra axis for the time coordinate plframe = np.expand_dims(pvec.T, axis=0) @@ -277,7 +277,7 @@ def solar_system_horizons(plname, idval, param, ephemerides_start_date, ds): return ds -def vec2xr(param, names, idvals, v1, v2, v3, v4, v5, v6, GMpl=None, Rpl=None, rhill=None, Ip1=None, Ip2=None, Ip3=None, rotx=None, roty=None, rotz=None, t=0.0): +def vec2xr(param, idvals, namevals, v1, v2, v3, v4, v5, v6, GMpl=None, Rpl=None, rhill=None, Ip1=None, Ip2=None, Ip3=None, rotx=None, roty=None, rotz=None, t=0.0): if param['ROTATION'] == 'YES': if Ip1 is None: diff --git a/python/swiftest/swiftest/simulation_class.py b/python/swiftest/swiftest/simulation_class.py index f3047fa71..3a3834434 100644 --- a/python/swiftest/swiftest/simulation_class.py +++ b/python/swiftest/swiftest/simulation_class.py @@ -74,7 +74,7 @@ def add(self, plname, date=date.today().isoformat(), idval=None): return - def addp(self, idvals, t1, t2, t3, t4, t5, t6, GMpl=None, Rpl=None, rhill=None, Ip1=None, Ip2=None, Ip3=None, rotx=None, roty=None, rotz=None): + def addp(self, idvals, namevals, t1, t2, t3, t4, t5, t6, GMpl=None, Rpl=None, rhill=None, Ip1=None, Ip2=None, Ip3=None, rotx=None, roty=None, rotz=None): """ Adds a body (test particle or massive body) to the internal DataSet given a set up 6 vectors (orbital elements or cartesian state vectors, depending on the value of self.param). Input all angles in degress @@ -99,7 +99,7 @@ def addp(self, idvals, t1, t2, t3, t4, t5, t6, GMpl=None, Rpl=None, rhill=None, """ t = self.param['T0'] - dsnew = init_cond.vec2xr(self.param, idvals, t1, t2, t3, t4, t5, t6, GMpl, Rpl, rhill, Ip1, Ip2, Ip3, rotx, roty, rotz, t) + dsnew = init_cond.vec2xr(self.param, idvals, namevales, t1, t2, t3, t4, t5, t6, GMpl, Rpl, rhill, Ip1, Ip2, Ip3, rotx, roty, rotz, t) if dsnew is not None: self.ds = xr.combine_by_coords([self.ds, dsnew]) return