From 67e03eab8c77b906c74cf20730f611a3376f5a64 Mon Sep 17 00:00:00 2001 From: David A Minton Date: Wed, 14 Dec 2022 11:02:19 -0500 Subject: [PATCH] Fixed radius in movie animation --- examples/Fragmentation/Fragmentation_Movie.py | 10 +++++----- python/swiftest/swiftest/simulation_class.py | 5 ++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/examples/Fragmentation/Fragmentation_Movie.py b/examples/Fragmentation/Fragmentation_Movie.py index 88e275d1d..43822bf25 100644 --- a/examples/Fragmentation/Fragmentation_Movie.py +++ b/examples/Fragmentation/Fragmentation_Movie.py @@ -54,7 +54,7 @@ "supercatastrophic_off_axis": [np.array([0.0, 6.28, 0.0]), np.array([0.5, -6.28, 0.0])], "hitandrun" : [np.array([0.0, 6.28, 0.0]), - np.array([-0.1, -6.28, 0.0])] + np.array([-0.9, -6.28, 0.0])] } rot_vectors = {"disruption_headon" : [np.array([0.0, 0.0, 0.0]), @@ -67,7 +67,7 @@ body_Gmass = {"disruption_headon" : [1e-7, 1e-10], "supercatastrophic_off_axis": [1e-7, 1e-8], - "hitandrun" : [1e-7, 7e-10] + "hitandrun" : [1e-7, 1e-10] } density = 3000 * swiftest.AU2M**3 / swiftest.MSun @@ -139,7 +139,7 @@ def setup_plot(self): scale_frame = abs(rhy1) + abs(rhy2) ax = plt.Axes(fig, [0.1, 0.1, 0.8, 0.8]) - self.ax_pt_size = self.figsize[0] * 0.8 * 72 / (np.sqrt(2)*scale_frame) + self.ax_pt_size = self.figsize[0] * 0.7 * 72 / scale_frame ax.set_xlim(-scale_frame, scale_frame) ax.set_ylim(-scale_frame, scale_frame) ax.set_xticks([]) @@ -203,8 +203,8 @@ def data_stream(self, frame=0): # Set fragmentation parameters minimum_fragment_gmass = 0.2 * body_Gmass[style][1] # Make the minimum fragment mass a fraction of the smallest body gmtiny = 0.99 * body_Gmass[style][1] # Make GMTINY just smaller than the smallest original body. This will prevent runaway collisional cascades - sim.set_parameter(fragmentation=True, encounter_save="trajectory", gmtiny=gmtiny, minimum_fragment_gmass=minimum_fragment_gmass, verbose=False) - sim.run(dt=1e-3, tstop=1.0e-3, istep_out=1, dump_cadence=1) + sim.set_parameter(fragmentation=True, encounter_save="both", gmtiny=gmtiny, minimum_fragment_gmass=minimum_fragment_gmass, verbose=False) + sim.run(dt=1e-3, tstop=1.0e-3, istep_out=1, dump_cadence=0) print("Generating animation") anim = AnimatedScatter(sim,movie_filename,movie_titles[style],style,nskip=1) \ No newline at end of file diff --git a/python/swiftest/swiftest/simulation_class.py b/python/swiftest/swiftest/simulation_class.py index 9edf289b3..ad816344e 100644 --- a/python/swiftest/swiftest/simulation_class.py +++ b/python/swiftest/swiftest/simulation_class.py @@ -2713,7 +2713,8 @@ def read_output_file(self,read_init_cond : bool = True): param_tmp['BIN_OUT'] = os.path.join(self.simdir, self.param['BIN_OUT']) if self.codename == "Swiftest": self.data = io.swiftest2xr(param_tmp, verbose=self.verbose) - if self.verbose: print('Swiftest simulation data stored as xarray DataSet .data') + if self.verbose: + print('Swiftest simulation data stored as xarray DataSet .data') if read_init_cond: if self.verbose: print("Reading initial conditions file as .init_cond") @@ -2725,6 +2726,8 @@ def read_output_file(self,read_init_cond : bool = True): self.read_encounters() self.read_collisions() + if self.verbose: + print("Finished reading Swiftest dataset files.") elif self.codename == "Swifter": self.data = io.swifter2xr(param_tmp, verbose=self.verbose)