ContourPlot example 5

Creating a map and contour overlay animation

This example was created using NCL commands, and it demonstrates how to read data from a netCDF file, set plot attributes, and generate a color-filled contour plot with a labelbar overlaid on a cylindrical equidistant map projection of the globe. The example also shows how to iteratively loop through the data and generate multiple plots to create an animation. The name of this example is cn05n.ncl.

View this animation..

Discussion

This module discusses how to create this plot using NCL commands. This module also shows how to read netCDF data from a file, create a scalar field data object, a workstation object for output to an NCGM workstation, a contour plot, a labelbar as an annotation object to a contour plot, and a MapPlot object.

Creating the plot using NCL

The NCL script that generates this plot is called cn05n.ncl. This script reads a netCDF data file, sets up the plot data attributes, then draws the first frame of the animation. Once the plot is drawn, the script reads another field of data, draws another frame, and repeats this cycle until it has finished reading all the data.

Detailed script discussion
See the code example for a detailed description of how to create this plot.

The data

The data for this plot is from a netCDF file called meccatemp.cdf. The original data for this plot was generated by Warren Washington (NCAR) and Gerald Meehl (NCAR) for the Model Evaluation Consortium for Climate Assessment (MECCA) project. The MECCA Analysis Team at the Climate Impacts Centre in Sydney, Australia, prepared and archived the data, and previous visualizations of this data by Kendal McGuffie (University of Technology, Sydney) were referenced for selecting appropriate attributes for the plot and animation.

The data file contains a three-dimensional array of temperature data. The dimensions of the temperature variable (t) are time (31), lat (40), and lon (49). Type "ncdump -h meccatemp.cdf" to view the header information for this data file.

How to run this example

This is example is installed in the following location:

$NCARG_LIB/ncarg/nclex/contourplot/cn05n.ncl
You can copy this example and run it by typing "ng4ex cn05n". A copy of the NCL script will be placed in your current working directory and run automatically for you.

You can view the output NCGM file using the NCAR Graphics ctrans utility. )Type "ctrans gmeta".)


Quick Start Guide Control Panel

NG4 Home, Index, Examples, Glossary, Feedback, QSG Contents, QSG WhereAmI?


$Revision: 1.5 $ $Date: 1995/07/26 23:24:31 $