2 import matplotlib.pyplot
as plt
3 from FlowAnimation
import FlowAnimation
13 script_path = os.path.dirname(os.path.realpath(__file__))
14 option_dict_path = os.path.join(script_path,
'data/options.pkl')
15 with open(option_dict_path,
'rb')
as f:
16 kwargs = pickle.load(f)
23 run_path = sys.argv[1]
24 frame_min = int(sys.argv[2])
25 frame_max = int(sys.argv[3])
26 interval = int(sys.argv[4])
32 rank = comm.Get_rank()
33 size = comm.Get_size()
36 fig = plt.figure(figsize=(15, 8))
39 frame_dir=f
'{run_path}/frames'
40 if not os.path.exists(frame_dir):
49 frames = np.arange(frame_min,frame_max)[rank::size]
51 for ii
in tqdm(frames):
61 if ((rank == 0)
and create_movie):
62 os.system(f
'ffmpeg -y -r {interval} -start_number {frame_min} -i {frame_dir}/frame_%d.png {run_path}/flow.mp4')