Interpolation problem [message #36824] |
Mon, 03 November 2003 03:21  |
sdj
Messages: 20 Registered: November 2003
|
Junior Member |
|
|
Dear All,
I have a problem with interpolating data, neither of the IDL functions
INTERPOLATE/INTERPOL/BILINEAR seem to work.
I have a 2-d array on a regular grid with valid values which are all
+ve. Non valid values are set to -9999 and some 'intermediate' values
I
would like to interpolate are set to -1.
How can I interpolate over the x, y grid the 'intermediate' values set
to -1 without taking into account the non-valid values ?
I've tried the following, but it does not work (my output values are
exactly the same as my input values).
;a is a fltarr(x, y) -> 'a' being meteorological values at 'x' lon
;and 'y' lat
nx = n_elements(a(*, 0)) ; no. elements x
ny = n_elements(a(0, *)) ; no. elements y
d = where(a EQ -1, count1) ; find 1-d index of values to be
interpolated
xd = d mod nx ;x index of values to be interpolated
yd = d / nx ; y index of values to be interpolated
;I "try" to have the a(xd, yd) values interpolated, but my output
;values are exactly the same as my input values
int_val = INTERPOLATE(a, xd, yd, missing = -9999)
INTERPOL and BILINEAR don't work either, have you got any idea of how
to do this sort of operation ?
Thanks in advance for the help.
Best Regards,
Pepe
|
|
|