change save display step
This commit is contained in:
@@ -58,7 +58,7 @@ def leapfrog(dyn_syst, bin_syst, duration, dt, recover_param=False, display=Fals
|
|||||||
sma[j] = bin_syst.sma
|
sma[j] = bin_syst.sma
|
||||||
ecc[j] = bin_syst.ecc
|
ecc[j] = bin_syst.ecc
|
||||||
|
|
||||||
if display and j % 5 == 0:
|
if display and j % 50 == 0:
|
||||||
# display progression
|
# display progression
|
||||||
if len(dyn_syst.bodylist) == 1:
|
if len(dyn_syst.bodylist) == 1:
|
||||||
d.on_running(dyn_syst, step=j, label="step {0:d}/{1:d}".format(j, N))
|
d.on_running(dyn_syst, step=j, label="step {0:d}/{1:d}".format(j, N))
|
||||||
|
|||||||
@@ -143,4 +143,3 @@ class System(Body):
|
|||||||
else :
|
else :
|
||||||
sma = np.nan
|
sma = np.nan
|
||||||
return sma
|
return sma
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import time
|
|||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
from lib.units import *
|
from lib.units import *
|
||||||
|
|
||||||
|
|
||||||
class DynamicUpdate():
|
class DynamicUpdate():
|
||||||
#Suppose we know the x range
|
#Suppose we know the x range
|
||||||
min_x = -1
|
min_x = -1
|
||||||
@@ -39,7 +40,6 @@ class DynamicUpdate():
|
|||||||
self.ax.w_xaxis.set_pane_color((0,0,0,0))
|
self.ax.w_xaxis.set_pane_color((0,0,0,0))
|
||||||
self.ax.w_yaxis.set_pane_color((0,0,0,0))
|
self.ax.w_yaxis.set_pane_color((0,0,0,0))
|
||||||
self.ax.w_zaxis.set_pane_color((0,0,0,0))
|
self.ax.w_zaxis.set_pane_color((0,0,0,0))
|
||||||
|
|
||||||
|
|
||||||
def launch(self, blackstyle=True):
|
def launch(self, blackstyle=True):
|
||||||
#Set up plot
|
#Set up plot
|
||||||
@@ -94,7 +94,7 @@ class DynamicUpdate():
|
|||||||
#We need to draw *and* flush
|
#We need to draw *and* flush
|
||||||
self.fig.canvas.draw()
|
self.fig.canvas.draw()
|
||||||
self.fig.canvas.flush_events()
|
self.fig.canvas.flush_events()
|
||||||
if not step is None and step%10==0:
|
if not step is None and step%100==0:
|
||||||
self.fig.savefig("tmp/{0:06d}.png".format(step),bbox_inches="tight")
|
self.fig.savefig("tmp/{0:06d}.png".format(step),bbox_inches="tight")
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
|
|||||||
2
main.py
2
main.py
@@ -31,7 +31,7 @@ def main():
|
|||||||
|
|
||||||
integrator = "leapfrog"
|
integrator = "leapfrog"
|
||||||
n_bodies = 2
|
n_bodies = 2
|
||||||
display = True
|
display = False
|
||||||
savename = "{0:d}bodies_{1:s}".format(n_bodies, integrator)
|
savename = "{0:d}bodies_{1:s}".format(n_bodies, integrator)
|
||||||
|
|
||||||
#simulation start
|
#simulation start
|
||||||
|
|||||||
Reference in New Issue
Block a user