Ejemplo n.º 1
0
def propagate_wavefront_scaling_new(wavefront,
                                    distance,
                                    handler_name=Fresnel1D.HANDLER_NAME,
                                    zoom=0.005,
                                    using_radius=None):

    wavefront_inside = wavefront.duplicate()

    #
    # if R of curvature to be remove is not defined, guess it
    #
    if using_radius is None:
        plot_scan = True
        if plot_scan:
            radii, fig_of_mer = wavefront_inside.scan_wavefront_curvature(
                rmin=-1000, rmax=1000, rpoints=100)
            plot(radii, fig_of_mer)
        using_radius = wavefront_inside.guess_wavefront_curvature(rmin=-1000,
                                                                  rmax=1000,
                                                                  rpoints=100)

    #
    # propagate flattened wavefront to a new distance:  distance/magnification
    #

    slit = WOSlit1D(name="PIRRONE2",
                    boundary_shape=Rectangle(
                        -0.00005,
                        0.00005,
                        -0.00005,
                        0.00005,
                    ))
    coordinates = ElementCoordinates(p=0.0, q=0.0)
    propagation_elements = PropagationElements()
    propagation_elements.add_beamline_element(
        BeamlineElement(optical_element=slit, coordinates=coordinates))
    parameters = PropagationParameters(
        wavefront=wavefront_inside, propagation_elements=propagation_elements)
    parameters.set_additional_parameters("shift_half_pixel", 1)
    parameters.set_additional_parameters("magnification_x", zoom)
    output_wf_1 = propagator.do_propagation(propagation_parameters=parameters,
                                            handler_name=handler_name)

    screen = WOScreen(name="PIRRONE")
    coordinates = ElementCoordinates(p=0.0, q=distance)
    propagation_elements = PropagationElements()
    propagation_elements.add_beamline_element(
        BeamlineElement(optical_element=screen, coordinates=coordinates))

    parameters = PropagationParameters(
        wavefront=output_wf_1, propagation_elements=propagation_elements)
    parameters.set_additional_parameters("shift_half_pixel", 1)
    parameters.set_additional_parameters("magnification_x", zoom)
    parameters.set_additional_parameters("radius", using_radius)
    output_wf_2 = propagator.do_propagation(propagation_parameters=parameters,
                                            handler_name=handler_name)

    return output_wf_2
Ejemplo n.º 2
0
def propagate_wavefront(wavefront,
                        distance,
                        handler_name=Fresnel1D.HANDLER_NAME,
                        zoom=0.005):

    wavefront_inside = wavefront.duplicate()

    slit = WOSlit1D(name="PIRRONE2",
                    boundary_shape=Rectangle(
                        -0.00005,
                        0.00005,
                        -0.00005,
                        0.00005,
                    ))
    coordinates = ElementCoordinates(p=0.0, q=0.0)
    propagation_elements = PropagationElements()
    propagation_elements.add_beamline_element(
        BeamlineElement(optical_element=slit, coordinates=coordinates))
    parameters = PropagationParameters(
        wavefront=wavefront_inside, propagation_elements=propagation_elements)
    parameters.set_additional_parameters("shift_half_pixel", 1)
    parameters.set_additional_parameters("magnification_x", zoom)
    output_wf_1 = propagator.do_propagation(propagation_parameters=parameters,
                                            handler_name=handler_name)

    screen = WOScreen(name="PIRRONE")
    coordinates = ElementCoordinates(p=0.0, q=distance)
    propagation_elements = PropagationElements()
    propagation_elements.add_beamline_element(
        BeamlineElement(optical_element=screen, coordinates=coordinates))

    parameters = PropagationParameters(
        wavefront=output_wf_1, propagation_elements=propagation_elements)
    parameters.set_additional_parameters("shift_half_pixel", 1)
    parameters.set_additional_parameters("magnification_x", zoom)
    output_wf_2 = propagator.do_propagation(propagation_parameters=parameters,
                                            handler_name=handler_name)

    return output_wf_2
Ejemplo n.º 3
0
                    ("propagator_specific_parameters", "Propagator Specific Parameters", ""),
                    ] )

    def get_propagator_handler(self):
        return self._propagator_handler

    def get_propagator_specific_parameters(self):
        return self._propagator_specific_parameters


if __name__ == "__main__":

    from syned.beamline.element_coordinates import ElementCoordinates
    from wofry.beamline.optical_elements.ideal_elements.screen import WOScreen
    a = ComsylWofryBeamlineElement(
                optical_element=WOScreen(),
                coordinates=ElementCoordinates(p=0.0,q=28.3,angle_radial=0.0,angle_azimuthal=0.0),
                propagator_handler='FRESNEL_ZOOM_XY_2D',
                propagator_specific_parameters={'shift_half_pixel':1,'magnification_x':8.0,'magnification_y':8.0}
    )


    print(a.info())

    print(a.to_json())

    f = open("tmp.json","w")
    f.write(a.to_json())
    f.close()
    print("File written to disk: tmp.json")
    wavefront = GenericWavefront2D.initialize_wavefront_from_range(
        x_min=-2.5e-3,
        x_max=2.5e-3,
        y_min=-1e-3,
        y_max=1e-3,
        number_of_points=(2 * 1024, 1024),
        wavelength=73e-12)

    radius = 28.3

    wavefront.set_spherical_wave(radius=radius)

    scale_factor = 1

    screen = WOScreen(name="PIRRONE")
    coordinates = ElementCoordinates(p=0.0, q=-scale_factor * radius)

    propagation_elements = PropagationElements()
    propagation_elements.add_beamline_element(
        BeamlineElement(optical_element=screen, coordinates=coordinates))

    parameters = PropagationParameters(
        wavefront=wavefront, propagation_elements=propagation_elements)
    parameters.set_additional_parameters("shift_half_pixel", 1)
    parameters.set_additional_parameters("magnification_x", 0.005)
    parameters.set_additional_parameters("magnification_y", 0.005)

    output_wf_1 = propagator.do_propagation(
        propagation_parameters=parameters, handler_name=Fresnel2D.HANDLER_NAME)
Ejemplo n.º 5
0
    def propagation_with_lens(self,do_plot=do_plot,method='fft',
                                wavelength=1.24e-10,
                                pixelsize_x=1e-6,npixels_x=2000,pixelsize_y=1e-6,npixels_y=2000,
                                propagation_distance=30.0,defocus_factor=1.0,propagation_steps=1,show=1):


        method_label = "fresnel (%s)"%method
        print("\n#                                                             ")
        print("# near field fresnel (%s) diffraction and focusing  "%(method_label))
        print("#                                                             ")

        #                               \ |  /
        #   *                           | | |                      *
        #                               / | \
        #   <-------    d  ---------------><---------   d   ------->
        #   d is propagation_distance

        # wf = Wavefront2D.initialize_wavefront_from_steps(x_start=-pixelsize_x*npixels_x/2,
        #                                                         x_step=pixelsize_x,
        #                                                         y_start=-pixelsize_y*npixels_y/2,
        #                                                         y_step=pixelsize_y,
        #                                                         wavelength=wavelength,
        #                                                         number_of_points=(npixels_x,npixels_y))

        wf = GenericWavefront2D.initialize_wavefront_from_range(x_min=-pixelsize_x*npixels_x/2,x_max=pixelsize_x*npixels_x/2,
                                                         y_min=-pixelsize_y*npixels_y/2,y_max=pixelsize_y*npixels_y/2,
                                                         number_of_points=(npixels_x,npixels_y),wavelength=wavelength)
        propagation_elements = PropagationElements()

        spherical_or_plane_and_lens = 1
        if spherical_or_plane_and_lens == 0:
            # set spherical wave at the lens entrance (radius=distance)
            wf.set_spherical_wave(complex_amplitude=1.0,radius=-propagation_distance)

            propagation_elements.add_beamline_element(BeamlineElement(optical_element=WOScreen(),
                                                                      coordinates=ElementCoordinates(p=0, q=propagation_distance)))

        else:
            # apply lens that will focus at propagation_distance downstream the lens.
            # Note that the vertical is a bit defocused
            wf.set_plane_wave_from_complex_amplitude(1.0+0j)

            focal_length = propagation_distance # / 2

            propagation_elements.add_beamline_element(BeamlineElement(optical_element=
                WOIdealLens("IdealLens",focal_x=focal_length, focal_y=focal_length),
                coordinates=ElementCoordinates(p=0, q=propagation_distance)))

        print("Incident intensity: ", wf.get_intensity().sum())

        propagator = PropagationManager.Instance()
        propagation_parameters = PropagationParameters(wavefront=wf,
                                                       propagation_elements=propagation_elements)

        if method == 'fft':
            propagation_parameters.set_additional_parameters("shift_half_pixel", True)
            wf1 = propagator.do_propagation(propagation_parameters, Fresnel2D.HANDLER_NAME)
        elif method == 'convolution':
            propagation_parameters.set_additional_parameters("shift_half_pixel", True)
            wf1 = propagator.do_propagation(propagation_parameters, FresnelConvolution2D.HANDLER_NAME)
        elif method == 'fraunhofer':
            propagation_parameters.set_additional_parameters("shift_half_pixel", True)
            wf1 = propagator.do_propagation(propagation_parameters, Fraunhofer2D.HANDLER_NAME)
        elif method == 'zoom':
            propagation_parameters.set_additional_parameters("shift_half_pixel", True)
            propagation_parameters.set_additional_parameters("magnification_x", 1.5)
            propagation_parameters.set_additional_parameters("magnification_y", 2.5)
            wf1 = propagator.do_propagation(propagation_parameters, FresnelZoomXY2D.HANDLER_NAME)
        else:
            raise Exception("Not implemented method: %s"%method)

        horizontal_profile = wf1.get_intensity()[:, int(wf.size()[1]/2)]
        horizontal_profile /= horizontal_profile.max()
        print("FWHM of the horizontal profile: %g um"%(1e6*line_fwhm(horizontal_profile)*wf1.delta()[0]))
        vertical_profile = wf1.get_intensity()[int(wf1.size()[0]/2),:]
        vertical_profile /= vertical_profile.max()
        print("FWHM of the vertical profile: %g um"%(1e6*line_fwhm(vertical_profile)*wf1.delta()[1]))

        if do_plot:
            from srxraylib.plot.gol import plot,plot_image
            plot_image(wf1.get_intensity(),wf1.get_coordinate_x(),wf1.get_coordinate_y(),title='intensity (%s)'%method,show=0)
            plot_image(wf1.get_phase(),wf1.get_coordinate_x(),wf1.get_coordinate_y(),title='phase (%s)'%method,show=0)

            plot(wf1.get_coordinate_x(),horizontal_profile,
                 wf1.get_coordinate_y(),vertical_profile,
                 legend=['Horizontal profile','Vertical profile'],title="%s"%method,show=show)

        print("Output intensity: ",wf1.get_intensity().sum())
        return wf1.get_coordinate_x(),horizontal_profile
Ejemplo n.º 6
0
def get_wofry_beamline_elements():

    BEAMLINE_ELEMENTS = []
    HANDLERS = []
    SPECIFIC = []

    #
    # info on current oe
    #
    #
    #    -------WOScreen---------
    #        -------BoundaryShape---------
    #

    #
    # define current oe
    #
    from wofry.beamline.optical_elements.ideal_elements.screen import WOScreen

    optical_element = WOScreen()

    #
    # propagating (***  ONLY THE ZOOM PROPAGATOR IS IMPLEMENTED ***)
    #
    #
    # propagation_elements = PropagationElements()
    beamline_element = BeamlineElement(
        optical_element=optical_element,
        coordinates=ElementCoordinates(
            p=0.000000,
            q=28.300000,
            angle_radial=numpy.radians(0.000000),
            angle_azimuthal=numpy.radians(0.000000)))
    # propagation_elements.add_beamline_element(beamline_element)
    # propagation_parameters = PropagationParameters(wavefront=input_wavefront.duplicate(),    propagation_elements = propagation_elements)
    # #self.set_additional_parameters(propagation_parameters)
    # #
    # propagation_parameters.set_additional_parameters('shift_half_pixel', 1)
    # propagation_parameters.set_additional_parameters('magnification_x', 8.000000)
    # propagation_parameters.set_additional_parameters('magnification_y', 10.000000)
    # #
    # propagator = PropagationManager.Instance()
    # try:
    #     propagator.add_propagator(FresnelZoomXY2D())
    # except:
    #     pass
    # output_wavefront = propagator.do_propagation(propagation_parameters=propagation_parameters,    handler_name='FRESNEL_ZOOM_XY_2D')

    BEAMLINE_ELEMENTS.append(beamline_element)
    HANDLERS.append('FRESNEL_ZOOM_XY_2D')
    SPECIFIC.append({
        'shift_half_pixel': 1,
        'magnification_x': 8.0,
        'magnification_y': 8.0
    })

    # input_wavefront = output_wavefront

    #
    # info on current oe
    #
    #
    #    -------WOSlit---------
    #        -------Rectangle---------
    #        x_left: -0.0018849 m # x (width) minimum (signed)
    #        x_right: 0.0018849 m # x (width) maximum (signed)
    #        y_bottom: -0.0018849 m # y (length) minimum (signed)
    #        y_top: 0.0018849 m # y (length) maximum (signed)
    #

    #
    # define current oe
    #
    from syned.beamline.shape import Rectangle
    boundary_shape = Rectangle(x_left=-0.0018849,
                               x_right=0.0018849,
                               y_bottom=-0.0018849,
                               y_top=0.0018849)

    from wofry.beamline.optical_elements.absorbers.slit import WOSlit
    optical_element = WOSlit(boundary_shape=boundary_shape)

    #
    # propagating (***  ONLY THE ZOOM PROPAGATOR IS IMPLEMENTED ***)
    #
    #
    # propagation_elements = PropagationElements()
    beamline_element = BeamlineElement(
        optical_element=optical_element,
        coordinates=ElementCoordinates(
            p=0.000000,
            q=0.000000,
            angle_radial=numpy.radians(0.000000),
            angle_azimuthal=numpy.radians(0.000000)))
    # propagation_elements.add_beamline_element(beamline_element)
    # propagation_parameters = PropagationParameters(wavefront=input_wavefront.duplicate(),    propagation_elements = propagation_elements)
    # #self.set_additional_parameters(propagation_parameters)
    # #
    # propagation_parameters.set_additional_parameters('shift_half_pixel', 1)
    # propagation_parameters.set_additional_parameters('magnification_x', 1.000000)
    # propagation_parameters.set_additional_parameters('magnification_y', 1.000000)
    # #
    # propagator = PropagationManager.Instance()
    # try:
    #     propagator.add_propagator(FresnelZoomXY2D())
    # except:
    #     pass
    # output_wavefront = propagator.do_propagation(propagation_parameters=propagation_parameters,    handler_name='FRESNEL_ZOOM_XY_2D')
    #
    #
    #
    #
    #
    # input_wavefront = output_wavefront

    BEAMLINE_ELEMENTS.append(beamline_element)
    HANDLERS.append('FRESNEL_ZOOM_XY_2D')
    SPECIFIC.append({
        'shift_half_pixel': 1,
        'magnification_x': 1.0,
        'magnification_y': 1.0
    })

    #
    # info on current oe
    #
    #
    #    -------WOIdealLens---------
    #        focal_x: 8.319 m # Focal length in x [horizontal]
    #        focal_y: 99999999999999.0 m # Focal length in y [vertical]
    #

    #
    # define current oe
    #
    from wofry.beamline.optical_elements.ideal_elements.lens import WOIdealLens

    optical_element = WOIdealLens(name='',
                                  focal_x=8.319000,
                                  focal_y=99999999999999.000000)

    #
    # propagating (***  ONLY THE ZOOM PROPAGATOR IS IMPLEMENTED ***)
    #
    #
    # propagation_elements = PropagationElements()
    beamline_element = BeamlineElement(
        optical_element=optical_element,
        coordinates=ElementCoordinates(
            p=0.000000,
            q=0.000000,
            angle_radial=numpy.radians(0.000000),
            angle_azimuthal=numpy.radians(0.000000)))
    # propagation_elements.add_beamline_element(beamline_element)
    # propagation_parameters = PropagationParameters(wavefront=input_wavefront.duplicate(),    propagation_elements = propagation_elements)
    # #self.set_additional_parameters(propagation_parameters)
    # #
    # propagation_parameters.set_additional_parameters('shift_half_pixel', 1)
    # propagation_parameters.set_additional_parameters('magnification_x', 1.000000)
    # propagation_parameters.set_additional_parameters('magnification_y', 1.000000)
    # #
    # propagator = PropagationManager.Instance()
    # try:
    #     propagator.add_propagator(FresnelZoomXY2D())
    # except:
    #     pass
    # output_wavefront = propagator.do_propagation(propagation_parameters=propagation_parameters,    handler_name='FRESNEL_ZOOM_XY_2D')
    #
    #
    #
    #
    #
    # input_wavefront = output_wavefront

    BEAMLINE_ELEMENTS.append(beamline_element)
    HANDLERS.append('FRESNEL_ZOOM_XY_2D')
    SPECIFIC.append({
        'shift_half_pixel': 1,
        'magnification_x': 1.0,
        'magnification_y': 1.0
    })

    #
    # info on current oe
    #
    #
    #    -------WOSlit---------
    #        -------Rectangle---------
    #        x_left: -2.5e-05 m # x (width) minimum (signed)
    #        x_right: 2.5e-05 m # x (width) maximum (signed)
    #        y_bottom: -0.5 m # y (length) minimum (signed)
    #        y_top: 0.5 m # y (length) maximum (signed)
    #

    #
    # define current oe
    #
    from syned.beamline.shape import Rectangle
    boundary_shape = Rectangle(x_left=-2.5e-05,
                               x_right=2.5e-05,
                               y_bottom=-0.5,
                               y_top=0.5)

    from wofry.beamline.optical_elements.absorbers.slit import WOSlit
    optical_element = WOSlit(boundary_shape=boundary_shape)

    #
    # propagating (***  ONLY THE ZOOM PROPAGATOR IS IMPLEMENTED ***)
    #
    #
    # propagation_elements = PropagationElements()
    beamline_element = BeamlineElement(
        optical_element=optical_element,
        coordinates=ElementCoordinates(
            p=11.700000,
            q=0.000000,
            angle_radial=numpy.radians(0.000000),
            angle_azimuthal=numpy.radians(0.000000)))
    # propagation_elements.add_beamline_element(beamline_element)
    # propagation_parameters = PropagationParameters(wavefront=input_wavefront.duplicate(),    propagation_elements = propagation_elements)
    # #self.set_additional_parameters(propagation_parameters)
    # #
    # propagation_parameters.set_additional_parameters('shift_half_pixel', 1)
    # propagation_parameters.set_additional_parameters('magnification_x', 0.010000)
    # propagation_parameters.set_additional_parameters('magnification_y', 1.000000)
    # #
    # propagator = PropagationManager.Instance()
    # try:
    #     propagator.add_propagator(FresnelZoomXY2D())
    # except:
    #     pass
    # output_wavefront = propagator.do_propagation(propagation_parameters=propagation_parameters,    handler_name='FRESNEL_ZOOM_XY_2D')
    #
    #
    # input_wavefront = output_wavefront

    BEAMLINE_ELEMENTS.append(beamline_element)
    HANDLERS.append('FRESNEL_ZOOM_XY_2D')
    SPECIFIC.append({
        'shift_half_pixel': 1,
        'magnification_x': 0.01,
        'magnification_y': 1.0
    })

    #
    #
    # #########################   KB  #########################################
    #
    #

    #
    # info on current oe
    #
    #
    #    -------WOSlit---------
    #        -------Rectangle---------
    #        x_left: -0.025 m # x (width) minimum (signed)
    #        x_right: 0.025 m # x (width) maximum (signed)
    #        y_bottom: -0.00045 m # y (length) minimum (signed)
    #        y_top: 0.00045 m # y (length) maximum (signed)
    #

    #
    # define current oe
    #
    from syned.beamline.shape import Rectangle
    boundary_shape = Rectangle(x_left=-0.025,
                               x_right=0.025,
                               y_bottom=-0.00045,
                               y_top=0.00045)

    from wofry.beamline.optical_elements.absorbers.slit import WOSlit
    optical_element = WOSlit(boundary_shape=boundary_shape)

    #
    # propagating (***  ONLY THE ZOOM PROPAGATOR IS IMPLEMENTED ***)
    #
    #
    # propagation_elements = PropagationElements()
    beamline_element = BeamlineElement(
        optical_element=optical_element,
        coordinates=ElementCoordinates(
            p=144.900000,
            q=0.000000,
            angle_radial=numpy.radians(0.000000),
            angle_azimuthal=numpy.radians(0.000000)))
    # propagation_elements.add_beamline_element(beamline_element)
    # propagation_parameters = PropagationParameters(wavefront=input_wavefront.duplicate(),
    #                                                propagation_elements=propagation_elements)
    # # self.set_additional_parameters(propagation_parameters)
    # #
    # propagation_parameters.set_additional_parameters('shift_half_pixel', 1)
    # propagation_parameters.set_additional_parameters('magnification_x', 440.000000)
    # propagation_parameters.set_additional_parameters('magnification_y', 5.000000)
    # #
    # propagator = PropagationManager.Instance()
    # try:
    #     propagator.add_propagator(FresnelZoomXY2D())
    # except:
    #     pass
    # output_wavefront = propagator.do_propagation(propagation_parameters=propagation_parameters,
    #                                              handler_name='FRESNEL_ZOOM_XY_2D')
    #
    # input_wavefront = output_wavefront

    BEAMLINE_ELEMENTS.append(beamline_element)
    HANDLERS.append('FRESNEL_ZOOM_XY_2D')
    SPECIFIC.append({
        'shift_half_pixel': 1,
        'magnification_x': 440.0,
        'magnification_y': 5.0
    })

    #
    # info on current oe
    #
    #
    #    -------WOIdealLens---------
    #        focal_x: 100000000.0 m # Focal length in x [horizontal]
    #        focal_y: 0.09994594594594594 m # Focal length in y [vertical]
    #

    #
    # define current oe
    #
    from wofry.beamline.optical_elements.ideal_elements.lens import WOIdealLens

    optical_element = WOIdealLens(name='',
                                  focal_x=100000000.000000,
                                  focal_y=0.099946)

    #
    # propagating (***  ONLY THE ZOOM PROPAGATOR IS IMPLEMENTED ***)
    #
    #
    # propagation_elements = PropagationElements()
    beamline_element = BeamlineElement(
        optical_element=optical_element,
        coordinates=ElementCoordinates(
            p=0.000000,
            q=0.000000,
            angle_radial=numpy.radians(0.000000),
            angle_azimuthal=numpy.radians(0.000000)))
    # propagation_elements.add_beamline_element(beamline_element)
    # propagation_parameters = PropagationParameters(wavefront=input_wavefront.duplicate(),
    #                                                propagation_elements=propagation_elements)
    # # self.set_additional_parameters(propagation_parameters)
    # #
    # propagation_parameters.set_additional_parameters('shift_half_pixel', 1)
    # propagation_parameters.set_additional_parameters('magnification_x', 1.000000)
    # propagation_parameters.set_additional_parameters('magnification_y', 1.000000)
    # #
    # propagator = PropagationManager.Instance()
    # try:
    #     propagator.add_propagator(FresnelZoomXY2D())
    # except:
    #     pass
    # output_wavefront = propagator.do_propagation(propagation_parameters=propagation_parameters,
    #                                              handler_name='FRESNEL_ZOOM_XY_2D')
    #
    #
    #
    # input_wavefront = output_wavefront

    BEAMLINE_ELEMENTS.append(beamline_element)
    HANDLERS.append('FRESNEL_ZOOM_XY_2D')
    SPECIFIC.append({
        'shift_half_pixel': 1,
        'magnification_x': 1.0,
        'magnification_y': 1.0
    })

    #
    # info on current oe
    #
    #
    #    -------WOSlit---------
    #        -------Rectangle---------
    #        x_left: -0.000195 m # x (width) minimum (signed)
    #        x_right: 0.000195 m # x (width) maximum (signed)
    #        y_bottom: -0.0065 m # y (length) minimum (signed)
    #        y_top: 0.0065 m # y (length) maximum (signed)
    #

    #
    # define current oe
    #
    # from syned.beamline.shape import Rectangle
    # boundary_shape = Rectangle(x_left=-0.000195, x_right=0.000195, y_bottom=-0.0065, y_top=0.0065)
    #
    # from wofry.beamline.optical_elements.absorbers.slit import WOSlit
    # optical_element = WOSlit(boundary_shape=boundary_shape)
    #
    # #
    # # propagating (***  ONLY THE ZOOM PROPAGATOR IS IMPLEMENTED ***)
    # #
    # #
    # propagation_elements = PropagationElements()
    beamline_element = BeamlineElement(
        optical_element=optical_element,
        coordinates=ElementCoordinates(
            p=0.050000,
            q=0.000000,
            angle_radial=numpy.radians(0.000000),
            angle_azimuthal=numpy.radians(0.000000)))
    # propagation_elements.add_beamline_element(beamline_element)
    # propagation_parameters = PropagationParameters(wavefront=input_wavefront.duplicate(),
    #                                                propagation_elements=propagation_elements)
    # # self.set_additional_parameters(propagation_parameters)
    # #
    # propagation_parameters.set_additional_parameters('shift_half_pixel', 1)
    # propagation_parameters.set_additional_parameters('magnification_x', 1.000000)
    # propagation_parameters.set_additional_parameters('magnification_y', 0.500000)
    # #
    # propagator = PropagationManager.Instance()
    # try:
    #     propagator.add_propagator(FresnelZoomXY2D())
    # except:
    #     pass
    # output_wavefront = propagator.do_propagation(propagation_parameters=propagation_parameters,
    #                                              handler_name='FRESNEL_ZOOM_XY_2D')
    #
    #
    # input_wavefront = output_wavefront

    BEAMLINE_ELEMENTS.append(beamline_element)
    HANDLERS.append('FRESNEL_ZOOM_XY_2D')
    SPECIFIC.append({
        'shift_half_pixel': 1,
        'magnification_x': 1.0,
        'magnification_y': 0.05
    })

    #
    # info on current oe
    #
    #
    #    -------WOIdealLens---------
    #        focal_x: 0.049982758620701014 m # Focal length in x [horizontal]
    #        focal_y: 100000000.0 m # Focal length in y [vertical]
    #

    #
    # define current oe
    #
    from wofry.beamline.optical_elements.ideal_elements.lens import WOIdealLens

    optical_element = WOIdealLens(name='',
                                  focal_x=0.049983,
                                  focal_y=100000000.000000)

    #
    # propagating (***  ONLY THE ZOOM PROPAGATOR IS IMPLEMENTED ***)
    #
    #
    # propagation_elements = PropagationElements()
    beamline_element = BeamlineElement(
        optical_element=optical_element,
        coordinates=ElementCoordinates(
            p=0.000000,
            q=0.000000,
            angle_radial=numpy.radians(0.000000),
            angle_azimuthal=numpy.radians(0.000000)))
    # propagation_elements.add_beamline_element(beamline_element)
    # propagation_parameters = PropagationParameters(wavefront=input_wavefront.duplicate(),
    #                                                propagation_elements=propagation_elements)
    # # self.set_additional_parameters(propagation_parameters)
    # #
    # propagation_parameters.set_additional_parameters('shift_half_pixel', 1)
    # propagation_parameters.set_additional_parameters('magnification_x', 1.000000)
    # propagation_parameters.set_additional_parameters('magnification_y', 1.000000)
    # #
    # propagator = PropagationManager.Instance()
    # try:
    #     propagator.add_propagator(FresnelZoomXY2D())
    # except:
    #     pass
    # output_wavefront = propagator.do_propagation(propagation_parameters=propagation_parameters,
    #                                              handler_name='FRESNEL_ZOOM_XY_2D')
    #
    #
    # input_wavefront = output_wavefront

    BEAMLINE_ELEMENTS.append(beamline_element)
    HANDLERS.append('FRESNEL_ZOOM_XY_2D')
    SPECIFIC.append({
        'shift_half_pixel': 1,
        'magnification_x': 1.0,
        'magnification_y': 1.0
    })

    #
    # info on current oe
    #
    #
    #    -------WOSlit---------
    #        -------Rectangle---------
    #        x_left: -0.5 m # x (width) minimum (signed)
    #        x_right: 0.5 m # x (width) maximum (signed)
    #        y_bottom: -0.5 m # y (length) minimum (signed)
    #        y_top: 0.5 m # y (length) maximum (signed)
    #

    #
    # define current oe
    #
    from syned.beamline.shape import Rectangle
    boundary_shape = Rectangle(x_left=-0.5,
                               x_right=0.5,
                               y_bottom=-0.5,
                               y_top=0.5)

    from wofry.beamline.optical_elements.absorbers.slit import WOSlit
    optical_element = WOSlit(boundary_shape=boundary_shape)

    #
    # propagating (***  ONLY THE ZOOM PROPAGATOR IS IMPLEMENTED ***)
    #
    #
    # propagation_elements = PropagationElements()
    beamline_element = BeamlineElement(
        optical_element=optical_element,
        coordinates=ElementCoordinates(
            p=0.050000,
            q=0.000000,
            angle_radial=numpy.radians(0.000000),
            angle_azimuthal=numpy.radians(0.000000)))
    # propagation_elements.add_beamline_element(beamline_element)
    # propagation_parameters = PropagationParameters(wavefront=input_wavefront.duplicate(),
    #                                                propagation_elements=propagation_elements)
    # # self.set_additional_parameters(propagation_parameters)
    # #
    # propagation_parameters.set_additional_parameters('shift_half_pixel', 1)
    # propagation_parameters.set_additional_parameters('magnification_x', 0.000070)
    # propagation_parameters.set_additional_parameters('magnification_y', 0.000090)
    # #
    # propagator = PropagationManager.Instance()
    # try:
    #     propagator.add_propagator(FresnelZoomXY2D())
    # except:
    #     pass
    # output_wavefront = propagator.do_propagation(propagation_parameters=propagation_parameters,
    #                                              handler_name='FRESNEL_ZOOM_XY_2D')
    #
    #
    # input_wavefront = output_wavefront

    BEAMLINE_ELEMENTS.append(beamline_element)
    HANDLERS.append('FRESNEL_ZOOM_XY_2D')
    SPECIFIC.append({
        'shift_half_pixel': 1,
        'magnification_x': 0.000070,
        'magnification_y': 0.000090
    })

    return BEAMLINE_ELEMENTS, HANDLERS, SPECIFIC
Ejemplo n.º 7
0
def run_wofry():
    #
    # create/import your input_wavefront (THIS IS A PLACEHOLDER - REPLACE WITH YOUR SOURCE)
    #
    #
    from wofry.propagator.wavefront2D.generic_wavefront import GenericWavefront2D
    input_wavefront = GenericWavefront2D.load_h5_file(
        "/users/srio/Working/paper-hierarchical/WORKSPACES/tmp.h5", "wfr")
    # initialize_wavefront_from_range(-10e-6,10e-6,-100e-6,100e-6,(200,100),1e-10)

    #
    # info on current oe
    #
    #
    #    -------WOScreen---------
    #        -------BoundaryShape---------
    #

    #
    # define current oe
    #
    from wofry.beamline.optical_elements.ideal_elements.screen import WOScreen

    optical_element = WOScreen()

    #
    # propagating (***  ONLY THE ZOOM PROPAGATOR IS IMPLEMENTED ***)
    #
    #
    propagation_elements = PropagationElements()
    beamline_element = BeamlineElement(
        optical_element=optical_element,
        coordinates=ElementCoordinates(
            p=0.000000,
            q=28.300000,
            angle_radial=numpy.radians(0.000000),
            angle_azimuthal=numpy.radians(0.000000)))
    propagation_elements.add_beamline_element(beamline_element)
    propagation_parameters = PropagationParameters(
        wavefront=input_wavefront.duplicate(),
        propagation_elements=propagation_elements)
    #self.set_additional_parameters(propagation_parameters)
    #
    propagation_parameters.set_additional_parameters('shift_half_pixel', 1)
    propagation_parameters.set_additional_parameters('magnification_x',
                                                     8.000000)
    propagation_parameters.set_additional_parameters('magnification_y',
                                                     10.000000)
    #
    propagator = PropagationManager.Instance()
    try:
        propagator.add_propagator(FresnelZoomXY2D())
    except:
        pass
    output_wavefront = propagator.do_propagation(
        propagation_parameters=propagation_parameters,
        handler_name='FRESNEL_ZOOM_XY_2D')

    input_wavefront = output_wavefront

    #
    # info on current oe
    #
    #
    #    -------WOSlit---------
    #        -------Rectangle---------
    #        x_left: -0.0018849 m # x (width) minimum (signed)
    #        x_right: 0.0018849 m # x (width) maximum (signed)
    #        y_bottom: -0.0018849 m # y (length) minimum (signed)
    #        y_top: 0.0018849 m # y (length) maximum (signed)
    #

    #
    # define current oe
    #
    from syned.beamline.shape import Rectangle
    boundary_shape = Rectangle(x_left=-0.0018849,
                               x_right=0.0018849,
                               y_bottom=-0.0018849,
                               y_top=0.0018849)

    from wofry.beamline.optical_elements.absorbers.slit import WOSlit
    optical_element = WOSlit(boundary_shape=boundary_shape)

    #
    # propagating (***  ONLY THE ZOOM PROPAGATOR IS IMPLEMENTED ***)
    #
    #
    propagation_elements = PropagationElements()
    beamline_element = BeamlineElement(
        optical_element=optical_element,
        coordinates=ElementCoordinates(
            p=0.000000,
            q=0.000000,
            angle_radial=numpy.radians(0.000000),
            angle_azimuthal=numpy.radians(0.000000)))
    propagation_elements.add_beamline_element(beamline_element)
    propagation_parameters = PropagationParameters(
        wavefront=input_wavefront.duplicate(),
        propagation_elements=propagation_elements)
    #self.set_additional_parameters(propagation_parameters)
    #
    propagation_parameters.set_additional_parameters('shift_half_pixel', 1)
    propagation_parameters.set_additional_parameters('magnification_x',
                                                     1.000000)
    propagation_parameters.set_additional_parameters('magnification_y',
                                                     1.000000)
    #
    propagator = PropagationManager.Instance()
    try:
        propagator.add_propagator(FresnelZoomXY2D())
    except:
        pass
    output_wavefront = propagator.do_propagation(
        propagation_parameters=propagation_parameters,
        handler_name='FRESNEL_ZOOM_XY_2D')

    input_wavefront = output_wavefront

    #
    # info on current oe
    #
    #
    #    -------WOIdealLens---------
    #        focal_x: 8.319 m # Focal length in x [horizontal]
    #        focal_y: 99999999999999.0 m # Focal length in y [vertical]
    #

    #
    # define current oe
    #
    from wofry.beamline.optical_elements.ideal_elements.lens import WOIdealLens

    optical_element = WOIdealLens(name='',
                                  focal_x=8.319000,
                                  focal_y=99999999999999.000000)

    #
    # propagating (***  ONLY THE ZOOM PROPAGATOR IS IMPLEMENTED ***)
    #
    #
    propagation_elements = PropagationElements()
    beamline_element = BeamlineElement(
        optical_element=optical_element,
        coordinates=ElementCoordinates(
            p=0.000000,
            q=0.000000,
            angle_radial=numpy.radians(0.000000),
            angle_azimuthal=numpy.radians(0.000000)))
    propagation_elements.add_beamline_element(beamline_element)
    propagation_parameters = PropagationParameters(
        wavefront=input_wavefront.duplicate(),
        propagation_elements=propagation_elements)
    #self.set_additional_parameters(propagation_parameters)
    #
    propagation_parameters.set_additional_parameters('shift_half_pixel', 1)
    propagation_parameters.set_additional_parameters('magnification_x',
                                                     1.000000)
    propagation_parameters.set_additional_parameters('magnification_y',
                                                     1.000000)
    #
    propagator = PropagationManager.Instance()
    try:
        propagator.add_propagator(FresnelZoomXY2D())
    except:
        pass
    output_wavefront = propagator.do_propagation(
        propagation_parameters=propagation_parameters,
        handler_name='FRESNEL_ZOOM_XY_2D')

    input_wavefront = output_wavefront

    #
    # info on current oe
    #
    #
    #    -------WOSlit---------
    #        -------Rectangle---------
    #        x_left: -2.5e-05 m # x (width) minimum (signed)
    #        x_right: 2.5e-05 m # x (width) maximum (signed)
    #        y_bottom: -0.5 m # y (length) minimum (signed)
    #        y_top: 0.5 m # y (length) maximum (signed)
    #

    #
    # define current oe
    #
    from syned.beamline.shape import Rectangle
    boundary_shape = Rectangle(x_left=-2.5e-05,
                               x_right=2.5e-05,
                               y_bottom=-0.5,
                               y_top=0.5)

    from wofry.beamline.optical_elements.absorbers.slit import WOSlit
    optical_element = WOSlit(boundary_shape=boundary_shape)

    #
    # propagating (***  ONLY THE ZOOM PROPAGATOR IS IMPLEMENTED ***)
    #
    #
    propagation_elements = PropagationElements()
    beamline_element = BeamlineElement(
        optical_element=optical_element,
        coordinates=ElementCoordinates(
            p=11.700000,
            q=0.000000,
            angle_radial=numpy.radians(0.000000),
            angle_azimuthal=numpy.radians(0.000000)))
    propagation_elements.add_beamline_element(beamline_element)
    propagation_parameters = PropagationParameters(
        wavefront=input_wavefront.duplicate(),
        propagation_elements=propagation_elements)
    #self.set_additional_parameters(propagation_parameters)
    #
    propagation_parameters.set_additional_parameters('shift_half_pixel', 1)
    propagation_parameters.set_additional_parameters('magnification_x',
                                                     0.010000)
    propagation_parameters.set_additional_parameters('magnification_y',
                                                     1.000000)
    #
    propagator = PropagationManager.Instance()
    try:
        propagator.add_propagator(FresnelZoomXY2D())
    except:
        pass
    output_wavefront = propagator.do_propagation(
        propagation_parameters=propagation_parameters,
        handler_name='FRESNEL_ZOOM_XY_2D')

    input_wavefront = output_wavefront

    #
    #
    # #########################   KB  #########################################
    #
    #

    #
    # info on current oe
    #
    #
    #    -------WOSlit---------
    #        -------Rectangle---------
    #        x_left: -0.025 m # x (width) minimum (signed)
    #        x_right: 0.025 m # x (width) maximum (signed)
    #        y_bottom: -0.00045 m # y (length) minimum (signed)
    #        y_top: 0.00045 m # y (length) maximum (signed)
    #

    #
    # define current oe
    #
    from syned.beamline.shape import Rectangle
    boundary_shape = Rectangle(x_left=-0.025,
                               x_right=0.025,
                               y_bottom=-0.00045,
                               y_top=0.00045)

    from wofry.beamline.optical_elements.absorbers.slit import WOSlit
    optical_element = WOSlit(boundary_shape=boundary_shape)

    #
    # propagating (***  ONLY THE ZOOM PROPAGATOR IS IMPLEMENTED ***)
    #
    #
    propagation_elements = PropagationElements()
    beamline_element = BeamlineElement(
        optical_element=optical_element,
        coordinates=ElementCoordinates(
            p=144.900000,
            q=0.000000,
            angle_radial=numpy.radians(0.000000),
            angle_azimuthal=numpy.radians(0.000000)))
    propagation_elements.add_beamline_element(beamline_element)
    propagation_parameters = PropagationParameters(
        wavefront=input_wavefront.duplicate(),
        propagation_elements=propagation_elements)
    # self.set_additional_parameters(propagation_parameters)
    #
    propagation_parameters.set_additional_parameters('shift_half_pixel', 1)
    propagation_parameters.set_additional_parameters('magnification_x',
                                                     440.000000)
    propagation_parameters.set_additional_parameters('magnification_y',
                                                     5.000000)
    #
    propagator = PropagationManager.Instance()
    try:
        propagator.add_propagator(FresnelZoomXY2D())
    except:
        pass
    output_wavefront = propagator.do_propagation(
        propagation_parameters=propagation_parameters,
        handler_name='FRESNEL_ZOOM_XY_2D')

    input_wavefront = output_wavefront

    #
    # info on current oe
    #
    #
    #    -------WOIdealLens---------
    #        focal_x: 100000000.0 m # Focal length in x [horizontal]
    #        focal_y: 0.09994594594594594 m # Focal length in y [vertical]
    #

    #
    # define current oe
    #
    from wofry.beamline.optical_elements.ideal_elements.lens import WOIdealLens

    optical_element = WOIdealLens(name='',
                                  focal_x=100000000.000000,
                                  focal_y=0.099946)

    #
    # propagating (***  ONLY THE ZOOM PROPAGATOR IS IMPLEMENTED ***)
    #
    #
    propagation_elements = PropagationElements()
    beamline_element = BeamlineElement(
        optical_element=optical_element,
        coordinates=ElementCoordinates(
            p=0.000000,
            q=0.000000,
            angle_radial=numpy.radians(0.000000),
            angle_azimuthal=numpy.radians(0.000000)))
    propagation_elements.add_beamline_element(beamline_element)
    propagation_parameters = PropagationParameters(
        wavefront=input_wavefront.duplicate(),
        propagation_elements=propagation_elements)
    # self.set_additional_parameters(propagation_parameters)
    #
    propagation_parameters.set_additional_parameters('shift_half_pixel', 1)
    propagation_parameters.set_additional_parameters('magnification_x',
                                                     1.000000)
    propagation_parameters.set_additional_parameters('magnification_y',
                                                     1.000000)
    #
    propagator = PropagationManager.Instance()
    try:
        propagator.add_propagator(FresnelZoomXY2D())
    except:
        pass
    output_wavefront = propagator.do_propagation(
        propagation_parameters=propagation_parameters,
        handler_name='FRESNEL_ZOOM_XY_2D')

    input_wavefront = output_wavefront

    #
    # info on current oe
    #
    #
    #    -------WOSlit---------
    #        -------Rectangle---------
    #        x_left: -0.000195 m # x (width) minimum (signed)
    #        x_right: 0.000195 m # x (width) maximum (signed)
    #        y_bottom: -0.0065 m # y (length) minimum (signed)
    #        y_top: 0.0065 m # y (length) maximum (signed)
    #

    #
    # define current oe
    #
    from syned.beamline.shape import Rectangle
    boundary_shape = Rectangle(x_left=-0.000195,
                               x_right=0.000195,
                               y_bottom=-0.0065,
                               y_top=0.0065)

    from wofry.beamline.optical_elements.absorbers.slit import WOSlit
    optical_element = WOSlit(boundary_shape=boundary_shape)

    #
    # propagating (***  ONLY THE ZOOM PROPAGATOR IS IMPLEMENTED ***)
    #
    #
    propagation_elements = PropagationElements()
    beamline_element = BeamlineElement(
        optical_element=optical_element,
        coordinates=ElementCoordinates(
            p=0.050000,
            q=0.000000,
            angle_radial=numpy.radians(0.000000),
            angle_azimuthal=numpy.radians(0.000000)))
    propagation_elements.add_beamline_element(beamline_element)
    propagation_parameters = PropagationParameters(
        wavefront=input_wavefront.duplicate(),
        propagation_elements=propagation_elements)
    # self.set_additional_parameters(propagation_parameters)
    #
    propagation_parameters.set_additional_parameters('shift_half_pixel', 1)
    propagation_parameters.set_additional_parameters('magnification_x',
                                                     1.000000)
    propagation_parameters.set_additional_parameters('magnification_y',
                                                     0.500000)
    #
    propagator = PropagationManager.Instance()
    try:
        propagator.add_propagator(FresnelZoomXY2D())
    except:
        pass
    output_wavefront = propagator.do_propagation(
        propagation_parameters=propagation_parameters,
        handler_name='FRESNEL_ZOOM_XY_2D')

    input_wavefront = output_wavefront

    #
    # info on current oe
    #
    #
    #    -------WOIdealLens---------
    #        focal_x: 0.049982758620701014 m # Focal length in x [horizontal]
    #        focal_y: 100000000.0 m # Focal length in y [vertical]
    #

    #
    # define current oe
    #
    from wofry.beamline.optical_elements.ideal_elements.lens import WOIdealLens

    optical_element = WOIdealLens(name='',
                                  focal_x=0.049983,
                                  focal_y=100000000.000000)

    #
    # propagating (***  ONLY THE ZOOM PROPAGATOR IS IMPLEMENTED ***)
    #
    #
    propagation_elements = PropagationElements()
    beamline_element = BeamlineElement(
        optical_element=optical_element,
        coordinates=ElementCoordinates(
            p=0.000000,
            q=0.000000,
            angle_radial=numpy.radians(0.000000),
            angle_azimuthal=numpy.radians(0.000000)))
    propagation_elements.add_beamline_element(beamline_element)
    propagation_parameters = PropagationParameters(
        wavefront=input_wavefront.duplicate(),
        propagation_elements=propagation_elements)
    # self.set_additional_parameters(propagation_parameters)
    #
    propagation_parameters.set_additional_parameters('shift_half_pixel', 1)
    propagation_parameters.set_additional_parameters('magnification_x',
                                                     1.000000)
    propagation_parameters.set_additional_parameters('magnification_y',
                                                     1.000000)
    #
    propagator = PropagationManager.Instance()
    try:
        propagator.add_propagator(FresnelZoomXY2D())
    except:
        pass
    output_wavefront = propagator.do_propagation(
        propagation_parameters=propagation_parameters,
        handler_name='FRESNEL_ZOOM_XY_2D')

    input_wavefront = output_wavefront

    #
    # info on current oe
    #
    #
    #    -------WOSlit---------
    #        -------Rectangle---------
    #        x_left: -0.5 m # x (width) minimum (signed)
    #        x_right: 0.5 m # x (width) maximum (signed)
    #        y_bottom: -0.5 m # y (length) minimum (signed)
    #        y_top: 0.5 m # y (length) maximum (signed)
    #

    #
    # define current oe
    #
    from syned.beamline.shape import Rectangle
    boundary_shape = Rectangle(x_left=-0.5,
                               x_right=0.5,
                               y_bottom=-0.5,
                               y_top=0.5)

    from wofry.beamline.optical_elements.absorbers.slit import WOSlit
    optical_element = WOSlit(boundary_shape=boundary_shape)

    #
    # propagating (***  ONLY THE ZOOM PROPAGATOR IS IMPLEMENTED ***)
    #
    #
    propagation_elements = PropagationElements()
    beamline_element = BeamlineElement(
        optical_element=optical_element,
        coordinates=ElementCoordinates(
            p=0.050000,
            q=0.000000,
            angle_radial=numpy.radians(0.000000),
            angle_azimuthal=numpy.radians(0.000000)))
    propagation_elements.add_beamline_element(beamline_element)
    propagation_parameters = PropagationParameters(
        wavefront=input_wavefront.duplicate(),
        propagation_elements=propagation_elements)
    # self.set_additional_parameters(propagation_parameters)
    #
    propagation_parameters.set_additional_parameters('shift_half_pixel', 1)
    propagation_parameters.set_additional_parameters('magnification_x',
                                                     0.000070)
    propagation_parameters.set_additional_parameters('magnification_y',
                                                     0.000090)
    #
    propagator = PropagationManager.Instance()
    try:
        propagator.add_propagator(FresnelZoomXY2D())
    except:
        pass
    output_wavefront = propagator.do_propagation(
        propagation_parameters=propagation_parameters,
        handler_name='FRESNEL_ZOOM_XY_2D')

    input_wavefront = output_wavefront

    return input_wavefront
Ejemplo n.º 8
0
def get_wofry_beamline_elements():

    ELEMENTS = []
    COORDINATES = []
    HANDLERS = []
    SPECIFIC = []

    #
    # info on current oe 0
    #
    #
    #    -------WOScreen---------
    #        -------BoundaryShape---------
    #

    #
    # define current oe
    #
    from wofry.beamline.optical_elements.ideal_elements.screen import WOScreen
    optical_element = WOScreen()

    ELEMENTS.append(optical_element)
    COORDINATES.append(
        ElementCoordinates(p=0.0,
                           q=28.30,
                           angle_radial=0.0,
                           angle_azimuthal=0.0))
    HANDLERS.append('FRESNEL_ZOOM_XY_2D')
    SPECIFIC.append({
        'shift_half_pixel': 1,
        'magnification_x': 8.0,
        'magnification_y': 10.0
    })

    #
    # info on current oe 1
    #
    #
    #    -------WOSlit---------
    #        -------Rectangle---------
    #        x_left: -0.0018849 m # x (width) minimum (signed)
    #        x_right: 0.0018849 m # x (width) maximum (signed)
    #        y_bottom: -0.0018849 m # y (length) minimum (signed)
    #        y_top: 0.0018849 m # y (length) maximum (signed)
    #

    #
    # define current oe
    #
    from syned.beamline.shape import Rectangle
    boundary_shape = Rectangle(x_left=-0.0018849,
                               x_right=0.0018849,
                               y_bottom=-0.0018849,
                               y_top=0.0018849)

    from wofry.beamline.optical_elements.absorbers.slit import WOSlit
    optical_element = WOSlit(boundary_shape=boundary_shape)

    ELEMENTS.append(optical_element)
    COORDINATES.append(
        ElementCoordinates(p=0.0, q=0.0, angle_radial=0.0,
                           angle_azimuthal=0.0))
    HANDLERS.append('FRESNEL_ZOOM_XY_2D')
    SPECIFIC.append({
        'shift_half_pixel': 1,
        'magnification_x': 1.0,
        'magnification_y': 1.0
    })

    #
    # info on current oe 2
    #
    #
    #    -------WOIdealLens---------
    #        focal_x: 8.319 m # Focal length in x [horizontal]
    #        focal_y: 99999999999999.0 m # Focal length in y [vertical]
    #

    #
    # define current oe
    #
    from wofry.beamline.optical_elements.ideal_elements.lens import WOIdealLens

    optical_element = WOIdealLens(name='',
                                  focal_x=8.319000,
                                  focal_y=99999999999999.000000)

    ELEMENTS.append(optical_element)
    COORDINATES.append(
        ElementCoordinates(p=0.0, q=0.0, angle_radial=0.0,
                           angle_azimuthal=0.0))
    HANDLERS.append('FRESNEL_ZOOM_XY_2D')
    SPECIFIC.append({
        'shift_half_pixel': 1,
        'magnification_x': 1.0,
        'magnification_y': 1.0
    })

    #
    # info on current oe 3
    #
    #
    #    -------WOSlit---------
    #        -------Rectangle---------
    #        x_left: -2.5e-05 m # x (width) minimum (signed)
    #        x_right: 2.5e-05 m # x (width) maximum (signed)
    #        y_bottom: -0.5 m # y (length) minimum (signed)
    #        y_top: 0.5 m # y (length) maximum (signed)
    #

    #
    # define current oe
    #
    from syned.beamline.shape import Rectangle
    boundary_shape = Rectangle(x_left=-2.5e-05,
                               x_right=2.5e-05,
                               y_bottom=-0.5,
                               y_top=0.5)

    from wofry.beamline.optical_elements.absorbers.slit import WOSlit
    optical_element = WOSlit(boundary_shape=boundary_shape)

    ELEMENTS.append(optical_element)
    COORDINATES.append(
        ElementCoordinates(p=11.70,
                           q=0.0,
                           angle_radial=0.0,
                           angle_azimuthal=0.0))
    HANDLERS.append('FRESNEL_ZOOM_XY_2D')
    SPECIFIC.append({
        'shift_half_pixel': 1,
        'magnification_x': 0.01,
        'magnification_y': 1.0
    })

    #
    #
    # #########################   KB  #########################################
    #
    #

    #
    # info on current oe 4
    #
    #
    #    -------WOSlit---------
    #        -------Rectangle---------
    #        x_left: -0.025 m # x (width) minimum (signed)
    #        x_right: 0.025 m # x (width) maximum (signed)
    #        y_bottom: -0.00045 m # y (length) minimum (signed)
    #        y_top: 0.00045 m # y (length) maximum (signed)
    #

    #
    # define current oe
    #
    from syned.beamline.shape import Rectangle
    boundary_shape = Rectangle(x_left=-0.025,
                               x_right=0.025,
                               y_bottom=-0.00045,
                               y_top=0.00045)

    from wofry.beamline.optical_elements.absorbers.slit import WOSlit
    optical_element = WOSlit(boundary_shape=boundary_shape)

    ELEMENTS.append(optical_element)
    COORDINATES.append(
        ElementCoordinates(p=144.9,
                           q=0.0,
                           angle_radial=0.0,
                           angle_azimuthal=0.0))
    HANDLERS.append('FRESNEL_ZOOM_XY_2D')
    SPECIFIC.append({
        'shift_half_pixel': 1,
        'magnification_x': 440.0,
        'magnification_y': 5.0
    })

    #
    # info on current oe 5
    #
    #
    #    -------WOIdealLens---------
    #        focal_x: 100000000.0 m # Focal length in x [horizontal]
    #        focal_y: 0.09994594594594594 m # Focal length in y [vertical]
    #

    #
    # define current oe
    #
    from wofry.beamline.optical_elements.ideal_elements.lens import WOIdealLens

    optical_element = WOIdealLens(name='',
                                  focal_x=100000000.000000,
                                  focal_y=0.099946)

    ELEMENTS.append(optical_element)
    COORDINATES.append(
        ElementCoordinates(p=0.0, q=0.0, angle_radial=0.0,
                           angle_azimuthal=0.0))
    HANDLERS.append('FRESNEL_ZOOM_XY_2D')
    SPECIFIC.append({
        'shift_half_pixel': 1,
        'magnification_x': 1.0,
        'magnification_y': 1.0
    })

    #
    # info on current oe 6
    #
    #
    #    -------WOSlit---------
    #        -------Rectangle---------
    #        x_left: -0.000195 m # x (width) minimum (signed)
    #        x_right: 0.000195 m # x (width) maximum (signed)
    #        y_bottom: -0.0065 m # y (length) minimum (signed)
    #        y_top: 0.0065 m # y (length) maximum (signed)
    #

    #
    # define current oe
    #
    from syned.beamline.shape import Rectangle
    boundary_shape = Rectangle(x_left=-0.000195,
                               x_right=0.000195,
                               y_bottom=-0.0065,
                               y_top=0.0065)

    from wofry.beamline.optical_elements.absorbers.slit import WOSlit
    optical_element = WOSlit(boundary_shape=boundary_shape)

    ELEMENTS.append(optical_element)
    COORDINATES.append(
        ElementCoordinates(p=0.05,
                           q=0.0,
                           angle_radial=0.0,
                           angle_azimuthal=0.0))
    HANDLERS.append('FRESNEL_ZOOM_XY_2D')
    SPECIFIC.append({
        'shift_half_pixel': 1,
        'magnification_x': 1.0,
        'magnification_y': 0.5
    })

    #
    # info on current oe 7
    #
    #
    #    -------WOIdealLens---------
    #        focal_x: 0.049982758620701014 m # Focal length in x [horizontal]
    #        focal_y: 100000000.0 m # Focal length in y [vertical]
    #

    #
    # define current oe
    #
    from wofry.beamline.optical_elements.ideal_elements.lens import WOIdealLens

    optical_element = WOIdealLens(name='',
                                  focal_x=0.049983,
                                  focal_y=100000000.000000)

    ELEMENTS.append(optical_element)
    COORDINATES.append(
        ElementCoordinates(p=0.0, q=0.0, angle_radial=0.0,
                           angle_azimuthal=0.0))
    HANDLERS.append('FRESNEL_ZOOM_XY_2D')
    SPECIFIC.append({
        'shift_half_pixel': 1,
        'magnification_x': 1.0,
        'magnification_y': 1.0
    })

    #
    # info on current oe 8
    #
    #
    #    -------WOSlit---------
    #        -------Rectangle---------
    #        x_left: -0.5 m # x (width) minimum (signed)
    #        x_right: 0.5 m # x (width) maximum (signed)
    #        y_bottom: -0.5 m # y (length) minimum (signed)
    #        y_top: 0.5 m # y (length) maximum (signed)
    #

    #
    # define current oe
    #
    from syned.beamline.shape import Rectangle
    boundary_shape = Rectangle(x_left=-0.5,
                               x_right=0.5,
                               y_bottom=-0.5,
                               y_top=0.5)

    from wofry.beamline.optical_elements.absorbers.slit import WOSlit
    optical_element = WOSlit(boundary_shape=boundary_shape)

    ELEMENTS.append(optical_element)
    COORDINATES.append(
        ElementCoordinates(p=0.05,
                           q=0.0,
                           angle_radial=0.0,
                           angle_azimuthal=0.0))
    HANDLERS.append('FRESNEL_ZOOM_XY_2D')
    SPECIFIC.append({
        'shift_half_pixel': 1,
        'magnification_x': 0.000070,
        'magnification_y': 0.000090
    })

    return ELEMENTS, COORDINATES, HANDLERS, SPECIFIC