Esempio n. 1
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")
Esempio n. 2
0
    def initialiaze_as_wolter_1_with_two_parameters(cls, p1, R, theta):

        cp1 = -2 * R / np.tan(theta)
        cp2 = 2 * R * np.tan(theta)
        cp = max(cp1, cp2)
        f = cp / 4
        print("focal=%f" % (f))

        oe1 = Optical_element.initialize_as_surface_conic_paraboloid_from_focal_distances(
            p=p1, q=f, theta=0., alpha=0., infinity_location="p")

        s1 = R / np.tan(2 * theta)
        s2 = R / np.tan(4 * theta)
        c = (s1 - s2) / 2
        z0 = f + c

        b1 = np.sqrt(0.5 * c**2 + 0.5 * R**2 + 0.5 * R**4 / cp**2 -
                     R**2 * z0 / cp + 0.5 * z0**2 - 0.5 / cp**2 * np.sqrt(
                         (-c**2 * cp**2 - cp**2 * R**2 - R**4 +
                          2 * cp * R**2 * z0 - cp**2 * z0**2)**2 - 4 * cp**2 *
                         (c**2 * R**4 - 2 * c**2 * cp * R**2 * z0 +
                          c**2 * cp**2 * z0**2)))
        b2 = np.sqrt(0.5 * c**2 + 0.5 * R**2 + 0.5 * R**4 / cp**2 -
                     R**2 * z0 / cp + 0.5 * z0**2 + 0.5 / cp**2 * np.sqrt(
                         (-c**2 * cp**2 - cp**2 * R**2 - R**4 +
                          2 * cp * R**2 * z0 - cp**2 * z0**2)**2 - 4 * cp**2 *
                         (c**2 * R**4 - 2 * c**2 * cp * R**2 * z0 +
                          c**2 * cp**2 * z0**2)))
        b = min(b1, b2)
        a = np.sqrt(c**2 - b**2)

        ccc = np.array([
            -1 / a**2, -1 / a**2, 1 / b**2, 0., 0., 0., 0., 0., -2 * z0 / b**2,
            z0**2 / b**2 - 1
        ])
        oe2 = Optical_element.initialize_as_surface_conic_from_coefficients(
            ccc)
        oe2.set_parameters(p=0.,
                           q=z0 + c,
                           theta=90 * np.pi / 180,
                           alpha=0.,
                           type="My hyperbolic mirror")
        #oe2.type = "My hyperbolic mirror"
        #oe2.p = 0.
        #oe2.q = z0 + c
        #oe2.theta = 90 * np.pi / 180
        #oe2.alpha = 0.

        return CompoundOpticalElement(oe_list=[oe1, oe2], oe_name="Wolter 1")
Esempio n. 3
0
    def initialize_as_wolter_3(cls, p, q, distance_between_the_foci):
        f=-q

        oe1 = Optical_element.initialize_as_surface_conic_paraboloid_from_focal_distances(p=p, q=f, theta=0., alpha=0., infinity_location="p")

        #c = z0+np.abs(f)
        c = distance_between_the_foci/2
        z0 = np.abs(c)-np.abs(f)
        b = c+100
        a = np.sqrt((b**2-c**2))
        ccc = np.array([1/a**2, 1/a**2, 1/b**2, 0., 0., 0., 0., 0., -2*z0/b**2, z0**2/b**2-1])

        oe2 = Optical_element.initialize_as_surface_conic_from_coefficients(ccc)
        oe2.set_parameters(p=0., q=z0+z0+np.abs(q), theta=90*np.pi/180)


        return CompoundOpticalElement(oe_list=[oe1,oe2],oe_name="Wolter 3")
Esempio n. 4
0
    def initialiaze_as_wolter_12(cls, p1, q1, focal_parabola, Rmin):

        focal = focal_parabola
        d = q1 - focal_parabola
        z0 = focal_parabola + d / 2
        print("focal=%f" % (focal))
        theta1 = 0.
        alpha1 = 0.

        oe1 = Optical_element.initialize_as_surface_conic_paraboloid_from_focal_distances(
            p1, 0., theta1, alpha1, "p", focal)
        ccc = oe1.ccc_object.get_coefficients()
        cp = -ccc[8]
        print("R=%f, d=%f, cp=%f, z0=%f" % (Rmin, d, cp, z0))
        #b1 = np.sqrt(0.125*d**2+Rmin+2*Rmin**4/cp**2-2*Rmin**2*z0/cp+0.5*z0**2-0.125/cp**2*np.sqrt((-cp**2*d**2-8*cp**2*Rmin-16*Rmin**4+16*cp*Rmin**2*z0-4*cp*z0**2)**2-16*cp**2*(4*d**2*Rmin**4-4*cp*d**2*Rmin**2*z0+cp**2*d**2*z0**2)))
        #b2 = np.sqrt(0.125*d**2+Rmin+2*Rmin**4/cp**2-2*Rmin**2*z0/cp+0.5*z0**2+0.125/cp**2*np.sqrt((-cp**2*d**2-8*cp**2*Rmin-16*Rmin**4+16*cp*Rmin**2*z0-4*cp*z0**2)**2-16*cp**2*(4*d**2*Rmin**4-4*cp*d**2*Rmin**2*z0+cp**2*d**2*z0**2)))
        p1 = -cp**2 * d**2 - 8 * cp**2 * Rmin - 16 * Rmin**4 + 16 * cp * Rmin**2 * z0 - 4 * cp**2 * z0**2
        p1 = p1**2
        p2 = 16 * cp**2 * (4 * d**2 * Rmin**4 - 4 * cp * d**2 * Rmin**2 * z0 +
                           cp**2 * d**2 * z0**2)
        sp = 0.125 / cp**2 * np.sqrt(p1 - p2)
        sp0 = 0.125 * d**2 + Rmin + 2 * Rmin**4 / cp**2 - 2 * Rmin**2 * z0 / cp + 0.5 * z0**2
        b = np.sqrt(sp0 - sp)
        a = np.sqrt(d**2 / 4 - b**2)

        print("a=%f, b=%f" % (a, b))

        #oe2 = Optical_element.initialize_my_hyperboloid(p=0. ,q=-(focal-2*z0), theta=90*np.pi/180, alpha=0, wolter=1.1, z0=z0, distance_of_focalization=focal)

        cc = np.array([
            -1 / a**2, -1 / a**2, 1 / b**2, 0., 0., 0., 0., 0., -2 * z0 / b**2,
            (z0 / b)**2 - 1
        ])
        oe2 = Optical_element.initialize_as_surface_conic_from_coefficients(cc)
        oe2.type = "My hyperbolic mirror"
        oe2.set_parameters(p=0., q=q1, theta=90. * np.pi / 180, alpha=0.)

        return CompoundOpticalElement(oe_list=[oe1, oe2], oe_name="Wolter 1.2")
Esempio n. 5
0
        t[indices] = 1e30

        tf = np.minimum(t, tf)
        indices = np.where(t == tf)
        origin[indices] = elements[i]

    return origin


par2 = par1.duplicate()
par2.rotation_surface_conic(-theta_grazing, 'x')
par1.rotation_surface_conic(-theta_grazing, 'x')

ccc = np.array([0., 0., 0., 0., 0., 0., 0., 0., 1., 0.])
par2 = Optical_element.initialize_as_surface_conic_from_coefficients(ccc)
par2.set_parameters(0.4, 0.3, 0., 0., "Surface conical mirror")
par2.rotation_surface_conic(-theta_grazing, 'x')

#par1.rotation_surface_conic(2*theta_grazing, 'x')
par2.rotation_surface_conic(np.pi / 2, 'y')
#par2.rotation_surface_conic(theta_grazing, 'z')

#ccc = np.array([0., 0., 0., 0., 0., 0., 0., 1., 0., -10.])
#screen = Optical_element.initialize_as_surface_conic_from_coefficients(ccc)
#screen.set_parameters(0.4, 10., 0., 0., "Surface conical mirror")
#
#beam.y -= 0.4
#
#origin = time_comparison([par1, par2, screen], beam, [1,2,3])
#