Sums anarray of n dimensions over one of its dimensions.
dim The dimension over which array is summed. The dim parameter must be a number in the range 0 dim (n-1), where n is the number of dimensions in array.
array1 = FINDGEN(2) array2 = FINDGEN(2,2)
PRINT, array1
0.00000 1.00000
PRINT, array2
0.00000 1.00000
2.00000 3.00000
PRINT, SUM(array1, 0)
1.00000
PRINT, SUM(array2, 0)
1.00000 5.00000
PRINT, SUM(array2, 1)
2.00000 4.00000