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

Commit

Permalink
Tweaked fragmentation movie script to make the movies a bit more fast…
Browse files Browse the repository at this point in the history
…-paced
  • Loading branch information
daminton committed Nov 29, 2022
1 parent 1603e3e commit 0d41a93
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/Fragmentation/Fragmentation_Movie.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def animate(i,ds,movie_title):
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)
sim.run(dt=1e-8, tstop=1.e-5)
sim.run(dt=1e-8, tstop=2.e-5)

# Calculate the number of frames in the dataset.
nframes = int(sim.data['time'].size)
Expand All @@ -147,5 +147,6 @@ def animate(i,ds,movie_title):
# Set up the figure and the animation.
fig, ax = plt.subplots(figsize=(4,4))
# Generate the movie.
ani = animation.FuncAnimation(fig, animate, fargs=(sim.data, movie_titles[style]), interval=1, frames=nframes, repeat=False)
nskip = 10
ani = animation.FuncAnimation(fig, animate, fargs=(sim.data, movie_titles[style]), interval=1, frames=range(0,nframes,nskip), repeat=False)
ani.save(movie_filename, fps=60, dpi=300, extra_args=['-vcodec', 'libx264'])

0 comments on commit 0d41a93

Please sign in to comment.