Assemble data for the 20CRv2c videoΒΆ
The Twentieth Century Reanalysis version 2c provides data on a 2x2 degree grid back to 1851. The data are online and can be downloaded by the IRData library
Script to collect the variables shown for one calendar year:
#!/usr/bin/env python
import datetime
import IRData.twcr as twcr
for var in ('prmsl','uwnd.10m','vwnd.10m','air.2m'):
twcr.fetch(var,datetime.datetime(2009,3,12,6),version='2c')
As well as the weather data, the plot script needs a land-mask file to plot the continents. This script retrieves that.
#!/usr/bin/env python
# Download everything we need except the 20CR data.
# Store it on $SCRATCH
import os
import urllib.request
# Land mask for plots
srce=("https://s3-eu-west-1.amazonaws.com/"+
"philip.brohan.org.ml-gcm/opfc_global_2019.nc")
dst="%s/fixed_fields/land_mask/opfc_global_2019.nc" % os.getenv('SCRATCH')
if not os.path.exists(dst):
if not os.path.isdir(os.path.dirname(dst)):
os.makedirs(os.path.dirname(dst))
urllib.request.urlretrieve(srce, dst)