In [0]:

Load the list of files


In [1]:
import netCDF4

Read the files

  • Use the netCDF4.MFDataset to read a list of file
  • Use the aklay variable in the pressure_cst file as pressure

In [2]:
datapath = '/net/atmos/data/erainterim/cdf/2010/10/pressure_cst'
pfile = netCDF4.Dataset(datapath)
pressure = pfile.variables['aklay'][:]
pfile.close()

Load the data

load temperature and specific humidity


In [4]:
pressure


Out[4]:
array([ 900.,  850.,  800.,  700.,  600.,  500.,  400.,  300.,  250.,
        200.,  100.], dtype=float32)
## Compute the equivalent potential temperature using the following information: Calculate it for the 850 hPa pressure level

Simple equation of the potential temperature $\Theta_{e}$: \begin{equation} \Theta_{e} = T \cdot (1000/P)^{0.286} + 3\cdot w \end{equation}

with T, temperature in K, P the pressure in hPa, w, mixing ratio in g kg$^{-1}$.

The mixing ratio (kg kg$^{-1}$) can be expressed as : \begin{equation} w = \frac{1}{\frac{1}{q_{v}}-1} \end{equation} with $q_{v}$, the specific humidity in kg kg $^{-1}$


In [0]:

Plot $\Theta_{e}$ on a map

  • Use the domain 50W / 20N to 50E / 80N
  • Use m.contourf
  • np.meshgrid can be used to create a grid

In [0]:

Calculate the integrated water vapor flux

$$IVT = \sqrt{\frac{1}{g}\left(\int q_{v}\cdot u\,dp \right)^{2}+ \left(\int q_{v}\cdot v\,dp \right)^{2}}$$
  • use np.trapz to integrate over pressure level

In [0]:

Add IVT contours to the $\Theta_{e}$ plot

  • use m.contour
  • using the YlGnBu colormap for $\Theta_{e}$ is quite nice

In [0]: