;----------------------------------------------------------------- ; integrate.pro ; ; written by Andreas Reigber ;------------------------------------------------------------------ ; Integrates a 1D-array ; ; Usage: ; res = integrate(arr) ;------------------------------------------------------------------ ; This software has been released under the terms of the GNU Public ; license. See http://www.gnu.org/copyleft/gpl.html for details. ;------------------------------------------------------------------ function integrate,array s=size(array) if s(0) ne 1 then begin print,"Array not one-dimensional" return,-1 endif anz = s(1) back=array-array back[0]=array[0] for i=1,anz-1 do back[i]=back[i-1]+array[i] return,back end