Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added 08-31-2022.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/08-31-2022.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/animation.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion src/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import imageio as iio
import os
import numpy as np

def create_gif(filename_save):
"""This function creates a gif animation from a folder of png images
Expand All @@ -15,8 +16,14 @@ def create_gif(filename_save):
#makes a list of im NumPy arrays based on a list of .png images (read from folder)
images = list()

#changes to ensure propper order of figures in gif
filenames=sorted(os.listdir('img'))
international_dates=[file[-8:-4]+'-'+file[0:-9] for file in filenames]
idxs=np.argsort(international_dates)
sorted_filenames=np.array(filenames)[idxs]

#this part looks at the img directory and reads in all the files that end with .png (only going to bring in those)
for filename in sorted(os.listdir('img')):
for filename in sorted_filenames:
if filename[-4:] == '.png' and not filename == 'comparison.png':
f = os.path.join('img',filename)
im = iio.imread(f)
Expand Down