aboutsummaryrefslogtreecommitdiff
path: root/examples/eit_with_vcsel.py
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2022-06-02 14:42:14 -0400
committerEugeniy E. Mikhailov <evgmik@gmail.com>2022-06-02 14:42:14 -0400
commitd419bce5fb7fa7e45558a03055ba50cbbae4452e (patch)
treebc8de95f06ca0a9f2897b9f8d5a33ce93fa22ecb /examples/eit_with_vcsel.py
parent791496e53cc3bc5f871ba7f4a9655f8084a6e931 (diff)
downloadqolab-d419bce5fb7fa7e45558a03055ba50cbbae4452e.tar.gz
qolab-d419bce5fb7fa7e45558a03055ba50cbbae4452e.zip
report B angle in degrees too
Diffstat (limited to 'examples/eit_with_vcsel.py')
-rw-r--r--examples/eit_with_vcsel.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/examples/eit_with_vcsel.py b/examples/eit_with_vcsel.py
index e8d48eb..3cbc7d9 100644
--- a/examples/eit_with_vcsel.py
+++ b/examples/eit_with_vcsel.py
@@ -83,10 +83,14 @@ class BfieldDriver(KeysightE3612A):
Bx = Ix * Bslope_TperA[chX]
By = Iy * Bslope_TperA[chY]
Bz = Iz * Bslope_TperA[chZ]
- Bmag = np.sqrt(Bx*Bx + By*By + Bz*Bz)
- theta = np.arccos(Bz/Bmag)
- phi = np.arctan2(By, Bx)
- return { 'Bmag': float(Bmag), 'theta': float(theta), 'phi': float(phi),
+ Bmag = float(np.sqrt(Bx*Bx + By*By + Bz*Bz))
+ theta = float(np.arccos(Bz/Bmag))
+ phi = float(np.arctan2(By, Bx))
+ theta_degree = float(theta/np.pi*180)
+ phi_degree = float(phi/np.pi*180)
+ return { 'Bmag': Bmag,
+ 'theta': theta, 'phi': phi,
+ 'theta_degree': theta_degree, 'phi_degree': phi_degree,
'Bx': float(Bx),
'By': float(By),
'Bz': float(Bz),