Cssgrid Introduction

About Cssgrid

Cssgrid (Cubic Spline Sphere GRIDder) is a software package in the ngmath library that implements a tension spline interpolation algorithm to fit a function to input data; the input for the interpolation is a set of data specified on a randomly-spaced set of latitude/longitude coordinates. Routines are provided for conversion between latitude and longitude values and Cartesian coordinates on a unit sphere.

Cssgrid is the only algorithm in the ngmath library specifically designed for interpolation on a sphere. See the comparative analysis of the ngmath packages for details on which ngmath package is most appropriate for your problem.

The output from Cssgrid interpolation is a set of values at coordinates on a user-specified grid (which may be a single point).

Functionally equivalent Fortran, C, and NCL interfaces are provided.

Cssgrid is based on the work of Robert Renka and his packages STRIPACK and SSRFPACK. These packages are used here with the permission of Dr. Renka. The user entry points have been changed from those used by Dr. Renka. Also, C and NCL interfaces have been added.

Dr. Renka's articles were published in the ACM Transactions on Mathematical Software, Vol. 23, No 3, September 1997. The original Fortran package STRIPACK is available from netlib as algorithm number 772; the original Fortran package SSRFPACK is available from netlib as algorithm number 773.

General background on interpolation and approximation methods

Computational interpolation and approximation methods can be divided into two basic classes: fitted function methods and weighted average methods.

The fitted function methods fit an algebraic surface to the known data and then pick the interpolated or approximated values from the fitted surface. The weighted average methods calculate interpolated or approximated values as weighted averages of known values.

The interpolation method used in Cssgrid

Cssgrid uses a fitted-function algorithm. Specifically it uses tension splines. Tension splines are an extension of cubic splines whereby a user-specified tension factor controls the fitting function from essentially linear interpolation to pure cubic spline interpolation.

Routines exist in the Cssgrid package to calculate Delaunay triangulations and Voronoi polygons (see the examples). The main interpolation routine (CSSGRID for Fortran, c_cssgrid for C, or cssgrid for NCL) does the triangulation itself, so you need not call the triangulation routine separately unless you specifically want to obtain the triangulation.

Learning how to use Cssgrid

There are entries in the Cssgrid package for: interpolating random data on a sphere to a user-specified grid, converting between latitude/longitude coordinates and the equivalent Cartesian coordinates on a unit sphere, for calculating Delaunay triangulations, for calculating Voronoi polygons, and for setting and retrieving user-specified control parameters. Details on these entries can be found in the Overview of Cssgrid procedures module.

Aspects of the cssgrid algorithm can be modified by using parameter setting routines. These are: CSSETI, CSSETR, or CSSETD for Fortran; c_csseti, c_cssetr, or c_cssetd for C; and cssetp for NCL. Values for control parameters should be set before calling the interpolation routine. All the control parameters have default values that will provide satisfactory results in most situations, so simply calling the main interpolation routine (CSSGRID for Fortran, c_cssgrid for C, or cssgrid for NCL) should suffice in most cases.

For the Fortran and C interfaces, both double precision and single precision entries exist.

home | contents | defs | procedures | examples | errors