Esempio n. 1
0
 def __init__(self, name="Undefined"):
     Screen.__init__(self, name=name)
from syned.beamline.shape import Rectangle
from syned.storage_ring.light_source import LightSource

from syned.beamline.beamline import Beamline
from syned.beamline.beamline_element import BeamlineElement
from syned.beamline.element_coordinates import ElementCoordinates



if __name__ == "__main__":



    src1 = ElectronBeam.initialize_as_pencil_beam(energy_in_GeV=6.0,current=0.2)
    src2 = Undulator()
    screen1 = Screen("screen1")
    lens1 = IdealLens(name="lens1",focal_y=6.0,focal_x=None,)
    filter1 = Filter("filter1","H2O",3.0e-6)
    slit1 = Slit(name="slit1",boundary_shape=Rectangle(-0.5e-3,0.5e-3,-2e-3,2e-3))
    stopper1 = BeamStopper(name="stopper1",boundary_shape=Rectangle(-0.5e-3,0.5e-3,-2e-3,2e-3))
    mirror1 = Mirror(name="mirror1",boundary_shape=Rectangle(-0.5e-3,0.5e-3,-2e-3,2e-3))
    crystal1 = Crystal(name="crystal1",surface_shape=Plane())
    grating1 = Grating(name="grating1",surface_shape=Conic())

    mylist = [src1,src2,screen1,lens1,filter1,slit1, stopper1, mirror1, grating1, crystal1]

    #
    # test individual elements
    #

    for i,element in enumerate(mylist):
Esempio n. 3
0
 def __init__(self, name="Undefined"):
     SRWOpticalElement.__init__(self, optical_element_displacement=None)
     Screen.__init__(self, name=name)
Esempio n. 4
0
    print(src.info())
    assert (33,src2.get_value_from_key_name("K_horizontal"))

    src1.to_json("tmp_src1.json")
    src2.to_json("tmp_src2.json")



    print("==================== BeamLine elements: ==================")

    #
    # ideal elements
    #

    screen1 = Screen("screen1")

    screen1.keys()
    print(screen1.info())
    print(screen1.to_json())


    lens1 = IdealLens("lens1",3.0)

    lens1.keys()
    print(lens1.info())
    print(lens1.to_json())



    #