Usage of Climate Data Operators

This example shows you how CDOs are binded in the psyplot package.

It requires the 'demo.nc' netCDF file and the psy-maps plugin.


In [1]:
import psyplot.project as psy
%matplotlib inline

In [2]:
cdo = psy.Cdo()
lines = cdo.fldmean(input='-sellevidx,1 demo.nc', plot_method='lineplot', name='t2m',
                    fmt=dict(xticks='month', xticklabels='%b %Y'))


DatetimeIndex(['1979-01-31 18:00:00', '1979-02-28 18:00:00',
               '1979-03-31 18:00:00', '1979-04-30 18:00:00',
               '1979-05-31 18:00:00'],
              dtype='datetime64[ns]', name='time', freq=None)

In [3]:
maps = cdo.timmean(input='demo.nc', name='t2m', plot_method='mapplot', fmt=dict(cmap='RdBu_r'))



In [4]:
psy.close('all')

In [ ]: