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
Renaming package swiftestio to swiftest in anticipation of making the python side of things much more capable (and more Rebound-like)
  • Loading branch information
daminton committed Jun 25, 2021
1 parent eb6d08c commit 54ae399
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ def read_swifter_param(param_file_name):
'GR' : 'NO',
'C2' : "-1.0",
}


# Read param.in file
print(f'Reading Swifter file {param_file_name}')
Expand Down Expand Up @@ -277,6 +278,22 @@ def read_swift_param(param_file_name):

return param

def write_param(param, param_file_name):
outfile = open(param_file_name, 'w')
codename = param['VERSION'].split()[1]
if codename == "Swifter" or codename == "Swiftest":
for key,val in param.items():
print(f"{key:<16} {val}",file=outfile)
elif codename == "Swift":
print(param['T0'],param['TSTOP'],param['DT'], file=outfile)
print(param['DTOUT'], param['DTDUMP'], file=outfile)
print(param['L1'],param['L2'],param['L3'],param['L4'],param['L5'],param['L6'], file=outfile)
print(param['RMIN'],param['RMAX'],param['RMAXU'],param['QMIN'],param['LCLOSE'], file=outfile)
print(param['BINARY_OUTPUTFILE'], file=outfile)
print(param['STATUS_FLAG_FOR_OPEN_STATEMENTS'], file=outfile)
outfile.close()
return

def swifter_stream(f, param):
"""
Reads in a Swifter bin.dat file and returns a single frame of data as a datastream
Expand Down Expand Up @@ -987,4 +1004,4 @@ def swifter2swiftest(swifter_param, outparam):
workingdir = '/Users/daminton/git/swiftest/examples/swift_conversion/'
param_file_name = workingdir + 'param.in'
param = read_swift_param(param_file_name)
param['BIN_OUT'] = workingdir + param['BIN_OUT']
write_param(param,"test.in")

0 comments on commit 54ae399

Please sign in to comment.