28 import swarmng, argparse
31 parser = argparse.ArgumentParser()
32 parser.add_argument(
"-c",
"--config" , help=
"Config file", required =
True)
33 parser.add_argument(
"-d",
"--duration" , help =
"Duration of integration in AU", default=10.0, type=float )
34 args = parser.parse_args()
41 inputFile = cfg[
"input"]
42 snapshotFileName = inputFile +
".snapshot"
47 if path.exists(snapshotFileName) :
51 ext = path.splitext(fn)[1]
58 times = sorted(map(
lambda s : s.time, ens))
59 median_of_system_time = times[len(times)/2]
64 starting_time = median_of_system_time
65 dt = min(float(cfg[
"destination_time"]), starting_time + args.duration)
66 print(
"Integrating from {0} to {1}".format(starting_time, dt))
73 integ.destination_time = dt
78 ens.save_to_bin(snapshotFileName)