;+ ; This procedure smooths a spectrum with a hanning filter ; ; @param dc {in}{required}{type=data container} data container (spectrum or continuum) ; @keyword decimate {in}{optional}{type=keyword} decimate the spectrum? ; ; @examples ;
;    get,index=1
;    a = data_new()
;    data_copy,!g.s[0],a
;    show
;    dchanning,a,/decimate
;    show,a
; 
; ; @version $Id: dchanning.pro,v 1.2 2004/11/17 21:47:51 bgarwood Exp $ ;- pro dchanning,dc,decimate=decimate ; Do the smoothing first oldarr = *dc.data_ptr len = n_elements(oldarr) newarr = oldarr for i=1,len-2 do $ newarr[i] = (oldarr[i-1]+oldarr[i+1])/4.0 + oldarr[i]/2.0 ; Check for decimation if keyword_set(decimate) then dcdecimate,2 end