force grads to interpolate

Brian Doty doty at COLA.IGES.ORG
Sun Dec 2 16:07:16 EST 2007


Patrick, the gr2stn function may do what you need.  It interpolates
from a grid to station locations.  You can use it with x and y
varying (z and t fixed) if you have both a grid and a station data
set, eg:

       d gr2stn(gridvar.1, stnvar.2)

In this case the values at the stations don't matter, the function
just looks at their locations.  One way I used this is to get a quick
look at the difference between a forecast field and the observed
data, eg:

      d stnobs.2 - gr2stn(gridfcst.1, stnobs.2)

You can also use gr2stn to produce z or t sections interpolated to a
specific lat-lon.  In this case the dimension environment must be x
and y fixed (doesn't matter to what) and z or t varying.  In this
case a station data set is not needed...

     set x 1
     set y 1
     set t 1 last
     d gr2stn(gridvar, -90.5, 40.5)

This produces a 1-D grid result (line graph, bar chart, etc) ...Brian

On Dec 2, 2007, at 1:23 PM, Patrick Reuter wrote:

> Dear Brian,
>
> thanks for your answer. Actually, I was just making this simple
> example to get easily understood.
>
> My actual problem is, that I have floating point latitude/logitude
> data for a city, and a WRF model step of 0.0791 latitudes/longitudes.
>
> That is why is was talking about linear interpolation : Taking the 4
> gridpoints that surround the city, and weight the influence of the
> gridpoints wrt the distance.
>
> Does this linear interpolation exist ? Or do I have to find the 4
> gridpoints on my own and do the interpolation ?
>
> I hope this was clear ..
>
> Thanks in advance
>
>    Patrick
>
>
>
> Brian Doty <doty at COLA.IGES.ORG> a écrit :
>
>> If you have one degree data, and want to "interpolate" to lon 90.5,
>> you can use the expression:
>>
>>     display (var(lon=90)+var(lon=91))/2
>>
>> ...Brian
>>
>> On Dec 1, 2007, at 12:39 PM, Patrick Reuter wrote:
>>
>>> Hi everybody,
>>>
>>> maybe this question is pretty basic - but I just can't find it.
>>>
>>> ga-> set lat 90.5
>>> LAT set to 91 91
>>>
>>> How could I force grads to use linear interpolation between the
>>> values
>>> ? I mean, that it takes the values of grid point 90 and 91, and
>>> linearly interpolates, so that I can display the (one dimensional)
>>> data ?
>>>
>>> Thanks in advance !
>>>
>>>  Patrick



More information about the gradsusr mailing list