In [1]:
%pylab inline
rcParams['figure.figsize'] = (10,6)
from lagranto import Tra

Populating the interactive namespace from numpy and matplotlib

Loading trajectories using Tra

In [2]:
filename = 'data/lsl_20070119_12_ana_48'
trajs = Tra(filename)
print trajs
print trajs.shape

         303 trajectories with 9 time steps. 
         Available fields: time/lon/lat/p/Q/RH/TH/PV/P/LABEL
         total duration: 2880.0 minutes
(303, 9)

Play around with the data

  • Explore the data using Notebook feature like !, tab-completation on trajs.
  • print the time of the first trajectorie using trajs['time']
  • print the pressure at the starting time of all trajectories

In [1]:

Interpolate PV on evenly spaced pressure level

Interpolate at each 50hPa pressure level between 1000hPa and 200hPa

Hint: Use the scipy.interpolate module

In [ ]:

Plot the mean, mean + std, mean - std of PV interpolated on pressure levels

Use the decreasing pressure as x axis hint:

  • use np.nanmean and np.nanstd
  • use matplotlib fill_bewteen function

In [ ]:

Plot the same paramaters as above for TH, RH, PV, Q in a 4x4 plot

Hint : use the AxesGrid class from the mpl_toolkits.axes_grid1 module

In [ ]:

Do a scatter plot of Q versus PV, with points colored by pressure

In [ ]:

Plot TH values at each P level in the form of a boxplot

In [ ]:

Plot the trajectories on a map

hint : Use the Basemap class from the mpl_toolkits.basemap module

In [ ]:

Plot the trajectories on a map, coloring them with pressure

hint : Use the LineCollection class from matplotlib.collections module

In [ ]: