; 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 ; j, k wavelet as defined by Sato. function phase_jk_xL, H, d, xh, j, k, xL psihatL=phase_jk_wL(H, d, xh, j, k, wL) n = n_elements(wL) dn = d * n xL=[findgen(n/2)-n/2,findgen(n/2)] * d + (xh-H) psiL=shift(float(fft( shift(psihatL,n/2)/dn, /inverse)),n/2) return, psiL end pro phase_jk_xL_test H = 32. d = 1. j=3 k=1 xh=0. psirefrL = refr_jk_xL(H, d, xh, 0, 0, xL) psirefrjkL = refr_jk_xL(H, d, xh, j, k, xL) psiphaseL = phase_jk_xL(H, d, xh, 0, 0, xL) psiphasejkL = phase_jk_xL(H, d, xh, j, k, xL) window, 0, xs=1000,ys=500 !p.multi=[0,2,0] plot, xL/H, psirefrjkL, xr=xh + [-5,5], /xs,/ys oplot, xL/H, psirefrL, li=2 plot, xL/H, psiphasejkL, xr=xh + [-5,5], /xs,/ys oplot, xL/H, psiphaseL, li=2 end pro phase_jk_xL_test2 H = 32. d = 1. xh=32000. psirefrL = refr_jk_xL(H, d, xh, 0, 0, xL) c = 0.5 / max(psirefrL) refrL = exp(-(xL-xH)/H) * (1 + c * psirefrL) psiphaseL = phase_jk_xL(H, d, xh, 0, 0, xL) phaseL = exp(-(xL-xH)/H) * (1 + c * psiphaseL) n=n_elements(xL) phaseL2 = fltarr(n) for i=0, n-1 do $ phaseL2[i] = atmint(reverse(xL)*1e5, reverse(refrL), xL[i]*1e5, xL[n-1]*1e5, 0., /EXPON) phaseL2 = phaseL2 / sqrt(!pi*xL*H*1e10/2.) window, 0, xs=1000,ys=500 !p.multi=[0,2,0] plot, (xL-xH)/H, refrL, xr=[-15,5], /xs,/ylog plot, (xL-xH)/H, phaseL, xr=[-15,5], /xs,/ylo oplot, (xL-xH)/H, phaseL2, /li, ps=-4 end pro phase_jk_xL_test3 H = 32. d = 1. xh=32000. psirefrL = refr_jk_xL(H, d, xh, 0, 0, xL) refrL = exp(-(xL-xH)/H) * psirefrL psiphaseL = phase_jk_xL(H, d, xh, 0, 0, xL) phaseL = exp(-(xL-xH)/H) * psiphaseL n=n_elements(xL) phaseL2 = fltarr(n) for i=0, n-1 do $ phaseL2[i] = atmint(reverse(xL)*1e5, reverse(refrL), xL[i]*1e5, xL[n-1]*1e5, 0., EXPON=0) phaseL2 = phaseL2 / sqrt(!pi*xL*H*1e10/2.) window, 0, xs=1000,ys=500 !p.multi=[0,2,0] plot, (xL-xH)/H, refrL/exp(-(xL-xH)/H), xr=[-19,5], /xs plot, (xL-xH)/H, phaseL/exp(-(xL-xH)/H), xr=[-19,5], /xs oplot, (xL-xH)/H, phaseL2/exp(-(xL-xH)/H), /li end