dsgrid2s, dsgrid2d

Functions for gridding 2-d data. These routines are part of the Dsgrid package which implements a simple inverse distance weighted interpolation algorithm.


Synopsis

    function dsgrid2s(
        x[*]  : float,
        y[*]  : float,
        z[*]  : float,
        xo[*] : float,
        yo[*] : float
    )

    function dsgrid2d(
        x[*]  : double,
        y[*]  : double,
        z[*]  : double,
        xo[*] : double,
        yo[*] : double
    )

Arguments

x
1D array of any length (npts) containing the X coordinates of the input data points
y
1D array of length npts containing the Y coordinates of the input data points
z
1D array of length npts containing the functional values of the input data points (z(i) is the value of the input function at coordinate (x(i), y(i)) for i=1,npts).
xo
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.
yo
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.

Description

The dsgrid2s and dsgrid2d functions do interpolation from 2D random data to a 2D float array dimensioned numxout x numyout.

Both dsgrid2s and dsgrid2d are called after all of the desired values for control parameters have been set using the procedure dssetp. dsgrid2s is the single precision version and dsgrid2d is the double precision version.


Example

begin

  NUM = 6
  NX = 61
  NY = 61

  xi = (/0.00, 1.00, 0.00, 1.00, 0.40, 0.75/)
  yi = (/0.00, 0.00, 1.00, 1.00, 0.20, 0.65/)
  zi = (/0.00, 0.00, 0.00, 0.00, 1.25, 0.80/)
  xeye =  3.3
  yeye = -3.3
  zeye =  3.3

  xo = new((/NX/),float)
  yo = new((/NY/),float)

;
; Create the output grid.
;
  xinc = 1./(NX-1) 
  yinc = 1./(NY-1) 
  ii = fspan(0.,60.,NX)
  xo = xinc * ii
  yo = yinc * ii
;
; Exponent equals 0.5
;
  dssetp("exp", 0.5)
  output = dsgrid2s(xi, yi, zi, xo, yo)
end

Reference Manual Control Panel

NG4.1 Home, Index, Examples, Glossary, Feedback, Ref Contents, Ref WhereAmI?


$Revision: 1.9 $ $Date: 1999/03/12 20:57:34 $