Example #1
0
 def test_reflection_TE_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])
     reflected_calc = sm.reflection_TE(init_index1, init_index2, init_angle)
     reflected_predict = np.array([-0.2, -0.76028867 + 0.063273675j])
     ratio = reflected_calc / reflected_predict
     npt.assert_array_almost_equal(ratio, np.array([1.0, 1.0]), decimal=5)
Example #2
0
 def test_reflection_TE_complex_index(self):
     reflected_calc = sm.reflection_TE(1.0, 3.5 - 1.0j, np.pi / 3.0)
     reflected_predict = -0.76028867 + 0.063273675j
     ratio = reflected_calc / reflected_predict
     self.assertAlmostEqual(ratio, 1.0, places=5)
Example #3
0
 def test_reflection_TE_with_angle(self):
     reflected_calc = sm.reflection_TE(1.0, 1.5, np.pi / 3.0)
     reflected_predict = -0.420204103
     ratio = reflected_calc / reflected_predict
     self.assertAlmostEqual(ratio, 1.0, places=5)
Example #4
0
 def test_reflection_TE_0_angle(self):
     reflected_calc = sm.reflection_TE(1.0, 1.5, 0.0)
     reflected_predict = -0.2
     ratio = reflected_calc / reflected_predict
     self.assertAlmostEqual(ratio, 1.0, places=5)
Example #5
0
 def test_reflection_TE_complex_angle(self):
     reflected_calc = sm.reflection_TE(1.5 - 1.5j, 1.2 - 1.0j,
                                       0.544230 + 0.0550733j)
     reflected_predict = 0.2451657156 - 0.058335218j
     ratio = reflected_calc / reflected_predict
     self.assertAlmostEqual(ratio, 1.0, places=5)