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

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed a typo and check to make sure that IN_FORM is used when generating labels for input data, rather than OUT_FORM
  • Loading branch information
daminton committed Aug 27, 2021
1 parent 9af4c72 commit 74fd250
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion python/swiftest/swiftest/init_cond.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,12 @@ def vec2xr(param, idvals, namevals, v1, v2, v3, v4, v5, v6, GMpl=None, Rpl=None,
if ispl and rhill is None and param['RHILL_PRESENT'] == 'YES':
print("rhill is required.")
return None


# Be sure we use the correct input format
old_out_form = param['OUT_FORM']
param['OUT_FORM'] = param['IN_FORM']
clab, plab, tlab = swiftest.io.make_swiftest_labels(param)
param['OUT_FORM'] = old_out_form
vec = np.vstack([v1, v2, v3, v4, v5, v6])
if ispl:
vec = np.vstack([vec, GMpl, Rpl])
Expand Down
2 changes: 1 addition & 1 deletion python/swiftest/swiftest/simulation_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def addp(self, idvals, namevals, t1, t2, t3, t4, t5, t6, GMpl=None, Rpl=None, rh
"""
t = self.param['T0']

dsnew = init_cond.vec2xr(self.param, idvals, namevales, t1, t2, t3, t4, t5, t6, GMpl, Rpl, rhill, Ip1, Ip2, Ip3, rotx, roty, rotz, t)
dsnew = init_cond.vec2xr(self.param, idvals, namevals, 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 74fd250

Please sign in to comment.