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

Commit

Permalink
Auto stash before merge of "IO" and "origin/IO"
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Aug 27, 2021
1 parent defb93e commit 0fb9a2c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions python/swiftest/swiftest/init_cond.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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)
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions python/swiftest/swiftest/simulation_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 0fb9a2c

Please sign in to comment.