From bf825df249c031a96985166631de70197b330e8f Mon Sep 17 00:00:00 2001 From: Thibault Barnouin Date: Fri, 19 Nov 2021 15:55:50 +0100 Subject: [PATCH] change save display step --- lib/LeapFrog.py | 2 +- lib/objects.py | 1 - lib/plots.py | 4 ++-- main.py | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/LeapFrog.py b/lib/LeapFrog.py index f8e937b..6c12ac1 100644 --- a/lib/LeapFrog.py +++ b/lib/LeapFrog.py @@ -58,7 +58,7 @@ def leapfrog(dyn_syst, bin_syst, duration, dt, recover_param=False, display=Fals sma[j] = bin_syst.sma ecc[j] = bin_syst.ecc - if display and j % 5 == 0: + if display and j % 50 == 0: # display progression if len(dyn_syst.bodylist) == 1: d.on_running(dyn_syst, step=j, label="step {0:d}/{1:d}".format(j, N)) diff --git a/lib/objects.py b/lib/objects.py index ece7f39..0fcbc90 100755 --- a/lib/objects.py +++ b/lib/objects.py @@ -143,4 +143,3 @@ class System(Body): else : sma = np.nan return sma - diff --git a/lib/plots.py b/lib/plots.py index 1622943..ec924dc 100755 --- a/lib/plots.py +++ b/lib/plots.py @@ -8,6 +8,7 @@ import time import matplotlib.pyplot as plt from lib.units import * + class DynamicUpdate(): #Suppose we know the x range min_x = -1 @@ -39,7 +40,6 @@ class DynamicUpdate(): 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_zaxis.set_pane_color((0,0,0,0)) - def launch(self, blackstyle=True): #Set up plot @@ -94,7 +94,7 @@ class DynamicUpdate(): #We need to draw *and* flush self.fig.canvas.draw() 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") def close(self): diff --git a/main.py b/main.py index b419261..b491699 100755 --- a/main.py +++ b/main.py @@ -31,7 +31,7 @@ def main(): integrator = "leapfrog" n_bodies = 2 - display = True + display = False savename = "{0:d}bodies_{1:s}".format(n_bodies, integrator) #simulation start