next up previous contents index
Next: B.3 Sun raster files Up: B.2 2-D grdfiles Previous: B.2.2.2 Pixel registration   Contents   Index


B.2.3 Boundary Conditions for operations on grids

GMT has the option to specify boundary conditions in some programs that operate on grids (grdsample -–L; grdgradient -L; grdtrack -L; nearneighbor -L; grdview -–L). The boundary conditions come into play when interpolating or computing derivatives near the limits of the region covered by the grid. The default boundary conditions used are those which are ``natural'' for the boundary of a minimum curvature interpolating surface. If the user knows that the data are periodic in x (and/or y), or that the data cover a sphere with x,y representing longitude,latitude, then there are better choices for the boundary conditions. Periodic conditions on x (and/or y) are chosen by specifying x (and/or y) as the boundary condition flags; global spherical cases are specified using the g (geographical) flag. Behavior of these conditions is as follows:

Periodic
conditions on x indicate that the data are periodic in the distance ( $x_{max} - x_{min}$) and thus repeat values after every $N = (x_{max} - x_{min})/x_{inc}$. Note that this implies that in a grid-registered file the values in the first and last columns are equal, since these are located at $x = x_{min}$ and $x = x_{max}$, and there are N + 1 columns in the file. This is not the case in a pixel-registered file, where there are only N and the first and last columns are located at $x_{min} + x_{inc}/2$ and $x_{max} - x_{inc}/2$. If y is periodic all the same holds for y.

Geographical
conditions indicate the following:

  1. If $(x_{max} - x_{min}) \geq 360$ and also 180 modulo $x_{inc} = 0$ then a periodic condition is used on x with a period of 360; else a default condition is used on the x boundaries.

  2. If condition 1 is true and also $y_{max} = 90$ then a ``north pole condition'' is used at $y_{max}$, else a default condition is used there.

  3. If condition 1 is true and also $y_{min} = -90$ then a ``south pole condition'' is used at $y_{min}$, else a default condition is used there.

``Pole conditions'' use a 180$^{o}$ phase-shift of the data, requiring 180 modulo $x_{inc} = 0$.

Default
boundary conditions are


\begin{displaymath}\nabla^2 f = \frac{\partial}{\partial n} \nabla^2 f = 0 \end{displaymath}

on the boundary, where $f(x, y)$ is represented by the values in the grid file, and $\partial/\partial n$ is the derivative in the direction normal to a boundary, and


\begin{displaymath}\nabla^2 = \left(\frac{\partial^2}{\partial x^2} + \frac{\partial^2}{\partial y^2}\right) \end{displaymath}

is the two-dimensional Laplacian operator.


next up previous contents index
Next: B.3 Sun raster files Up: B.2 2-D grdfiles Previous: B.2.2.2 Pixel registration   Contents   Index
Paul Wessel 2001-04-18