In this example we work through the following steps:
1. Import the cf package.
import cf
2. Read a field from disk and find a summary of its contents.
f = cf.read('cru_ts3.22.2001.2010.pre.dat.nc')
f
print f
3. Take a latitute-longitude slice of the field.
g = f.subspace[0]
g
4. Import the cfplot package.
%matplotlib inline
import cfplot as cfp
5. Create a blockfill plot of the latitude-longitude slice.
cfp.con(g, blockfill=True)
6. Read in a second field and find a summary of its contents.
g = cf.read('N96_DJF_precip_means.nc')
g
print g
7. Check the cyclicity of the fields are set correctly.
f.iscyclic('X')
f.cyclic('X', period=cf.Data(360, 'degrees'))
f.iscyclic('X')
g.iscyclic('X')
g.cyclic('X', period=cf.Data(360, 'degrees'))
g.iscyclic('X')
8. Regrid the first field to the grid of the second conservatively and find a summary of the resulting field's contents.
h = f.regrids(g)
h
print h
9. Plot a latitute-longitude slice of the field.
cfp.con(h.subspace[0], blockfill=True)