NCL Home > Documentation > Functions > Interpolation

natgrid_Wrap

Interpolates data from an unstructured (randomly-spaced) grid to a rectilinear grid using natural neighbor interpolation and retains metadata.

Prototype

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"  ; This library is automatically loaded
                                                             ; from NCL V6.2.0 onward.
                                                             ; No need for user to explicitly load.

	function natgrid_Wrap (
		x  [*] : numeric,  
		y  [*] : numeric,  
		z      : numeric,  
		xo [*] : numeric,  
		yo [*] : numeric   
	)

	return_val  :  float or double

Arguments

x

An array of length npts containing the X coordinates of the input data points.

For a lat/lon grid, x represents the longitude values.

y

An array of length npts containing the Y coordinates of the input data points.

For a lat/lon grid, y represents the latitude values.

z

An array of any dimensionality (with the last dimension being npts) containing the functional values of the input data points. That is, z(...,i) is the value of the input function at coordinate (x(i),y(i)) for i=0,npts-1.

xo

A 1D array of any length (NumXOut) containing the X coordinates of the output data grid. The values in xo must be increasing, but need not be equally spaced.

For a lat/lon grid, xo represents the output longitude values.

yo

A 1D array of any length (NumYOut) containing the Y coordinates of the output data grid. The values in yo must be increasing, but need not be equally spaced.

For a lat/lon grid, yo represents the output latitude values.

Description

This function is identical to natgrid, except the return value will have metadata added based on metadata attached to z. See the natgrid page for full documentation and examples.

Note: a bug was fixed in NCL V6.5.0 in which this routine was not correctly attaching the metadata for the rightmost two dimensions.