;+ ;FUNCTION: THM_LSP_FILTER, x, dt, flow, fhigh, db=db ; ; ;PURPOSE: Filters the data COMP*. ; ;INPUT: ; x - NEEDED. Just the data. Not a structure or name. ; dt - NEEDED. Time between points. ; freq - NEEDED. Pole of filter. If band_pass: [f1,f2] f1 0.d if fhigh LE 0 then fhigh = 1.d fmin = min([flow, fhigh]) if fmin eq 0 then fmin = fhigh npts = long(!pi/fmin) > 1 npts = npts < n_elements(x) IF keyword_set(gaussian) then BEGIN nv = npts*2+1 v = dindgen(nv)-(nv-1)/2 cofs = exp(-v*v*fmin*fmin*1.25) cofs = cofs/total(cofs) ENDIF ELSE BEGIN cofs = digital_filter(flow,fhigh,db,npts, /double) if f(0) eq 0 then cofs = cofs/total(cofs) ENDELSE xx = convol(x,cofs,/edge_t,/nan) return, xx END