Commit f6f80792 authored by Josh Borrow's avatar Josh Borrow
Browse files

Updated movie script and added it to automatically be ran after the production of snapshots

parent 69c00a44
......@@ -9,15 +9,10 @@ Edit this file near the bottom with the number of snaps you have.
Written by Josh Borrow (
import matplotlib
import os
import h5py as h5
import numpy as np
import scipy as sp
import scipy.interpolate as si
import matplotlib.pyplot as plt
def load_and_extract(filename):
......@@ -67,14 +62,32 @@ def frame(n, *args):
if __name__ == "__main__":
import matplotlib
from tqdm import tqdm
from matplotlib.animation import FuncAnimation
from scipy.stats import gaussian_kde
import matplotlib.pyplot as plt
filename = "kelvinhelmholtz"
dpi = 512
frames = tqdm(np.arange(0, 448))
# Look for the number of files in the directory.
i = 0
while True:
if os.path.isfile("{}_{:04d}.hdf5".format(filename, i)):
i += 1
if i > 10000:
raise FileNotFoundError(
"Could not find the snapshots in the directory")
frames = tqdm(np.arange(0, i))
# Creation of first frame
fig, ax = plt.subplots(1, 1, figsize=(1, 1), frameon=False)
......@@ -8,7 +8,8 @@ then
../swift -s -t 1 kelvinHelmholtz.yml 2>&1 | tee output.log
../swift -s -t 4 kelvinHelmholtz.yml 2>&1 | tee output.log
# Plot the solution
python 6
Supports Markdown
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