Re: [idvusers] Grid interpolation in IDV


On 1/3/13 9:24 PM, Paul Graham wrote:
Thanks for the method you posted for finding a field value at a lat/lon.  I
tried it and it worked a treat!  A function that returns a field value at a
specific point would be very useful in diagnoses.  Perhaps one could be
included as part of one of the IDV Jython System libraries?

If you had a timeseries of grids, what would you want the output to be? There is a method GridUtil.sample(grid, LatLonPoint, sampling_method) that could be used to sample and not worry about the structure of the grid (2D, etc) or whether it was a time series or not. I could see having a jython function:

sampleGrid(grid, lat, lon, sampling_method=0, time=-1)

which would sample at the lat/lon point and allow you to set the sampling method (nearest neighbor or weighted average) and the time index (-1 would return an array of values for all times).

I agree that this would be a nice addition to the IDV grid library.


On 4 January 2013 02:26, Tom Whittaker <whittaker@xxxxxxxx> wrote:

Paul --

The simplest way to extract a value at a given lat/lon location might
be something like this (I'm assuming you're in the Jython Shell at
this point...):

1. a = selectData()
            [then pick your gridded field -- if it's 3D then you'll
need to use the "make2D()"
            function in the Jython library "Grid routines"]

2. assuming there is a "time" dimension, then do:
        b = a[0]

     (if you do a "print len(a)" and the answer is a small number, like
"1", then you likely have a time can also do "print
whatTypes(a)" and get the details of the structure of 'a')

3. then (welcome to the World of VisAD):

       from visad.georef import LatLonTuple

4. now for each point do this:
        print b.evaluate( LatLonTuple( 43., -89.))

(using your own lat/lon values....)


On Wed, Jan 2, 2013 at 11:45 PM, Paul Graham <meteorpaul@xxxxxxxxx> wrote:
Hi Stuart,

In hindsight, contours were not a good example of what I am wanting.
  What I
am wanting is to be able to interpolate gridded data sets, so I can put
in a
lat/lon and obtain a field value, preferably using a Jython method.  It
would be good if IDV has a Jython method that could do this.

Paul Graham

Tom Whittaker
University of Wisconsin-Madison
Space Science & Engineering Center (SSEC)
Cooperative Institute for Meteorological Satellite Studies (CIMSS)
1225 W. Dayton Street
Madison, WI  53706  USA
ph: +1 608 262 2759

idvusers mailing list
For list information, to unsubscribe, visit:

Don Murray