function varmap, x ;+ ; NAME: ; VARMAP ; ; PURPOSE: ; Calculate the variance map of a three-dimensional data cube ; ; CATEGORY: ; Image processing ; ; CALLING SEQUENCE: ; value = varmap(ARRAY) ; ; INPUT: ; ARRAY: three-dimensional floating-point data array. The third dimension ; is the number of frames in the data cube. ; ; OPTIONAL INPUT PARAMETERS: ; None ; ; KEYWORD PARAMETERS: ; None ; ; OUTPUT: ; Two-dimensional array containing r.m.s. image (square root from the variance map) ; of the data cube. ; ; COMMON BLOCKS: ; None. ; ; SIDE EFFECTS: ; None. ; ; RESTRICTIONS: ; None. ; ; PROCEDURE: ; The variance is computed as the difference of the mean squared value and the ; square of the mean value. This allows to avoid double scanning of the data cube. ; ; MODIFICATION HISTORY: ; V. Grechnev, 1999. Written. ;- Sz = size(x) if Sz(0) ne 3 then message, 'Argument must be 3-D array' return, sqrt(total(temporary(x*x), 3)/Sz(3) - total(x, 3)^2/Sz(3)^2) end