7.1) Contour Plots
In order to make a contour plot we must first read in a 2D data set. Copy the procedure read_eg_ecmwf.pro to your IDL directory together with the files 20070626_t.dat, 20070626_q.dat, 20070626_lat.dat and 20070626_lon.dat.
Call this procedure by typing the following:
read_eg_ecmwf, lat, lon, t, q
The variables you have just read in are:
- q - A four-dimensional array containing water vapour mixing ratios (kg/kg). The dimensions are (lon, lat, altitude, time)
- t - A four-dimensional array containing temperature (K). The dimensions are (lon, lat, altitude, time)
- lat - An array containing the corresponding latitudes
- lon - An array containing the corresponding longitudes
We can contour the water vapour data at a particular altitude (20) and for a particular time (0) by simply using:
contour, q(*,*,20,0), lon, lat
Note that data is only available over part of the world (West Africa), so we need to change the ranges for the axes:
contour, q(*,*,20,0), lon, lat, xrange=[-30,40], yrange=[0,40], xstyle=1