Bill,
you just hit a nerve with me. I thought I was the only one having those
trouble. I would love to find out where this error comes from and how to
prevent it. The problem drove me to going external and using ssrfpack and
stripack from netlib to do spherical interpolation. This method is not fool
proof either but at least this way I have the source code and can find out
why an error occurs and, more important, I can determine what it actually
means.
Anyway, this response won't help you much in solving your problem but
supports your case for better documentation of the interpolation routines (I
previously suggested to ITTVIS to write a tutorial on the subject) or, at
the least, more meaningful error messages. (The folks at ITTVIS do read this
newsgroup.)
Good luck,
Haje
"Bill Gallery" <wgallery@aer.com> wrote in message
news:1189535983.796705.67590@o80g2000hse.googlegroups.com...
> I am interpolating satellite data (lat, lon, temperature) from a
> irregular grid to a regular lat, lon grid using:
>
> pro get_gridded_temp_image, ....
> .
> .
> .
> grid_lat=findgen(31)*2.0+30.0 ;30 to 90 deg @2 deg
> grid_lon=findgen(181)*2.0 ;0 to 360 deg @2 deg
> qhull, x, y, tri, /delaunay, sphere = s
> temp_grid = griddata( x, y, z, /sphere, /deg, $
> /grid, xout = grid_lon, yout = grid_lat, $
> method = 'NaturalNeighbor', $
> triangles=tri, $
> missing = !values.f_nan)
>
> where x,y are longitude, latitude, and z is temperature (patterned
> after Example 5 in the IDL help for griddata.pro)
>
> Usually this procedure works fine, over thousands of different cases.
> However, today I tried it and got the error message:
>
> GRIDDATA: Triangle 652 not in counterclockwise order.
> Execution halted at: GET_GRIDDED_TEMP_IMAGE 184
>
> The ranges of the input variables are (mve is a routine that prints
> the stats on a variable):
>
> IDL> mve,x
> Variable type mean std dev minimum
> maximum n_elements NaN or I
> Float 178.55 102.79 0.070000
> 358.05 (529) = 529 0
> IDL> mve,y
> Variable type mean std dev minimum
> maximum n_elements NaN or I
> Float 54.660 19.100 20.340
> 82.930 (529) = 529 0
> IDL> mve,z
> Variable type mean std dev minimum
> maximum n_elements NaN or I
> Float 214.63 9.7416 192.56
> 233.31 (529) = 529 0
> IDL> mve, tri
> Variable type mean std dev minimum
> maximum n_elements NaN or Inf
> Longword integer 249.43 149.12 0.00000
> 528.00 (3,966) = 2898 0
>
>
> Note: I tried the routine sph_scat which is also advertised to regrid
> on a sphere. However, the interpolated values are way off scale:
>
> IDL> r=sph_scat(x,y,z,bounds=[0,30.0,360,90],gs=[2,2],bout=bout)
> IDL> mve,r
> Variable type mean std dev minimum
> maximum n_elements NaN or Inf
> Double float 208.09 96.313 -480.31
> 869.93 (181,31) = 5611 0
>
>
> Any suggestions on how to trouble shoot, fix?
>
> Thanks,
>
> Bill Gallery
>
|