Function gcor_eval,c,zeta,cutoff ; function for obtaining corrected dimensionless G used to find null point distribution
pi = 3.14159265
n = 1000000
n1 = randomn(seed,n) ;n element normal distributions
n2 = randomn(seed,n)
n3 = randomn(seed,n)
n4 = randomn(seed,n)
n5 = randomn(seed,n)
gdet = ( 1/4.)*(((sqrt(1-c^2)*n5 + c*zeta)^3) + ( (1-c^2)*((n3^2 + n4^2) -0.5*(n1^2 +n2^2)*(sqrt(1-c^2)*n5 + c*zeta)) ) + (1-c^2)*(sqrt(2)*n2*n3*n4 + (1/sqrt(2))*(n3^2 - n4^2)*n1)) ; The dimensionless determinant of the jacobian of the magnetic field
gdet = abs(gdet)
for i = 0L,n-1 do begin ; heaviside function to discard all values in the distrubution above a given cutoff
if gdet[i] lt cutoff then gdet[i] = gdet[i] else gdet[i] = 0
endfor
a = exp(-0.5*(zeta)^2)/(sqrt(2)*(pi)^(1.5))*gdet ; multiplicative factors to get dimensionless function G
a = abs(a)
return, mean(a)
end