diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2022-06-02 14:42:14 -0400 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2022-06-02 14:42:14 -0400 |
commit | d419bce5fb7fa7e45558a03055ba50cbbae4452e (patch) | |
tree | bc8de95f06ca0a9f2897b9f8d5a33ce93fa22ecb /examples | |
parent | 791496e53cc3bc5f871ba7f4a9655f8084a6e931 (diff) | |
download | qolab-d419bce5fb7fa7e45558a03055ba50cbbae4452e.tar.gz qolab-d419bce5fb7fa7e45558a03055ba50cbbae4452e.zip |
report B angle in degrees too
Diffstat (limited to 'examples')
-rw-r--r-- | examples/eit_with_vcsel.py | 12 |
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), |