gcz = fltarr(100,50)
number = 100

freq = findgen(50)/1000.+0.001 ; creates an array of frequencies of alfven wave
DG = fltarr(100,50) ;calculates what gdet has to be less than in order to count in an average

for i = 0,49 do begin
DG[*,i] = D(freq[i],q, sigma) ; uses function in cutoffz.pro
endfor
for j = 0,49 do begin
for i =0,number-1 do begin
gcz[i,j] = gcor_eval(c[i],0,DG[i,j])
endfor
endfor ;creates a corrected array for g(z), for various frequencies of alfven wave

end