## gr2stn()

This function is a grid-to-station interpolator. It creates "station" data by taking a 1-dimensional sample from a gridded data set and interpolating to a given location. That location may be provided by specifying a longitude and a latitude, or by providing a station expression.

`gr2stn(grid_expr, lon, lat <,-a>)`
or
`gr2stn(grid_expr, stn_expr <,-a>)`

where:

`grid_expr` is a GrADS expression that gives a grid result. The interpolation will be done on this data.

`stn_expr` is a GrADS expression that gives a station data result. The interpolation will be done to the station location, the value of the station data is not used.

`lon,lat` may be used instead of `stn_expr` to specify the location to which the gridded data will be interpolated.

### Usage Notes

1. The interpolation will work when only one dimension is varying (either Z or T).

2. The result of the function is station data. The interpolation is done bi-linearly within the grid space. No weighting is done to account for real-world coordinate systems.

3. Use the -a option to return a value even if the location is not completely surrounded by grid points.

4. See the section of the User's Guide on Arbitrary Cross Sections for more information on applications of `gr2stn`.

   ### Examples

   1. To examine the difference between an analysis (ie, gridded data) and the original observations, one could:

        `d t.3-gr2stn(t.1,t.3)`

        where file 1 is gridded data, and file 3 is station data. The result would displayas differences at the station locations.

   2. If one wanted to display the difference calculated in Example 1 as a contour field, one can use the `oacres` function to do a quick analysis of the station values:

        `d oacres(t.1,t.3-gr2stn(t.1,t.3))`