forked from charango/fargo2python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmovie_david.py
More file actions
42 lines (31 loc) · 1.24 KB
/
movie_david.py
File metadata and controls
42 lines (31 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from plot_davidv2 import MyTorque
import matplotlib.animation as animation
import gc
print("coucou")
dark_mode = True
funcanim_map=True
transparent = False
oneshot = False
cmap = 'RdBu_r'
plot_settings = {"tot": False,
"map": True,
"rad": False,
"MULTI": False,
"FT": False}
mytorque = MyTorque(plot_settings, funcanim_map=True)
# mytorque = MyTorque(plot_settings, on_start=0, on_end=1)
def iterate(i):
print(i)
mytorque.curr_on = i + mytorque.on_start
return mytorque.update_plot(i)
ani = animation.FuncAnimation(mytorque.FIGS['map']['fig'], iterate, frames=mytorque.loop_length, interval=1, blit=True, repeat=False)
# ani = animation.FuncAnimation(mytorque.FIGS['map']['fig'], iterate, frames=10,
# interval=1, blit=True, repeat=False)
videopath = f"./output_vids/{mytorque.FIGS['map']['num'].replace(' ','-')}-dark"
ani.save(f"{videopath}.mp4", writer="ffmpeg", fps=6)
# ## SI TROP LOURD
# nb_outputs = mytorque.nb_outputs
# for i in range(nb_outputs):
# mytorque = MyTorque(plot_settings, on_start=i, on_end=i)
# mytorque.FIGS['map']['fig'].savefig(f"./output_movie/map_{i:05}.png", dpi=250)
# gc.collect()