Beispiel #1
0
    def initialize_as_kirkpatrick_baez(cls,
                                       p,
                                       q,
                                       separation,
                                       theta,
                                       bound1=None,
                                       bound2=None):

        p1 = p - 0.5 * separation
        q1 = p - p1
        q2 = q - 0.5 * separation
        p2 = q - q2
        f1p = p1
        f1q = p + q - p1
        f2q = q2
        f2p = p + q - q2

        oe1 = Optical_element.initialize_as_surface_conic_ellipsoid_from_focal_distances(
            p=f1p, q=f1q, theta=theta, alpha=0., cylindrical=1)
        #oe1.bound = bound1
        oe1.set_bound(bound1)
        oe1.p = p1
        oe1.q = q1

        oe2 = Optical_element.initialize_as_surface_conic_ellipsoid_from_focal_distances(
            p=f2p, q=f2q, theta=theta, alpha=90. * np.pi / 180, cylindrical=1)
        #oe2.bound = bound2
        oe2.set_bound(bound2)
        oe2.p = p2
        oe2.q = q2

        return CompoundOpticalElement(oe_list=[oe1, oe2],
                                      oe_name="Kirkpatrick Baez")
Beispiel #2
0
    def initialize_as_montel_ellipsoid(cls,
                                       p,
                                       q,
                                       theta_z,
                                       theta_x=None,
                                       bound1=None,
                                       bound2=None,
                                       angle_of_mismatch=0.,
                                       fp=None,
                                       fq=None):

        beta = np.pi / 2 + angle_of_mismatch  #### angle beetween the two mirror, if angle_of_mismatch is <0 the two mirror are closer
        if theta_x == None:
            theta_x = theta_z

        oe1 = Optical_element.initialize_as_surface_conic_ellipsoid_from_focal_distances(
            p=p, q=q, theta=theta_z, alpha=0., cylindrical=1, fp=fp, fq=fq)
        oe2 = Optical_element.initialize_as_surface_conic_ellipsoid_from_focal_distances(
            p=p, q=q, theta=theta_x, alpha=0., cylindrical=1, fp=fp, fq=fq)
        oe1.set_bound(bound1)

        oe2.rotation_surface_conic(beta, 'y')
        oe2.set_bound(bound2)

        distance_of_the_screen = q

        ccc = np.array(
            [0., 0., 0., 0., 0., 0., 0., 1., 0., -distance_of_the_screen])
        screen = Optical_element.initialize_as_surface_conic_from_coefficients(
            ccc)
        screen.set_parameters(p, q, 0., 0., "Surface conical mirror")

        return CompoundOpticalElement(oe_list=[oe1, oe2, screen],
                                      oe_name="Montel ellipsoid")
Beispiel #3
0
    def test_ellipsoidal_mirror(self):

        print(">>>>>>>>>>>>>>> test_ellipsoidal_mirror")

        #beam1=Beam(5000)
        #beam1.set_point(0,0,0)
        #beam1.set_flat_divergence(5e-3,5e-2)

        shadow_beam = run_shadow_source()

        beam1=Beam()
        beam1.initialize_from_arrays(
            shadow_beam.getshonecol(1),
            shadow_beam.getshonecol(2),
            shadow_beam.getshonecol(3),
            shadow_beam.getshonecol(4),
            shadow_beam.getshonecol(5),
            shadow_beam.getshonecol(6),
            shadow_beam.getshonecol(10),
        )

        p=20.
        q=10.
        theta=50*np.pi/180

        spherical_mirror=Optical_element.initialize_as_surface_conic_ellipsoid_from_focal_distances(p,q,theta)

        beam1=spherical_mirror.trace_optical_element(beam1)

        if do_plot:
            beam1.plot_xz()
            beam1.plot_xpzp()
            plt.title("Ellipsoidal mirror with p=20, q=10, theta=50")
            plt.show()

        shadow_beam = run_shadow_elliptical_mirror(beam1)


        assert_almost_equal(beam1.vx, shadow_beam.getshonecol(4), 1)
        assert_almost_equal(beam1.vy, shadow_beam.getshonecol(5), 1)
        assert_almost_equal(beam1.vz, shadow_beam.getshonecol(6), 1)