Commit cc1b231e authored by Simeon Doetsch's avatar Simeon Doetsch

Animation: save memory after frame generation

parent cfa58bb3
import matplotlib.pyplot as plt
import multiprocessing
import os
import subprocess
import matplotlib.pyplot as plt
# local imports
from .plutodata import PlutoData
from .simulation import Simulation
def parameter_generator(sim: Simulation, plot_func, output_path,
plot_args: dict={'vmin': None, 'vmax': None},
save_args: dict={'bbox_inches': 'tight'}):
......@@ -16,6 +19,7 @@ def generate_frame(sim, i, plot_func, output_path, plot_args, save_args):
fig = plot_func(sim[i], **plot_args)
fig.savefig(f"{output_path}{i:04d}.png", **save_args)
del sim[i]
def render_frames_parallel(sim: Simulation, plot_func, output_path: str='',
plot_args: dict={'vmin': None, 'vmax': None},
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment