diff options
-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), |