David Fanning wrote:
> Kenneth P. Bowman writes:
>
> > > Compute the "interpolation coordinates" from the original grid
> > > j =EF=BF=BD=3D VALUE_LOCATE(y_original, y)
> > > yj =3D j + (y - y_original[j])/(y_original[j+1] - y_original[j])
>
> To tell you the truth, I can't get this to work at all. :-(
>
> IDL> lat =3D [-87.5, 50, 25, 0, 30, 45, 64, 87.5]
> IDL> y =3D Scale_Vector(findgen(7), -87.5, 87.5)
> IDL> j =3D Value_Locate(lat, y)
> IDL> yj =3D j + (y - lat[j])/(lat[j+1] - lat[j])
> % Program caused arithmetic error: Floating illegal operand
> IDL> print, yj
> 0.000000 0.212121 0.424242 3.00000 3.97222 5.70175 -NaN
Try:
IDL> print,interpol(findgen(8),lat,y)
0.00000 0.212121 0.424242 3.00000 3.97222
5.70175 7.00000
Cheers,
Paolo
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Se****e ma de ni thui. ("Perhaps thou speakest truth.")


|