function D,wa,q,sigma ; function to determine cutoff for a given q, sigma and alven wave frequency
rho = 1.673e-14 ;density of corona
Ho = 60. ; scale height
n = n_elements(q)
zzz = findgen(100)/2. ; height array (Mm)
qw = fltarr(n) ; array of q multiplied by sigma
for i = 0L,n-1 do begin
qw[i] = q[i]*sigma[i]
endfor
D = fltarr(n) ; array of cutoffs varying with z
for i = 0L,(n-1) do begin
D[i] = 10^(12.)*(1./qw[i]^3)*(wa^3)*rho^(3/2)*exp(-3*zzz[i]/(2.*Ho)) ; factor at front makes sure Wa has units of Hz
endfor
return, D
end