コード例 #1
0
def example_wolter_1_microscope():

    print(
        ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>   example_wolter_1_microscope"
    )

    p = 13.4
    q = 0.300
    d = 0.1082882
    q1 = 0.67041707
    theta1 = 88.8 * np.pi / 180
    theta2 = 89. * np.pi / 180

    wolter_jap = CompoundOpticalElement.wolter_for_japanese(p=p,
                                                            q=q,
                                                            d=d,
                                                            q1=q1,
                                                            theta1=theta1,
                                                            theta2=theta2)

    beam = Beam()
    beam.set_gaussian_divergence(5 * 1e-5, 0.00025)
    beam.set_rectangular_spot(xmax=200 * 1e-6,
                              xmin=-200 * 1e-6,
                              zmax=10 * 1e-6,
                              zmin=-10 * 1e-6)

    beam.plot_xz(0)
    plt.title('wolter microscope')
    beam.plot_xpzp(0)

    wolter_jap.trace_wolter_japanese(beam)

    b2 = beam.y
    b3 = beam.z

    beam.y = b3
    beam.z = b2

    beam.plot_xz(0)
    beam.histogram()

    plt.show()
コード例 #2
0
    def test_spherical_mirror(self):

        print(">>>>>>>>>>>>>>> test_spherical_mirror")
        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),
        )

        #beam1 = Beam(5000)
        #beam1.set_point(0, 0, 0)
        #beam1.set_flat_divergence(5e-3, 5e-2)
        p=2.
        q=1.
        theta=41*np.pi/180

        shadow_beam = run_shadow_source()

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

        beam1=spherical_mirror.trace_optical_element(beam1)


        if do_plot:
            beam1.plot_xz()
            beam1.plot_xpzp()
            plt.title("Spherical mirror with p=2, q=1, theta=41")
            plt.show()

        shadow_beam = run_shadow_spherical_mirror(shadow_beam)


        assert_almost_equal(beam1.x, shadow_beam.getshonecol(1), 8)
        assert_almost_equal(beam1.y, shadow_beam.getshonecol(2), 8)
        assert_almost_equal(beam1.z, shadow_beam.getshonecol(3), 8)
コード例 #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)
コード例 #4
0
    def test_paraboloid_mirror(self):

        print(">>>>>>>>>>>>>>> test_paraboloid_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=10.
        q=20.
        theta=72*np.pi/180
        alpha=0*np.pi/180
        spherical_mirror=Optical_element.initialize_as_surface_conic_paraboloid_from_focal_distances(p,q,theta,alpha)
        beam1=spherical_mirror.trace_optical_element(beam1)

        if do_plot:
            beam1.plot_xz()
            beam1.plot_xpzp()
            plt.title("Paraboloid mirror  with p=10, q=20, theta=72")
            print(spherical_mirror.ccc_object.get_coefficients())
            plt.show()

        shadow_beam = run_shadow_parabolic_mirror(shadow_beam)


        assert_almost_equal(beam1.x, shadow_beam.getshonecol(1), 7)
        assert_almost_equal(beam1.y, shadow_beam.getshonecol(2), 7)
        assert_almost_equal(beam1.z, shadow_beam.getshonecol(3), 7)
コード例 #5
0
                                                                d=d,
                                                                q1=q1,
                                                                theta1=theta1,
                                                                theta2=theta2)

    beam = Beam()
    beam.set_gaussian_divergence(5 * 1e-5, 0.00025)
    beam.set_rectangular_spot(xmax=200 * 1e-6,
                              xmin=-200 * 1e-6,
                              zmax=10 * 1e-6,
                              zmin=-10 * 1e-6)
    #beam.set_divergences_collimated()

    beam.plot_xz(0)
    plt.title('wolter microscope')
    beam.plot_xpzp(0)

    op_axis = Beam(1)
    op_axis.set_point(0., 0., 0.)
    op_axis.set_divergences_collimated()

    beam = op_axis.merge(beam)

    beam = wolter_jap.trace_compound(beam)

    #b2 = beam.y
    #b3 = beam.z

    #beam.y = b3
    #beam.z = b2