X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 27 Jan 2016 11:16 AM by  anon
interpolate irregular 3D grid
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
27 Jan 2016 11:16 AM
    Hi, I am trying to interpolate an atmopsheric model to an altitude grid, and I am totally confused by the interpolation methods, and just can't work out how to do it. I have: lon = fltarr(144) ; 0 to 360 lat = fltarr(96) ; -90 to 90 alt = fltarr(144,96,66) ; calculated from pressure grid and so different at all points. I want to interpolate other property arrays (144,96,66) onto the same lat/lon, and a specific altitude grid (alt_i = fltarr(66)). Currently, I am simply looping over all lats and lons, and using prop_i[lon,lat,*] = interpol(reform(prop[lon,lat,*]), reform(alt[lon,lat,*]), alt_i). I've had to start using a new computer on which this has become extremely slow, and I guess it's probably not as accurate as other methods. I've tried using griddata, but I didn't understand the output, and when I tried to get triangles, it said that my x and y arrays had to be the same length. I also tried grid3, but this takes significantly longer than the simple method before it fails with the nodes co-planar error. I considered interpolate, but this would involved the same amount of use of interpol to get the indices anyway as far as I can tell. I'm sure there must be a way to interpolate this properly, i.e. something with 3 dimensions of different length, where one of the location arrays is 3d, to something with 3 dimensions of different length, where all the location arrays are 1d. Is there anything that can be done? Thanks very much for your help, James

    Deleted User



    Basic Member


    Posts:143
    Basic Member


    --
    27 Jan 2016 01:33 PM
    I thnk that GRID3 routine might be helpful to you: http://www.exelisvis.com/docs/GRID3.html David Starbuck Harris - GS

    Deleted User



    New Member


    Posts:
    New Member


    --
    28 Jan 2016 05:10 AM
    Hi David, thanks for your response. As I said though, I tried GRID3, with lon_xyz = rebin(reform(lon,144,1,1),144,96,66) lat_xyz = rebin(reform(lat,1,96,1),144,96,66) alt_i_xyz = rebin(reform(alt_i,1,1,66),144,96,66) prop_i = grid3(lon_xyz,lat_xyz,alt,prop,lon,lat,alt_i, dtol=(tried various)) I also tried prop_i = grid3(lon_xyz,lat_xyz,alt,prop,lon_xyz,lat_xyz,alt_i_xyz, dtol=(tried various)) Both versions just give me a "nodes co-planar" error, and just varies how long it tries for depending on the dtol value. If grid 3 was my best option, I'm guessing that it can't be done, but let me know if there's another! thanks again, James
    You are not authorized to post a reply.