From 4acfc7b00839a357ba056bcb70959218cf1d78dc Mon Sep 17 00:00:00 2001 From: panepucci Date: Wed, 17 Feb 2016 12:02:56 +0100 Subject: [PATCH] Script execution --- script/local.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/script/local.py b/script/local.py index 6dec498..e703bf6 100644 --- a/script/local.py +++ b/script/local.py @@ -5,7 +5,7 @@ dtor = math.pi /180.0 -def A2E(t,h=1.0,k=1.0,l=1.0, deg =True, ln = False): +def a2e(t,h=1.0,k=1.0,l=1.0, deg =True, ln = False): lncorr= 2.e-4 if ln else 0.0 d0=2 * 5.43102 * (1.0-lncorr) / math.sqrt(h**2+k**2+l**2) tt= (t * dtor) if (deg or (t>1.0)) else t @@ -18,13 +18,14 @@ def angle(e,h=1.0,k=1.0,l=1.0, deg =True, ln = False,bent = False): if bent: rho = 2*19.65*8.35/28*math.sin(a) dt = 0.2e-3/rho*0.279 - d0 = 2*5.43102d*(1+dt)/math.sqrt(h^2+k^2+l^2) + d0 = 2*5.43102*(1+dt)/math.sqrt(h^2+k^2+l^2) a = math.asin(12.39842/d0/E) - a = a/dtor if deg else t + a = a/dtor if deg else a + return a def get_energy(debug_msg = True): t2 = caget("X06DA-OP-MO1:ROX2.RBV",'d') - e = A2E(abs(t2)) + e = a2e(abs(t2)) if debug_msg: print 'Energy [keV]:'+ str(e) + ' Wavelength [A]:' + str(12.39842/e) return e