Example #1
0
 def test_field_linear_multi(self):
     N = 3
     angles = np.linspace(0, np.pi / 2, N)
     H = mueller.stokes_horizontal()
     V = mueller.stokes_vertical()
     S = mueller.stokes_linear(angles)
     self.assertEqual(len(S), N)
Example #2
0
 def test_to_stokes_array(self):
     N = 3
     angles = np.linspace(0, np.pi / 2, N)
     S = mueller.stokes_linear(angles)
     J = mueller.stokes_to_jones(S)
     n, m = J.shape
     self.assertEqual(n, N)
     self.assertEqual(m, 2)
Example #3
0
 def test_dop_array(self):
     N = 3
     angles = np.linspace(0, np.pi / 2, N)
     S = mueller.stokes_linear(angles)
     dop = mueller.degree_of_polarization(S)
     self.assertEqual(len(dop), N)
     for p in dop:
         self.assertAlmostEqual(p, 1)
Example #4
0
 def test_intensity_array(self):
     N = 3
     angles = np.linspace(0, np.pi / 2, N)
     S = mueller.stokes_linear(angles)
     I = mueller.intensity(S)
     self.assertEqual(len(I), N)
     for intensity in I:
         self.assertAlmostEqual(intensity, 1)
Example #5
0
 def test_field_linear_H(self):
     H = mueller.stokes_horizontal()
     S = mueller.stokes_linear(0)
     for pair in zip(H, S):
         self.assertAlmostEqual(pair[0], pair[1])
Example #6
0
 def test_field_linear_V(self):
     V = mueller.stokes_vertical()
     S = mueller.stokes_linear(np.pi / 2)
     for pair in zip(V, S):
         self.assertAlmostEqual(pair[0], pair[1])