with iris

とりあえず以下のスクリプトで動いて図も描けた.

import iris

from eofs.iris import Eof

import matplotlib.pyplot as plt

import iris.plot as iplt

import iris.quickplot as qplt

filename='/data/CMIP5/org_nc_xyzt/MIROC-ESM/tos_Omon_MIROC-ESM_historical_r1i1p1_185001-200512.nc'

sst = iris.load_cube(filename)

qplt.contourf(sst[0,:,:], 25)

plt.gca().coastlines()

plt.show()

# create a solver class, taking advantage of built-in weighting

solver = Eof(sst, weights='coslat')

# retrieve the first two EOFs from the solver class

plt.subplot(211)

eofs = solver.eofs(neofs=2)

qplt.contourf(eofs[0,:,:], 25)

plt.gca().coastlines()

plt.subplot(212)

qplt.plot(pc[:,0])

plt.show()

The following script works for calculation of EOFs and figure-drawing of it.

import iris

from eofs.iris import Eof

import matplotlib.pyplot as plt

import iris.plot as iplt

import iris.quickplot as qplt

filename='/data/CMIP5/org_nc_xyzt/MIROC-ESM/tos_Omon_MIROC-ESM_historical_r1i1p1_185001-200512.nc'

sst = iris.load_cube(filename)

qplt.contourf(sst[0,:,:], 25)

plt.gca().coastlines()

plt.show()

# create a solver class, taking advantage of built-in weighting

solver = Eof(sst, weights='coslat')

# retrieve the first two EOFs from the solver class

plt.subplot(211)

eofs = solver.eofs(neofs=2)

qplt.contourf(eofs[0,:,:], 25)

plt.gca().coastlines()

plt.subplot(212)

qplt.plot(pc[:,0])

plt.show()