syned 1.0.47__py3-none-any.whl → 1.0.49__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- syned/beamline/__init__.py +1 -1
- syned/beamline/beamline.py +155 -155
- syned/beamline/beamline_element.py +76 -76
- syned/beamline/element_coordinates.py +199 -199
- syned/beamline/optical_element.py +47 -47
- syned/beamline/optical_element_with_surface_shape.py +126 -126
- syned/beamline/optical_elements/__init__.py +1 -1
- syned/beamline/optical_elements/absorbers/absorber.py +21 -21
- syned/beamline/optical_elements/absorbers/beam_stopper.py +63 -63
- syned/beamline/optical_elements/absorbers/filter.py +61 -61
- syned/beamline/optical_elements/absorbers/holed_filter.py +67 -67
- syned/beamline/optical_elements/absorbers/slit.py +80 -80
- syned/beamline/optical_elements/crystals/__init__.py +1 -1
- syned/beamline/optical_elements/crystals/crystal.py +70 -70
- syned/beamline/optical_elements/gratings/__init__.py +1 -1
- syned/beamline/optical_elements/gratings/grating.py +279 -279
- syned/beamline/optical_elements/ideal_elements/__init__.py +1 -1
- syned/beamline/optical_elements/ideal_elements/ideal_element.py +15 -15
- syned/beamline/optical_elements/ideal_elements/ideal_fzp.py +183 -183
- syned/beamline/optical_elements/ideal_elements/ideal_lens.py +54 -54
- syned/beamline/optical_elements/ideal_elements/screen.py +15 -15
- syned/beamline/optical_elements/mirrors/__init__.py +1 -1
- syned/beamline/optical_elements/mirrors/mirror.py +39 -39
- syned/beamline/optical_elements/multilayers/__init__.py +46 -46
- syned/beamline/optical_elements/multilayers/multilayer.py +45 -45
- syned/beamline/optical_elements/refractors/__init__.py +1 -1
- syned/beamline/optical_elements/refractors/crl.py +79 -79
- syned/beamline/optical_elements/refractors/interface.py +60 -60
- syned/beamline/optical_elements/refractors/lens.py +105 -105
- syned/beamline/shape.py +2884 -2803
- syned/storage_ring/__init__.py +1 -1
- syned/storage_ring/electron_beam.py +804 -804
- syned/storage_ring/empty_light_source.py +40 -40
- syned/storage_ring/light_source.py +90 -90
- syned/storage_ring/magnetic_structure.py +8 -8
- syned/storage_ring/magnetic_structures/__init__.py +1 -1
- syned/storage_ring/magnetic_structures/bending_magnet.py +329 -329
- syned/storage_ring/magnetic_structures/insertion_device.py +169 -169
- syned/storage_ring/magnetic_structures/undulator.py +413 -413
- syned/storage_ring/magnetic_structures/wiggler.py +27 -27
- syned/syned_object.py +273 -264
- syned/util/__init__.py +21 -21
- syned/util/json_tools.py +196 -198
- syned/widget/widget_decorator.py +66 -66
- {syned-1.0.47.dist-info → syned-1.0.49.dist-info}/METADATA +88 -88
- syned-1.0.49.dist-info/RECORD +52 -0
- {syned-1.0.47.dist-info → syned-1.0.49.dist-info}/WHEEL +1 -1
- {syned-1.0.47.dist-info → syned-1.0.49.dist-info}/licenses/LICENSE +20 -20
- syned/__test/__init__.py +0 -46
- syned/__test/test.py +0 -28
- syned-1.0.47.dist-info/RECORD +0 -54
- {syned-1.0.47.dist-info → syned-1.0.49.dist-info}/top_level.txt +0 -0
|
@@ -1,105 +1,105 @@
|
|
|
1
|
-
from syned.beamline.optical_element_with_surface_shape import OpticalElementsWithMultipleShapes
|
|
2
|
-
from syned.beamline.shape import Plane
|
|
3
|
-
|
|
4
|
-
class Lens(OpticalElementsWithMultipleShapes):
|
|
5
|
-
def __init__(self,
|
|
6
|
-
name="Undefined",
|
|
7
|
-
surface_shape1=None,
|
|
8
|
-
surface_shape2=None,
|
|
9
|
-
boundary_shape=None,
|
|
10
|
-
material="",
|
|
11
|
-
thickness=0.0):
|
|
12
|
-
"""
|
|
13
|
-
Defines a lens. It is composed by two surfaces (surface_shape1 and surface_shape2) and a material
|
|
14
|
-
within them.
|
|
15
|
-
|
|
16
|
-
Parameters
|
|
17
|
-
----------
|
|
18
|
-
name : str, optional
|
|
19
|
-
The name of the optical element.
|
|
20
|
-
surface_shape1 : instance of SurfaceShape, optional
|
|
21
|
-
The geometry of the lens surface 1. if None, it is initialized to SurfaceShape().
|
|
22
|
-
surface_shape2 : instance of SurfaceShape, optional
|
|
23
|
-
The geometry of the lens surface 2. if None, it is initialized to SurfaceShape().
|
|
24
|
-
boundary_shape : instance of BoundaryShape, optional
|
|
25
|
-
The geometry of the slit aperture. if None, it is initialized to BoundaryShape().
|
|
26
|
-
material : str
|
|
27
|
-
A string defining the material within the two surfaces.
|
|
28
|
-
thickness : float
|
|
29
|
-
The distance between the two surfaces at the center of the lens in m.
|
|
30
|
-
|
|
31
|
-
"""
|
|
32
|
-
|
|
33
|
-
if surface_shape1 is None: surface_shape1 = Plane()
|
|
34
|
-
if surface_shape2 is None: surface_shape2 = Plane()
|
|
35
|
-
|
|
36
|
-
super(Lens, self).__init__(name=name,
|
|
37
|
-
boundary_shape=boundary_shape,
|
|
38
|
-
surface_shapes=[surface_shape1, surface_shape2])
|
|
39
|
-
self._material = material
|
|
40
|
-
self._thickness = thickness
|
|
41
|
-
|
|
42
|
-
# support text contaning name of variable, help text and unit. Will be stored in self._support_dictionary
|
|
43
|
-
self._set_support_text([
|
|
44
|
-
("name", "Name" , "" ),
|
|
45
|
-
("surface_shapes", "Surface shapes", ""),
|
|
46
|
-
("boundary_shape", "Boundary shape", "" ),
|
|
47
|
-
("material", "Material (element, compound or name)", "" ),
|
|
48
|
-
("thickness", "Thickness", "m"),
|
|
49
|
-
] )
|
|
50
|
-
|
|
51
|
-
def get_thickness(self):
|
|
52
|
-
"""
|
|
53
|
-
Returns the lens thickness in m.
|
|
54
|
-
|
|
55
|
-
Returns
|
|
56
|
-
-------
|
|
57
|
-
float
|
|
58
|
-
|
|
59
|
-
"""
|
|
60
|
-
return self._thickness
|
|
61
|
-
|
|
62
|
-
def get_material(self):
|
|
63
|
-
"""
|
|
64
|
-
Returns the lens material.
|
|
65
|
-
|
|
66
|
-
Returns
|
|
67
|
-
-------
|
|
68
|
-
str
|
|
69
|
-
|
|
70
|
-
"""
|
|
71
|
-
return self._material
|
|
72
|
-
|
|
73
|
-
def get_boundary_shape(self):
|
|
74
|
-
"""
|
|
75
|
-
Returns the boundary shape.
|
|
76
|
-
|
|
77
|
-
Returns
|
|
78
|
-
-------
|
|
79
|
-
instance of BoundaryShape
|
|
80
|
-
|
|
81
|
-
"""
|
|
82
|
-
return self._boundary_shape
|
|
83
|
-
|
|
84
|
-
def get_surface_shape1(self):
|
|
85
|
-
"""
|
|
86
|
-
Returns the shape of surface 1.
|
|
87
|
-
|
|
88
|
-
Returns
|
|
89
|
-
-------
|
|
90
|
-
instance of SurfaceShape
|
|
91
|
-
|
|
92
|
-
"""
|
|
93
|
-
return self.get_surface_shape(index=0)
|
|
94
|
-
|
|
95
|
-
def get_surface_shape2(self):
|
|
96
|
-
"""
|
|
97
|
-
Returns the shape of surface 2.
|
|
98
|
-
|
|
99
|
-
Returns
|
|
100
|
-
-------
|
|
101
|
-
instance of SurfaceShape
|
|
102
|
-
|
|
103
|
-
"""
|
|
104
|
-
return self.get_surface_shape(index=1)
|
|
105
|
-
|
|
1
|
+
from syned.beamline.optical_element_with_surface_shape import OpticalElementsWithMultipleShapes
|
|
2
|
+
from syned.beamline.shape import Plane
|
|
3
|
+
|
|
4
|
+
class Lens(OpticalElementsWithMultipleShapes):
|
|
5
|
+
def __init__(self,
|
|
6
|
+
name="Undefined",
|
|
7
|
+
surface_shape1=None,
|
|
8
|
+
surface_shape2=None,
|
|
9
|
+
boundary_shape=None,
|
|
10
|
+
material="",
|
|
11
|
+
thickness=0.0):
|
|
12
|
+
"""
|
|
13
|
+
Defines a lens. It is composed by two surfaces (surface_shape1 and surface_shape2) and a material
|
|
14
|
+
within them.
|
|
15
|
+
|
|
16
|
+
Parameters
|
|
17
|
+
----------
|
|
18
|
+
name : str, optional
|
|
19
|
+
The name of the optical element.
|
|
20
|
+
surface_shape1 : instance of SurfaceShape, optional
|
|
21
|
+
The geometry of the lens surface 1. if None, it is initialized to SurfaceShape().
|
|
22
|
+
surface_shape2 : instance of SurfaceShape, optional
|
|
23
|
+
The geometry of the lens surface 2. if None, it is initialized to SurfaceShape().
|
|
24
|
+
boundary_shape : instance of BoundaryShape, optional
|
|
25
|
+
The geometry of the slit aperture. if None, it is initialized to BoundaryShape().
|
|
26
|
+
material : str
|
|
27
|
+
A string defining the material within the two surfaces.
|
|
28
|
+
thickness : float
|
|
29
|
+
The distance between the two surfaces at the center of the lens in m.
|
|
30
|
+
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
if surface_shape1 is None: surface_shape1 = Plane()
|
|
34
|
+
if surface_shape2 is None: surface_shape2 = Plane()
|
|
35
|
+
|
|
36
|
+
super(Lens, self).__init__(name=name,
|
|
37
|
+
boundary_shape=boundary_shape,
|
|
38
|
+
surface_shapes=[surface_shape1, surface_shape2])
|
|
39
|
+
self._material = material
|
|
40
|
+
self._thickness = thickness
|
|
41
|
+
|
|
42
|
+
# support text contaning name of variable, help text and unit. Will be stored in self._support_dictionary
|
|
43
|
+
self._set_support_text([
|
|
44
|
+
("name", "Name" , "" ),
|
|
45
|
+
("surface_shapes", "Surface shapes", ""),
|
|
46
|
+
("boundary_shape", "Boundary shape", "" ),
|
|
47
|
+
("material", "Material (element, compound or name)", "" ),
|
|
48
|
+
("thickness", "Thickness", "m"),
|
|
49
|
+
] )
|
|
50
|
+
|
|
51
|
+
def get_thickness(self):
|
|
52
|
+
"""
|
|
53
|
+
Returns the lens thickness in m.
|
|
54
|
+
|
|
55
|
+
Returns
|
|
56
|
+
-------
|
|
57
|
+
float
|
|
58
|
+
|
|
59
|
+
"""
|
|
60
|
+
return self._thickness
|
|
61
|
+
|
|
62
|
+
def get_material(self):
|
|
63
|
+
"""
|
|
64
|
+
Returns the lens material.
|
|
65
|
+
|
|
66
|
+
Returns
|
|
67
|
+
-------
|
|
68
|
+
str
|
|
69
|
+
|
|
70
|
+
"""
|
|
71
|
+
return self._material
|
|
72
|
+
|
|
73
|
+
def get_boundary_shape(self):
|
|
74
|
+
"""
|
|
75
|
+
Returns the boundary shape.
|
|
76
|
+
|
|
77
|
+
Returns
|
|
78
|
+
-------
|
|
79
|
+
instance of BoundaryShape
|
|
80
|
+
|
|
81
|
+
"""
|
|
82
|
+
return self._boundary_shape
|
|
83
|
+
|
|
84
|
+
def get_surface_shape1(self):
|
|
85
|
+
"""
|
|
86
|
+
Returns the shape of surface 1.
|
|
87
|
+
|
|
88
|
+
Returns
|
|
89
|
+
-------
|
|
90
|
+
instance of SurfaceShape
|
|
91
|
+
|
|
92
|
+
"""
|
|
93
|
+
return self.get_surface_shape(index=0)
|
|
94
|
+
|
|
95
|
+
def get_surface_shape2(self):
|
|
96
|
+
"""
|
|
97
|
+
Returns the shape of surface 2.
|
|
98
|
+
|
|
99
|
+
Returns
|
|
100
|
+
-------
|
|
101
|
+
instance of SurfaceShape
|
|
102
|
+
|
|
103
|
+
"""
|
|
104
|
+
return self.get_surface_shape(index=1)
|
|
105
|
+
|