From d419bce5fb7fa7e45558a03055ba50cbbae4452e Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Thu, 2 Jun 2022 14:42:14 -0400 Subject: report B angle in degrees too --- examples/eit_with_vcsel.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'examples') 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), -- cgit v1.2.3