Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Fixed radius in movie animation
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Dec 14, 2022
1 parent 632d6dc commit 67e03ea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 5 additions & 5 deletions examples/Fragmentation/Fragmentation_Movie.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]),
Expand All @@ -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
Expand Down Expand Up @@ -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([])
Expand Down Expand Up @@ -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)
5 changes: 4 additions & 1 deletion python/swiftest/swiftest/simulation_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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)
Expand Down

0 comments on commit 67e03ea

Please sign in to comment.