; Given a number of points and a spacing, return an ; array of the wavelet fourier series and the ; array of frequencies (2 pi/wavelength) for the ; mother wavelet for use with the refractivity. function refr_mother_wL_g, w ; Function for use by refr_mother_wL ; Only defined for 2 pi/3 < w < 8 pi/3 c = 2.*!pi/3. h1 = exp(-(2.*c - w)^(-2.)) h2 = exp(-(w-c)^(-2.)) return, h1/(h1+h2) end function refr_mother_wL, n, d, wL dn = d * n wL=[findgen(n/2)-n/2,findgen(n/2)] * 2. * !pi/dn wabsL = abs(wL) wtimesL = wabsL * 3./!pi ; initialize the return array with zeros. psihatL = complexarr(n) ; fill in case # 1 gd = where (wtimesL gt 2. and wtimesL lt 4., ngd) if ngd gt 0 then begin psihatL[gd] = 1.-refr_mother_wL_g(wabsL[gd]) end ; fill in case # 2 gd = where (wtimesL eq 4., ngd) if ngd gt 0 then begin psihatL[gd] = 1. end ; fill in case # 3 gd = where (wtimesL gt 4. and wtimesL lt 8., ngd) if ngd gt 0 then begin psihatL[gd] = refr_mother_wL_g(wabsL[gd]/2.) end ; multiply by exp(-iw/2) gd = where (wtimesL gt 2. and wtimesL lt 8., ngd) if ngd gt 0 then begin psihatL[gd] = sqrt(psihatL[gd]) * exp(-complex(0,1)*wL[gd]/2.) end return, psihatL end pro refr_mother_wL_test n = 256 d = 20./n psihatL = refr_mother_wL(n, d, wL) window, 0, xs=1000,ys=500 !p.multi=[0,2,0] plot, wL, abs(psihatL), xr=[-10,10], yr=[0,1.2], /ys end