Skip to main content
  • Home
  • Documentation
  • FAQ
  • Downloads
  • Support
  • Current Release Notes
  • Ferret Users Guide
    • Users Guide Index
    • Commands Reference
    • 1. Introduction
    • 2. Data Set Basics
    • 3. Variables & Expressions
    • 4. Grids & Regions
    • 5. Animations & Gif Images
    • 6. Customizing Plots
    • 7. Handling String Data Symbols
    • 8. Working with Special Data Sets
    • 9. Computing Environment
    • 10. Converting to NetCDF
    • 11. Writing External Functions
    • Glossary
    • Appendix A: Functions
    • Appendix B: PPLUS Guide
    • Appendix C: Ferret-Specific PPLUS Enhancements
  • Previous Release Notes
  • Tutorials and Demos
    • Ferret Tour
    • DSG files: Discrete Sampling Geometries Demo
    • Ferret sorting demo
    • Fast Fourier Transforms demo
    • Empirical Orthogonal Functions demo
    • Ferret objective analysis demo
    • Ferret Palette Demo
    • Map projections
    • Ferret polygon vector demo
    • Ferret Graticules demo
    • Ferret Polytube Demo
    • Ferret Polymark Demo
    • Ferret Constant-Array demo
    • Ferret land_detail demo
    • COADS Tour
    • Levitus Tour
    • Use OPeNDAP
    • Ferret binary read demo
  • PyFerret
    • PyFerret Downloads and Install ../../faq/ferret-faqs.html
    • What is PyFerret?
    • Why use PyFerret?
    • PyFerret for the Ferret user
    • PyFerret command syntax: quick-start notes
    • PyFerret for the Python user
    • Graphics in PyFerret ?
    • New Ferret functionality
    • PyFerret Python functions and constants
    • PyFerret Python objects and methods
    • Ferret external functions in Python
    • Ferret Fortran external functions
    • PyFerret metadata-and-data dictionaries
  • OPeNDAP
    • OPeNDAP usage in Ferret
    • Use OPeNDAP Demo
    • Test OPeNDAP

8.8 CURVILINEAR COORDINATE DATA

By "curvilinear coordinate data" we refer to data which is curvilinear in the XY plane there. We presume that the X,Y coordinates (typically longitude, latitude) are available through other dependent variables.

Here is an example showing a curvilinear grid.

Ch8_fig1.gif

Curvilinear data may be defined by a map projections, or by data in a file that has a curvilinear grid. A curvilinear grid has longitudes and latitudes defined by coordinates (lon[i, j],lat[i, j]) in 2D, and the data fields are also defined on the [i,j] index grid. In the CF standard for netCDF files at http://cfconventions.org, these grids are discussed in the section titled " Two-dimensional latitude, longitude coordinate variables". The netCDF header for a file containing data on a curvilnear grid looks like this (when viewed with the Unix command ncdump -h). Note how the coordinate variables lon and lat are 2-D fields. The coordinate variables and the data field tmp share a grid in index space.  The variable tmp has a "coordinates" attribute listing lon and lat as the coordinate data which define its world-coordinate grid.

 

dimensions:
xc = 180 ;
yc = 173 ;
variables:
float xc(xc) ;
xc:long_name = "x-index in Cartesian system" ;
xc:units = "m" ;
float yc(yc) ;
yc:long_name = "y-index in Cartesian system" ;
yc:units = "m" ;
float lon(yc,xc) ;
lon:long_name = "longitude" ;
lon:units = "degrees_east" ;
float lat(yc,xc) ;
lat:long_name = "latitude" ;
lat:units = "degrees_north" ;
float tmp(yc,xc) ;
tmp:long_name = "temperature" ;
tmp:units = "K" ;
tmp:coordinates = "lon lat" ;
..

When such a dataset is opened in Ferret, the output of a SHOW DATA command will look like:

yes? show data
currently SET data sets:
1> ./tmp.nc (default)
name     title                I      J      K    L
LON longitude                1:180  1:173  ..  ..
LAT longitude                1:180  1:173  ..  ..
TMP temperature              1:180  1:173  ..  ..

 

This data can be plotted with the 3-argument SHADE, FILL or CONTOUR commands

yes? SHADE tmp, lon, lat

You can see what the grid looks like by doing a shade plot of the coordinate variables:

yes? set view ul; shade lon
yes? set view ll; shade lat

 

 

8.8.1 Visualization techniques for curvilinear coordinate data

Visualizations of curvilinear coordinate data in the XY plane section planes are best handled with the 3-argument versions of the SHADE, FILL, and Contour commands. See further information in the chapter "Customizing Plots".

For visualization of curvilinear coordinate data in other planes or orientations use the techniques described under "Analysis techniques for curvilinear coordinate data."

8.2.2 Analysis techniques for curvilinear coordinate data

Analysis of curvilinear coordinate data may be done in the curvilinear coordinate system or in a rectilinear (including lat-long) coordinate system. If the analysis is done in the curvilinear coordinate system, it is the responsibility of the user to ensure that the proper geometric factors are applied when integrals and derivatives are computed. Converting other fields to the curvilinear coordinate system is most easily accomplished with the function RECT_TO_CURV. Curvilinear grids may be converted to rectilinear grids using the functions CURV_TO_RECT_MAP and CURV_TO_RECT.

Data can be sampled from a curvilinear grid at specified locations using one of these functions: SAMPLEXY_CURV , SAMPLEXY_CURV_AVG, or SAMPLEXY_CURV_NRST.