diff --git a/boulder_prcp.gif b/boulder_prcp.gif new file mode 100644 index 000000000..61713753a Binary files /dev/null and b/boulder_prcp.gif differ diff --git a/landing-page.ipynb b/landing-page.ipynb index 50106a3de..a9a548bf0 100644 --- a/landing-page.ipynb +++ b/landing-page.ipynb @@ -15,7 +15,7 @@ "id": "422cec20-f029-427f-97bd-90e147e2eb0f", "metadata": {}, "source": [ - "\"Pretty" + "\"Boulder\n" ] }, { @@ -37,7 +37,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, diff --git a/page_art.py b/page_art.py new file mode 100644 index 000000000..98e137a7e --- /dev/null +++ b/page_art.py @@ -0,0 +1,45 @@ +############################################################################### +# Import packages + +import cartopy.crs as ccrs +import cartopy.feature as cfeature +import matplotlib.animation as animation +import matplotlib.pyplot as plt +import numpy as np +import xarray as xr + +############################################################################### +# Read in the data, file path will need to be updated + +ds = xr.open_dataset('daymet_v3_prcp_2013_na_subset.nc', engine='netcdf4') +prcp = ds.prcp + +# Create figure for plotting, adding land and state features +fig = plt.figure(figsize=(15, 15), frameon=False) +proj = ccrs.PlateCarree() +ax = plt.axes(projection=proj) +ax.axis('off') +ax.coastlines() +ax.add_feature(cfeature.LAND) +ax.add_feature(cfeature.STATES) + +# Create function to loop over precip data and plot each day +anim_artists = [] # Generate empty list to place plots in + +for prcp_slice in prcp: + cntr = ax.contourf( + prcp_slice.lon, + prcp_slice.lat, + prcp_slice, + transform=proj, + levels=np.arange(0, 55, 2), + ) + anim_artists.append(cntr.collections) + +plt.tight_layout() + +# Call Matplotlib animation function to create gif +anim = animation.ArtistAnimation(fig, anim_artists, interval=500) + +# Uncomment to save gif +# anim.save('boulder_prcp.gif', writer="pillow") diff --git a/setup.cfg b/setup.cfg index 5e3e2a519..57b1dcd7b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,7 +7,7 @@ select = B,C,E,F,W,T4,B9 [isort] known_first_party= -known_third_party= +known_third_party=cartopy,matplotlib,numpy,xarray multi_line_output=3 include_trailing_comma=True force_grid_wrap=0