FUNCTION integrate, array ; Integrate array and return results in iarray. ; Must check to make sure this is the exact reverse of the deriv function. ; Don't forget that to recover the original array from the derivitives, ; you have to add back in the starting value of the original array - ; the constant of integration a_size = n_elements(array) iarray = array iarray(0) = array(0) for i = 1L,a_size-1 do begin iarray(i) = iarray(i-1) + array(i-1) endfor return, iarray end