Data files for some examples
Example pages containing:
Contouring one-dimensional X, Y, Z (random) data
If you have X, Y, Z data represented by one-dimensional (1D) arrays of
the same length, then there are a few options on contouring this data:
In all cases
- Simply set the sfXArray and
sfYArray resources to the X and Y
arrays respectively, and pass the 1D Z data to the appropriate gsn_csm
- In NCL V6.4.0 and later, you can set the special
"lat1d" / "lon1d" attributes. See the scripts below called
"contour1d_n_640.ncl" for examples.
- Regrid the data to a two-dimensional (2D) grid using
functions like cssgrid, natgrid and triple2grid. See the Random to Grid examples.
, the quality of the resulting plot will be a function of the
distribution of the X and Y arrays, the number of sampling points
and the 'shape' of the data be contoured.
The data in this example is a one-dimensional (1D) array with
corresponding 1D lat/lon arrays. To contour this data,
you must set both
resources to these lat/lon
arrays respectively. NCL will internally use the
triangular mesh capability to contour this data.
The data files for this example are pw.dat
The second frame of this example shows how to draw markers at the
locations of the random lat, lon data.
This example shows how to contour an ARPEGE grid, which came
to us from Christophe Cassou of Meteo-France.
The data for this example are spread across two NetCDF files. The
resolution is pretty fine, so raster contours (cnFillMode = "RasterFill") are
used. Again, the lat/lon information is provided by setting the
resources sfXArray and sfYArray.
Gridded sea level pressures are read; then, for demonstration
are randomly sampled from the grid using
and small random location
perturbations are added. The resulting lat[*], lon[*], Z[*]
triplet is then contoured using
resources. In this example,
resource is explicitly set to "TriangularMesh". However,
as noted above, this is not necessary.
Note: The input data are on a global grid. Hence, the data are cyclic
in longitude. The resulting plot clearly shows [left and right edges]
that the "TriangularMesh" is not capable of handling this situation.
This example is very similar to the first one on this page, except the
markers are colored according to the labelbar generated by the color
The color contours are made more transparent by
setting cnFillOpacityF to 0.5
(default is 1.0). This will only work in V6.2.0 of NCL, to be released
in winter 2013. The main purpose of this example is to show how to
color the markers based on an existing contour field.