The DERIV function treats a 2-dimensional array as a vector - Reading left to right and top to bottom. Consider the following:
IDL> x = findgen(16)
IDL> y = randomu(seed,16)
IDL> print, deriv(x,y)
% Compiled module: DERIV.
0.173069 0.0833770 0.0859829 -0.181817 0.139804 0.256416 -0.341754 0.00444040 0.205324 -0.266507
0.0295178 0.392275 -0.291976 -0.398254 0.0532303 0.164015
IDL> x = reform(x,4,4) & y = reform(y,4,4)
IDL> print, deriv(x,y)
0.173069 0.0833770 0.0859829 -0.181817
0.139804 0.256416 -0.341754 0.00444040
0.205324 -0.266507 0.0295178 0.392275
-0.291976 -0.398254 0.0532303 0.164015
IDL>
|