# Re: Question of natgrid

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon May 16 2011 - 13:33:16 MDT

natgrid and dspnt2 are designed to interpolate triplets
(x[*], y[*], z[*]) to rectilinear grids as indicated by the documentation.

linint2_points interpolates from a rectilinear grid to
arbitrarily specified coordinate pairs using bilinear
interpolation.

```----
can your problem be described in the following manner?
M = 161  , lat(M), lon(M), z(M)
N = 45320, LAT(N), LON(N)    , LAT/LON are irregular (random)
Interpolate, the 'random' {lat,lon,z} triplet to a 'random'
{LAT,LON,Z} triplet?
If so,  currently, there is no built-in function in NCL that does this.
----
On 5/16/11 12:56 PM, Debasish wrote:
> 1. "linint2_points" is required monotonically increasing arrays for
> latitude and longitude, so you need to rearrange your data if your lat
> and lon are not monotonically increasing array.
>
> 2. fi is the grided input data with dimension latitude and longitude
> i,e, fi (nyixnxi) where, nyi is the dimension of latitude and nxi of the
> dimension of longitude
>
> Thanks
>
> Debasish
>
>
> On 2011-05-16, at 14:15, wei chih chen wrote:
>
>>
>> Hi users,
>> Thanks for your suggestion. I have two question of the variable in
>> 'linint2_points'. First, it said x and y are a strictly monotonically
>> increasing array. Does it mean than I need to rearrange my data by
>> monotonically increasing first?
>> Second, my fi is the value I want to interpolate. I don't understand
>> what it means by that the two rightmost dimensions (/nyi/ x /nxi/) are
>> the dimensions to be used in the interpolation. Could you explain me
>> how I should revise my fi to do the linint2_points. Thank you.
>>
>>
>> On Mon, May 16, 2011 at 8:44 AM, <debasish@sca.uqam.ca
>> <mailto:debasish@sca.uqam.ca>> wrote:
>>
>>     "natgrid" interpolates from 2D random data to get values on a
>>     rectangular
>>     output grid, therefore, if you like to interpolate to a grid with
>>     lat(nlat) and lon(mlon), then the output dimension should be
>>     nlatxmlon.
>>     But I believe you like to interpolate to arbitrarily specified
>>     coordinate
>>
>>     Also check
>>     http://www.ncl.ucar.edu/Document/Functions/interp.shtml
>>     http://www.ncl.ucar.edu/Document/Functions/regrid.shtml
>>
>>
>>     Thanks
>>
>>     Debasish
>>
>>
>>     > Hi users,
>>     > I have a question about natgrid interpolation. When I use natgrid to
>>     > interpolate, I give 100 new coordinates to interpolate. However,
>>     I got
>>     > 100X100 new value after interpolation. Could anyone please
>>     explain me why
>>     > I
>>     > get 10000 new values instead of 100 new values? My goal is
>>     interpolate 161
>>     > value with lat and lon to 45320 new coordinates. When I try to
>>     use 45320
>>     > new
>>     > coordinates in the script, the program will crash because of huge
>>     > calculation (45320x45320?). My new coordinates is irregularly
>>     spaced grid.
>>     > Thus, I have tried dspnt2 for interpolation, but the result is not
>>     > satisfying. Except dspnt2 and natgrid, could anyone please give
>>     me some
>>     > advice to process the interpolation? Thank you.
>>     >
>>     > --
>>     > Best regards
>>     > Wei-Chih
>>     > _______________________________________________
>>     > ncl-talk mailing list
>>     > List instructions, subscriber options, unsubscribe:
>>     > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>     >
>>
>>
>>
>>
>>
>> --
>> Best regards
>> Wei-Chih
>>
>>
>>
>>
>> --
>> Best regards
>> Wei-Chih
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
```
Received on Mon May 16 13:33:26 2011

This archive was generated by hypermail 2.1.8 : Tue May 17 2011 - 15:11:27 MDT