function momentcube,incube ;------------------------------------------ ;Generates a cube of the moments of a set of data, INCUBE ;See help in IDL on the MOMENT function for more detail. The ;routine takes the moments for data with constant third dimension. ;------------------------------------------ outcube=fltarr(4,16) for q=0,15 do begin cub=incube(*,*,q) pointer=where((cub ne 99999.0)*finite(cub)) dit=cub(pointer) outcube(*,q)=moment(dit) outcube(1,q)=sqrt(outcube(1,q)) endfor return,outcube end