Example #1
0
 def test_transmission_TM_nparray(self):
     init_index1 = np.array([1.0, 1.0])
     init_index2 = np.array([1.5, 3.5 - 1.0j])
     init_angle = np.array([0.0, np.pi / 3.0])
     transmitted_calc = sm.transmission_TM(init_index1, init_index2,
                                           init_angle)
     transmitted_predict = np.array([0.8, 0.354205673 + 0.0669640612j])
     ratio = transmitted_calc / transmitted_predict
     npt.assert_array_almost_equal(ratio, np.array([1.0, 1.0]), decimal=5)
Example #2
0
 def test_transmission_TM_complex_angle(self):
     transmitted_calc = sm.transmission_TM(1.5 - 1.5j, 1.2 - 1.0j,
                                           0.544230 + 0.0550733j)
     transmitted_predict = 1.279287116 - 0.0772939415j
     ratio = transmitted_calc / transmitted_predict
     self.assertAlmostEqual(ratio, 1.0, places=5)
Example #3
0
 def test_transmission_TM_with_angle(self):
     transmitted_calc = sm.transmission_TM(1.0, 1.5, np.pi / 3.0)
     transmitted_predict = 0.6383671769
     ratio = transmitted_calc / transmitted_predict
     self.assertAlmostEqual(ratio, 1.0, places=5)
Example #4
0
 def test_transmission_TM_complex_index(self):
     transmitted_calc = sm.transmission_TM(1.0, 3.5 - 1.0j, np.pi / 3.0)
     transmitted_predict = 0.354205673 + 0.0669640612j
     ratio = transmitted_calc / transmitted_predict
     self.assertAlmostEqual(ratio, 1.0, places=5)
Example #5
0
 def test_transmission_TM_0_angle(self):
     transmitted_calc = sm.transmission_TM(1.0, 1.5, 0.0)
     transmitted_predict = 0.8
     ratio = transmitted_calc / transmitted_predict
     self.assertAlmostEqual(ratio, 1.0, places=5)