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

Commit

Permalink
Finally got the body radius correct in the movies (I think)
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Dec 5, 2022
1 parent efdd8e6 commit 731a8f5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/Fragmentation/Fragmentation_Movie.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,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 = figsize[0] * 0.8 * 72 / scale_frame
self.ax_pt_size = figsize[0] * 0.8 * 72 / (2 * scale_frame)
ax.set_xlim(-scale_frame, scale_frame)
ax.set_ylim(-scale_frame, scale_frame)
ax.set_xticks([])
Expand All @@ -140,7 +140,7 @@ def center(Gmass, x, y):
Gmass, rh, point_rad = next(self.data_stream(frame))
x_com, y_com = center(Gmass, rh[:,0], rh[:,1])
self.scatter_artist.set_offsets(np.c_[rh[:,0] - x_com, rh[:,1] - y_com])
self.scatter_artist.set_sizes(point_rad)
self.scatter_artist.set_sizes(point_rad**2)
return self.scatter_artist,

def data_stream(self, frame=0):
Expand Down Expand Up @@ -180,6 +180,6 @@ def data_stream(self, frame=0):
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, gmtiny=gmtiny, minimum_fragment_gmass=minimum_fragment_gmass, verbose=False)
sim.run(dt=1e-3, tstop=1.0e-2, tstep_out=1e-2, dump_cadence=0)
sim.run(dt=1e-2, tstop=2.0e-2, istep_out=1, dump_cadence=0)

anim = AnimatedScatter(sim,movie_filename,movie_titles[style],nskip=10)
anim = AnimatedScatter(sim,movie_filename,movie_titles[style],nskip=1)

0 comments on commit 731a8f5

Please sign in to comment.