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.
Files changed (52) hide show
  1. syned/beamline/__init__.py +1 -1
  2. syned/beamline/beamline.py +155 -155
  3. syned/beamline/beamline_element.py +76 -76
  4. syned/beamline/element_coordinates.py +199 -199
  5. syned/beamline/optical_element.py +47 -47
  6. syned/beamline/optical_element_with_surface_shape.py +126 -126
  7. syned/beamline/optical_elements/__init__.py +1 -1
  8. syned/beamline/optical_elements/absorbers/absorber.py +21 -21
  9. syned/beamline/optical_elements/absorbers/beam_stopper.py +63 -63
  10. syned/beamline/optical_elements/absorbers/filter.py +61 -61
  11. syned/beamline/optical_elements/absorbers/holed_filter.py +67 -67
  12. syned/beamline/optical_elements/absorbers/slit.py +80 -80
  13. syned/beamline/optical_elements/crystals/__init__.py +1 -1
  14. syned/beamline/optical_elements/crystals/crystal.py +70 -70
  15. syned/beamline/optical_elements/gratings/__init__.py +1 -1
  16. syned/beamline/optical_elements/gratings/grating.py +279 -279
  17. syned/beamline/optical_elements/ideal_elements/__init__.py +1 -1
  18. syned/beamline/optical_elements/ideal_elements/ideal_element.py +15 -15
  19. syned/beamline/optical_elements/ideal_elements/ideal_fzp.py +183 -183
  20. syned/beamline/optical_elements/ideal_elements/ideal_lens.py +54 -54
  21. syned/beamline/optical_elements/ideal_elements/screen.py +15 -15
  22. syned/beamline/optical_elements/mirrors/__init__.py +1 -1
  23. syned/beamline/optical_elements/mirrors/mirror.py +39 -39
  24. syned/beamline/optical_elements/multilayers/__init__.py +46 -46
  25. syned/beamline/optical_elements/multilayers/multilayer.py +45 -45
  26. syned/beamline/optical_elements/refractors/__init__.py +1 -1
  27. syned/beamline/optical_elements/refractors/crl.py +79 -79
  28. syned/beamline/optical_elements/refractors/interface.py +60 -60
  29. syned/beamline/optical_elements/refractors/lens.py +105 -105
  30. syned/beamline/shape.py +2884 -2803
  31. syned/storage_ring/__init__.py +1 -1
  32. syned/storage_ring/electron_beam.py +804 -804
  33. syned/storage_ring/empty_light_source.py +40 -40
  34. syned/storage_ring/light_source.py +90 -90
  35. syned/storage_ring/magnetic_structure.py +8 -8
  36. syned/storage_ring/magnetic_structures/__init__.py +1 -1
  37. syned/storage_ring/magnetic_structures/bending_magnet.py +329 -329
  38. syned/storage_ring/magnetic_structures/insertion_device.py +169 -169
  39. syned/storage_ring/magnetic_structures/undulator.py +413 -413
  40. syned/storage_ring/magnetic_structures/wiggler.py +27 -27
  41. syned/syned_object.py +273 -264
  42. syned/util/__init__.py +21 -21
  43. syned/util/json_tools.py +196 -198
  44. syned/widget/widget_decorator.py +66 -66
  45. {syned-1.0.47.dist-info → syned-1.0.49.dist-info}/METADATA +88 -88
  46. syned-1.0.49.dist-info/RECORD +52 -0
  47. {syned-1.0.47.dist-info → syned-1.0.49.dist-info}/WHEEL +1 -1
  48. {syned-1.0.47.dist-info → syned-1.0.49.dist-info}/licenses/LICENSE +20 -20
  49. syned/__test/__init__.py +0 -46
  50. syned/__test/test.py +0 -28
  51. syned-1.0.47.dist-info/RECORD +0 -54
  52. {syned-1.0.47.dist-info → syned-1.0.49.dist-info}/top_level.txt +0 -0
@@ -1,199 +1,199 @@
1
- """
2
- Position coordinates of a beamline component.
3
- """
4
-
5
- from syned.syned_object import SynedObject
6
-
7
- class ElementCoordinates(SynedObject):
8
- """
9
-
10
- """
11
- def __init__(self, p = 0.0, q = 0.0, angle_radial=0.0, angle_azimuthal=0.0, angle_radial_out=None):
12
- """
13
-
14
- Parameters
15
- ----------
16
- p : float, optional
17
- distance from previous element in m.
18
- q : float, optional
19
- distance to next element in m.
20
- angle_radial : float, optional
21
- Radial inclination angle in rads.
22
- angle_azimuthal : float, optional
23
- Azimuthal inclination angle in rads.
24
- angle_radial_out : float, optional
25
- The radial angle in rads in the output direction (default=None, the same as angle_radial).
26
-
27
- """
28
- self._p = p
29
- self._q = q
30
- self._angle_radial = angle_radial
31
- self._angle_azimuthal = angle_azimuthal
32
- self._angle_radial_out = angle_radial_out
33
-
34
- # support text containg name of variable, help text and unit. Will be stored in self._support_dictionary
35
- self._set_support_text([
36
- ("p", "distance from previous continuation plane", "m" ),
37
- ("q", "distance to next continuation plane", "m" ),
38
- ("angle_radial", "incident angle [to normal]", "rad" ),
39
- ("angle_radial_out", "output angle [to normal]", "rad"),
40
- ("angle_azimuthal", "rotation along beam axis", "rad" ),
41
- ])
42
-
43
- def p(self):
44
- """
45
- Returns the distance from previous element.
46
-
47
- Returns
48
- -------
49
- float
50
-
51
- """
52
- return self._p
53
-
54
- def q(self):
55
- """
56
- Returns the distance to next element.
57
-
58
- Returns
59
- -------
60
- float
61
-
62
- """
63
- return self._q
64
-
65
- def angle_radial(self):
66
- """
67
- Returns the radial angle.
68
-
69
- Returns
70
- -------
71
- float
72
-
73
- """
74
- return self._angle_radial
75
-
76
- def angle_radial_out(self):
77
- """
78
- Returns the radial angle in the output direction.
79
-
80
- Returns
81
- -------
82
- float
83
-
84
- """
85
- if self._angle_radial_out is None:
86
- return self.angle_radial()
87
- else:
88
- return self._angle_radial_out
89
-
90
- def angle_azimuthal(self):
91
- """
92
- Returns the azimuthal angle.
93
-
94
- Returns
95
- -------
96
- float
97
-
98
- """
99
- return self._angle_azimuthal
100
-
101
- def set_positions(self, p=0.0, q=0.0, angle_radial=0.0, angle_radial_out=None, angle_azimuthal=0.0):
102
- """
103
- Sets the coordinates.
104
-
105
- Parameters
106
- ----------
107
- p : float, optional
108
- distance from previous element in m.
109
- q : float, optional
110
- distance to next element in m.
111
- angle_radial : float, optional
112
- Radial inclination angle in rads.
113
- angle_azimuthal : float, optional
114
- Azimuthal inclination angle in rads.
115
- angle_radial_out : float, optional
116
- The radial angle in rads in the output direction (default=None, the same as angle_radial).
117
-
118
- """
119
- self._p = p
120
- self._q = q
121
- self._angle_radial = angle_radial
122
- self._angle_radial_out = angle_radial_out
123
- self._angle_azimuthal = angle_azimuthal
124
-
125
- def get_positions(self):
126
- """
127
- Gets the coordinates.
128
-
129
- Returns
130
- -------
131
- tuple
132
- (p, q, angle_radial, angle_radial_out, angle_azimuthal)
133
-
134
- """
135
- return self.p(), \
136
- self.q(), \
137
- self.angle_radial(), \
138
- self.angle_radial_out(), \
139
- self.angle_azimuthal()
140
-
141
- def set_p_and_q(self, p=0.0, q=0.0):
142
- """
143
- Set the distances p and q.
144
-
145
- Parameters
146
- ----------
147
- p : float, optional
148
- distance from previous element in m.
149
- q : float, optional
150
- distance to next element in m.
151
-
152
- """
153
- self._p = p
154
- self._q = q
155
-
156
- def get_p_and_q(self):
157
- """
158
- Gets p and q.
159
-
160
- Returns
161
- -------
162
- tuple
163
- (p,q).
164
-
165
- """
166
- return self.p(), self.q()
167
-
168
- def set_angles(self, angle_radial=0.0, angle_radial_out=None, angle_azimuthal=0.0):
169
- """
170
- Sets the angles.
171
-
172
- Parameters
173
- ----------
174
- angle_radial : float, optional
175
- Radial inclination angle in rads.
176
- angle_azimuthal : float, optional
177
- Azimuthal inclination angle in rads.
178
- angle_radial_out : float, optional
179
- The radial angle in rads in the output direction (default=None, the same as angle_radial).
180
-
181
- Returns
182
- -------
183
-
184
- """
185
- self._angle_radial = angle_radial
186
- self._angle_radial_out = angle_radial_out
187
- self._angle_azimuthal = angle_azimuthal
188
-
189
- def get_angles(self):
190
- """
191
- Get the angles.
192
-
193
- Returns
194
- -------
195
- tuple
196
- (angle_radial, angle_radial_out, angle_azimuthal)
197
-
198
- """
199
- return self.angle_radial(), self.angle_radial_out(), self.angle_azimuthal()
1
+ """
2
+ Position coordinates of a beamline component.
3
+ """
4
+
5
+ from syned.syned_object import SynedObject
6
+
7
+ class ElementCoordinates(SynedObject):
8
+ """
9
+
10
+ """
11
+ def __init__(self, p = 0.0, q = 0.0, angle_radial=0.0, angle_azimuthal=0.0, angle_radial_out=None):
12
+ """
13
+
14
+ Parameters
15
+ ----------
16
+ p : float, optional
17
+ distance from previous element in m.
18
+ q : float, optional
19
+ distance to next element in m.
20
+ angle_radial : float, optional
21
+ Radial inclination angle in rads.
22
+ angle_azimuthal : float, optional
23
+ Azimuthal inclination angle in rads.
24
+ angle_radial_out : float, optional
25
+ The radial angle in rads in the output direction (default=None, the same as angle_radial).
26
+
27
+ """
28
+ self._p = p
29
+ self._q = q
30
+ self._angle_radial = angle_radial
31
+ self._angle_azimuthal = angle_azimuthal
32
+ self._angle_radial_out = angle_radial_out
33
+
34
+ # support text containg name of variable, help text and unit. Will be stored in self._support_dictionary
35
+ self._set_support_text([
36
+ ("p", "distance from previous continuation plane", "m" ),
37
+ ("q", "distance to next continuation plane", "m" ),
38
+ ("angle_radial", "incident angle [to normal]", "rad" ),
39
+ ("angle_radial_out", "output angle [to normal]", "rad"),
40
+ ("angle_azimuthal", "rotation along beam axis", "rad" ),
41
+ ])
42
+
43
+ def p(self):
44
+ """
45
+ Returns the distance from previous element.
46
+
47
+ Returns
48
+ -------
49
+ float
50
+
51
+ """
52
+ return self._p
53
+
54
+ def q(self):
55
+ """
56
+ Returns the distance to next element.
57
+
58
+ Returns
59
+ -------
60
+ float
61
+
62
+ """
63
+ return self._q
64
+
65
+ def angle_radial(self):
66
+ """
67
+ Returns the radial angle.
68
+
69
+ Returns
70
+ -------
71
+ float
72
+
73
+ """
74
+ return self._angle_radial
75
+
76
+ def angle_radial_out(self):
77
+ """
78
+ Returns the radial angle in the output direction.
79
+
80
+ Returns
81
+ -------
82
+ float
83
+
84
+ """
85
+ if self._angle_radial_out is None:
86
+ return self.angle_radial()
87
+ else:
88
+ return self._angle_radial_out
89
+
90
+ def angle_azimuthal(self):
91
+ """
92
+ Returns the azimuthal angle.
93
+
94
+ Returns
95
+ -------
96
+ float
97
+
98
+ """
99
+ return self._angle_azimuthal
100
+
101
+ def set_positions(self, p=0.0, q=0.0, angle_radial=0.0, angle_radial_out=None, angle_azimuthal=0.0):
102
+ """
103
+ Sets the coordinates.
104
+
105
+ Parameters
106
+ ----------
107
+ p : float, optional
108
+ distance from previous element in m.
109
+ q : float, optional
110
+ distance to next element in m.
111
+ angle_radial : float, optional
112
+ Radial inclination angle in rads.
113
+ angle_azimuthal : float, optional
114
+ Azimuthal inclination angle in rads.
115
+ angle_radial_out : float, optional
116
+ The radial angle in rads in the output direction (default=None, the same as angle_radial).
117
+
118
+ """
119
+ self._p = p
120
+ self._q = q
121
+ self._angle_radial = angle_radial
122
+ self._angle_radial_out = angle_radial_out
123
+ self._angle_azimuthal = angle_azimuthal
124
+
125
+ def get_positions(self):
126
+ """
127
+ Gets the coordinates.
128
+
129
+ Returns
130
+ -------
131
+ tuple
132
+ (p, q, angle_radial, angle_radial_out, angle_azimuthal)
133
+
134
+ """
135
+ return self.p(), \
136
+ self.q(), \
137
+ self.angle_radial(), \
138
+ self.angle_radial_out(), \
139
+ self.angle_azimuthal()
140
+
141
+ def set_p_and_q(self, p=0.0, q=0.0):
142
+ """
143
+ Set the distances p and q.
144
+
145
+ Parameters
146
+ ----------
147
+ p : float, optional
148
+ distance from previous element in m.
149
+ q : float, optional
150
+ distance to next element in m.
151
+
152
+ """
153
+ self._p = p
154
+ self._q = q
155
+
156
+ def get_p_and_q(self):
157
+ """
158
+ Gets p and q.
159
+
160
+ Returns
161
+ -------
162
+ tuple
163
+ (p,q).
164
+
165
+ """
166
+ return self.p(), self.q()
167
+
168
+ def set_angles(self, angle_radial=0.0, angle_radial_out=None, angle_azimuthal=0.0):
169
+ """
170
+ Sets the angles.
171
+
172
+ Parameters
173
+ ----------
174
+ angle_radial : float, optional
175
+ Radial inclination angle in rads.
176
+ angle_azimuthal : float, optional
177
+ Azimuthal inclination angle in rads.
178
+ angle_radial_out : float, optional
179
+ The radial angle in rads in the output direction (default=None, the same as angle_radial).
180
+
181
+ Returns
182
+ -------
183
+
184
+ """
185
+ self._angle_radial = angle_radial
186
+ self._angle_radial_out = angle_radial_out
187
+ self._angle_azimuthal = angle_azimuthal
188
+
189
+ def get_angles(self):
190
+ """
191
+ Get the angles.
192
+
193
+ Returns
194
+ -------
195
+ tuple
196
+ (angle_radial, angle_radial_out, angle_azimuthal)
197
+
198
+ """
199
+ return self.angle_radial(), self.angle_radial_out(), self.angle_azimuthal()
@@ -1,47 +1,47 @@
1
- """
2
- Base class for an optical element.
3
- """
4
- from syned.syned_object import SynedObject
5
-
6
- class OpticalElement(SynedObject):
7
- """
8
- Constructor.
9
-
10
- Parameters
11
- ----------
12
- name : str
13
- The element name.
14
- boundary_shape : instance of BoundaryShape, optional
15
- The element shape. The default=None means no shape associated to the optical element.
16
- """
17
- def __init__(self, name="Undefined", boundary_shape=None):
18
- self._name = name
19
- self._boundary_shape = boundary_shape
20
-
21
- # support text containg name of variable, help text and unit. Will be stored in self._support_dictionary
22
- self._set_support_text([
23
- ("name", "Name", ""),
24
- ("boundary_shape" , "", "" ),
25
- ] )
26
-
27
- def get_name(self):
28
- """
29
- returns the optical element name.
30
-
31
- Returns
32
- -------
33
- str
34
-
35
- """
36
- return self._name
37
-
38
- def get_boundary_shape(self):
39
- """
40
- Returns the boundary shape.
41
-
42
- Returns
43
- -------
44
- None or instance of BoundaryShape
45
-
46
- """
47
- return self._boundary_shape
1
+ """
2
+ Base class for an optical element.
3
+ """
4
+ from syned.syned_object import SynedObject
5
+
6
+ class OpticalElement(SynedObject):
7
+ """
8
+ Constructor.
9
+
10
+ Parameters
11
+ ----------
12
+ name : str
13
+ The element name.
14
+ boundary_shape : instance of BoundaryShape, optional
15
+ The element shape. The default=None means no shape associated to the optical element.
16
+ """
17
+ def __init__(self, name="Undefined", boundary_shape=None):
18
+ self._name = name
19
+ self._boundary_shape = boundary_shape
20
+
21
+ # support text containg name of variable, help text and unit. Will be stored in self._support_dictionary
22
+ self._set_support_text([
23
+ ("name", "Name", ""),
24
+ ("boundary_shape" , "", "" ),
25
+ ] )
26
+
27
+ def get_name(self):
28
+ """
29
+ returns the optical element name.
30
+
31
+ Returns
32
+ -------
33
+ str
34
+
35
+ """
36
+ return self._name
37
+
38
+ def get_boundary_shape(self):
39
+ """
40
+ Returns the boundary shape.
41
+
42
+ Returns
43
+ -------
44
+ None or instance of BoundaryShape
45
+
46
+ """
47
+ return self._boundary_shape