def test_paraxial(self): p = ParaxialTrace(self.s) #print(str(p)) nptest.assert_allclose(p.u[0, 0], 0) nptest.assert_allclose(p.u[0, 1], tanarcsin(self.s.object.angle)) nptest.assert_allclose(p.y[self.s.stop, 0], self.s[self.s.stop].radius) nptest.assert_allclose(p.y[self.s.stop, 1], 0, atol=1e-9) nptest.assert_allclose(p.working_f_number[1], 4, rtol=1e-2) nptest.assert_allclose(p.focal_length[1], 50, rtol=1e-3) nptest.assert_allclose(p.magnification[0], 0, rtol=1e-3) nptest.assert_allclose(p.numerical_aperture[1], .124, rtol=1e-3) p.update_conjugates() self.s.image.na = .125 p.update_stop("image") p = ParaxialTrace(self.s) p.update_conjugates() print(system_to_yaml(self.s)) print(str(p))
def test_paraxial(self): p = self.s.paraxial # print(str(p)) nptest.assert_allclose(p.u[0, 0], 0) nptest.assert_allclose(p.u[0, 1], p.n[0] * np.tan(self.s.object.angle)) nptest.assert_allclose(p.y[self.s.stop, 0], self.s[self.s.stop].radius, rtol=1e-2) nptest.assert_allclose(p.y[self.s.stop, 1], 0, atol=1e-9) nptest.assert_allclose(p.working_f_number[1], -self.s.image.pupil.fno, rtol=1e-2) nptest.assert_allclose(p.working_f_number[1], 4, rtol=1e-2) nptest.assert_allclose(p.focal_length[1], 50, rtol=5e-3) nptest.assert_allclose(p.magnification[0], 0, rtol=1e-3) nptest.assert_allclose(p.numerical_aperture[1], .124, rtol=5e-3) p.update_conjugates() self.s.image.na = .125 p.update_stop("image") p = ParaxialTrace(self.s) p.update_conjugates() print(system_to_yaml(self.s)) print(str(p))
def test_dump(self): d = system_to_yaml(self.s) s = system_from_yaml(d) s
def test_dump(self): d = system_to_yaml(self.s) s = system_from_yaml(d)