def test_adaptive_orient(self): """Test an adaptive orientation averaging case """ tm = TMatrix(axi=2.0, lam=6.5, m=complex(1.5,0.5), eps=1.0/0.6, suppress_warning=True) tm.or_pdf = orientation.gaussian_pdf(20.0) tm.orient = orientation.orient_averaged_adaptive (S, Z) = tm.get_SZ() S_ref = np.array( [[complex(6.49005717e-02, -2.42488000e-01), complex(-6.12697676e-16, -4.10602248e-15)], [complex(-1.50048180e-14, -1.64195485e-15), complex(-9.54176591e-02, 2.84758322e-01)]]) Z_ref = np.array( [[7.89677648e-02, -1.37631854e-02, -7.45412599e-15, -9.23979111e-20], [-1.37631854e-02, 7.82165256e-02, 5.61975938e-15, -1.32888054e-15], [8.68047418e-15, 3.52110917e-15, -7.73358177e-02, 5.14571155e-03], [1.31977116e-19, -3.38136420e-15, -5.14571155e-03, -7.65845784e-02]]) test_relative(self, S, S_ref) test_relative(self, Z, Z_ref)
def test_fixed_orient(self): """Test a fixed-point orientation averaging case """ tm = TMatrix(axi=2.0, lam=6.5, m=complex(1.5, 0.5), eps=1.0 / 0.6, suppress_warning=True) tm.or_pdf = orientation.gaussian_pdf(20.0) tm.orient = orientation.orient_averaged_fixed (S, Z) = tm.get_SZ() S_ref = np.array([[ complex(6.49006090e-02, -2.42487917e-01), complex(1.20257317e-11, -5.23022168e-11) ], [ complex(6.21754594e-12, 2.95662844e-11), complex(-9.54177082e-02, 2.84758158e-01) ]]) Z_ref = np.array([[ 7.89748116e-02, -1.37649947e-02, -1.58053610e-11, -4.56295798e-12 ], [-1.37649947e-02, 7.82237468e-02, -2.85105399e-11, -3.43475094e-12], [ 2.42108565e-11, -3.92054806e-11, -7.73426425e-02, 5.14654926e-03 ], [ 4.56792369e-12, -3.77838854e-12, -5.14654926e-03, -7.65915776e-02 ]]) test_relative(self, S, S_ref) test_relative(self, Z, Z_ref)
def test_fixed_orient(self): """Test a fixed-point orientation averaging case """ tm = TMatrix(axi=2.0, lam=6.5, m=complex(1.5,0.5), eps=1.0/0.6, suppress_warning=True) tm.or_pdf = orientation.gaussian_pdf(20.0) tm.orient = orientation.orient_averaged_fixed (S, Z) = tm.get_SZ() S_ref = np.array( [[complex(6.49006090e-02, -2.42487917e-01), complex(1.20257317e-11, -5.23022168e-11)], [complex(6.21754594e-12, 2.95662844e-11), complex(-9.54177082e-02, 2.84758158e-01)]]) Z_ref = np.array( [[7.89748116e-02, -1.37649947e-02, -1.58053610e-11, -4.56295798e-12], [-1.37649947e-02, 7.82237468e-02, -2.85105399e-11, -3.43475094e-12], [2.42108565e-11, -3.92054806e-11, -7.73426425e-02, 5.14654926e-03], [4.56792369e-12, -3.77838854e-12, -5.14654926e-03, -7.65915776e-02]]) test_relative(self, S, S_ref) test_relative(self, Z, Z_ref)
def test_adaptive_orient(self): """Test an adaptive orientation averaging case """ tm = TMatrix(axi=2.0, lam=6.5, m=complex(1.5, 0.5), eps=1.0 / 0.6, suppress_warning=True) tm.or_pdf = orientation.gaussian_pdf(20.0) tm.orient = orientation.orient_averaged_adaptive (S, Z) = tm.get_SZ() S_ref = np.array([[ complex(6.49005717e-02, -2.42488000e-01), complex(-6.12697676e-16, -4.10602248e-15) ], [ complex(-1.50048180e-14, -1.64195485e-15), complex(-9.54176591e-02, 2.84758322e-01) ]]) Z_ref = np.array([[ 7.89677648e-02, -1.37631854e-02, -7.45412599e-15, -9.23979111e-20 ], [-1.37631854e-02, 7.82165256e-02, 5.61975938e-15, -1.32888054e-15], [ 8.68047418e-15, 3.52110917e-15, -7.73358177e-02, 5.14571155e-03 ], [ 1.31977116e-19, -3.38136420e-15, -5.14571155e-03, -7.65845784e-02 ]]) test_relative(self, S, S_ref) test_relative(self, Z, Z_ref)