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,67 +1,67 @@
1
- #
2
- # this is a filter with a hole (holed-filter)
3
- # Slit BeamStopper Filter HoledFilter
4
- # beam pass at center Yes No Yes No
5
- # apply attenuation No No Yes Yes
6
- #
7
- #
8
- from syned.beamline.optical_elements.absorbers.absorber import Absorber
9
-
10
- class HoledFilter(Absorber):
11
- """
12
- Filter or absorber or attenuator with a hole.
13
-
14
- Note that:
15
- Slit BeamStopper Filter HoledFilter
16
- beam pass at center Yes No Yes No
17
- apply attenuation No No Yes Yes
18
-
19
- Constructor.
20
-
21
- Parameters
22
- ----------
23
- name : str
24
- The name of the optical element.
25
- material : str
26
- A string defining the material.
27
- thickness : float
28
- The filter thickness in m.
29
- boundary_shape : instance of BoundaryShape, optional
30
- Defines the geometry of the hole. if None, it is initialized to BoundaryShape().
31
- """
32
- def __init__(self,
33
- name="Undefined",
34
- material="Be",
35
- thickness=1e-3,
36
- boundary_shape=None):
37
- Absorber.__init__(self, name=name, boundary_shape=boundary_shape)
38
- self._material = material
39
- self._thickness = thickness
40
-
41
-
42
- # support text containg name of variable, help text and unit. Will be stored in self._support_dictionary
43
- self._set_support_text([
44
- ("material" , "Material (symbol, formula or name)", "" ),
45
- ("thickness" , "Thickness ", "m" ),
46
- ] )
47
- def get_material(self):
48
- """
49
- Returns the material name.
50
-
51
- Returns
52
- -------
53
- str
54
-
55
- """
56
- return self._material
57
-
58
- def get_thickness(self):
59
- """
60
- Retuirns the filter thickness in m.
61
-
62
- Returns
63
- -------
64
- float
65
-
66
- """
67
- return self._thickness
1
+ #
2
+ # this is a filter with a hole (holed-filter)
3
+ # Slit BeamStopper Filter HoledFilter
4
+ # beam pass at center Yes No Yes No
5
+ # apply attenuation No No Yes Yes
6
+ #
7
+ #
8
+ from syned.beamline.optical_elements.absorbers.absorber import Absorber
9
+
10
+ class HoledFilter(Absorber):
11
+ """
12
+ Filter or absorber or attenuator with a hole.
13
+
14
+ Note that:
15
+ Slit BeamStopper Filter HoledFilter
16
+ beam pass at center Yes No Yes No
17
+ apply attenuation No No Yes Yes
18
+
19
+ Constructor.
20
+
21
+ Parameters
22
+ ----------
23
+ name : str
24
+ The name of the optical element.
25
+ material : str
26
+ A string defining the material.
27
+ thickness : float
28
+ The filter thickness in m.
29
+ boundary_shape : instance of BoundaryShape, optional
30
+ Defines the geometry of the hole. if None, it is initialized to BoundaryShape().
31
+ """
32
+ def __init__(self,
33
+ name="Undefined",
34
+ material="Be",
35
+ thickness=1e-3,
36
+ boundary_shape=None):
37
+ Absorber.__init__(self, name=name, boundary_shape=boundary_shape)
38
+ self._material = material
39
+ self._thickness = thickness
40
+
41
+
42
+ # support text containg name of variable, help text and unit. Will be stored in self._support_dictionary
43
+ self._set_support_text([
44
+ ("material" , "Material (symbol, formula or name)", "" ),
45
+ ("thickness" , "Thickness ", "m" ),
46
+ ] )
47
+ def get_material(self):
48
+ """
49
+ Returns the material name.
50
+
51
+ Returns
52
+ -------
53
+ str
54
+
55
+ """
56
+ return self._material
57
+
58
+ def get_thickness(self):
59
+ """
60
+ Retuirns the filter thickness in m.
61
+
62
+ Returns
63
+ -------
64
+ float
65
+
66
+ """
67
+ return self._thickness
@@ -1,81 +1,81 @@
1
-
2
- from syned.beamline.shape import BoundaryShape
3
- from syned.beamline.shape import Rectangle, Ellipse, Circle
4
-
5
- from syned.beamline.optical_elements.absorbers.absorber import Absorber
6
-
7
- class Slit(Absorber):
8
- """
9
- Slit or aperture.
10
-
11
- Constructor.
12
-
13
- Note that:
14
- Slit BeamStopper Filter HoledFilter
15
- beam pass at center Yes No Yes No
16
- apply attenuation No No Yes Yes
17
-
18
- Parameters
19
- ----------
20
- name : str
21
- The name of the optical element.
22
- boundary_shape : instance of BoundaryShape, optional
23
- The geometry of the slit aperture. if None, it is initialized to BoundaryShape().
24
-
25
- """
26
- def __init__(self, name="Undefined", boundary_shape=None):
27
- if boundary_shape is None:
28
- boundary_shape = BoundaryShape()
29
- Absorber.__init__(self, name=name, boundary_shape=boundary_shape)
30
-
31
- def set_rectangle(self,width=3e-3,height=4e-3,center_x=0.0,center_y=0.0):
32
- """
33
- Sets the aperture as a rectangle.
34
-
35
- Parameters
36
- ----------
37
- width : float, optional
38
- The rectangle width.
39
- length : float, optional
40
- The rectangle length.
41
- center_x : float, optional
42
- The center coordinate X.
43
- center_y : float, optional
44
- The center coordinate Y.
45
-
46
- """
47
- self._boundary_shape=Rectangle(-0.5*width+center_x,0.5*width+center_x,-0.5*height+center_y,0.5*height+center_y)
48
-
49
- def set_circle(self,radius=3e-3,center_x=0.0,center_y=0.0):
50
- """
51
- Sets the aperture as a circle.
52
-
53
- Parameters
54
- ----------
55
- radius : float
56
- The radius of the circle.
57
- center_x : float
58
- The x coordinate of the center of the circle.
59
- center_y : float
60
- The y coordinate of the center of the circle.
61
-
62
- """
63
- self._boundary_shape=Circle(radius,center_x,center_y)
64
-
65
- def set_ellipse(self,width=3e-3,height=4e-3,center_x=0.0,center_y=0.0):
66
- """
67
- Sets the aperture as an ellipse.
68
-
69
- Parameters
70
- ----------
71
- width : float, optional
72
- The ellipse width (2a).
73
- height : float, optional
74
- The ellipse height (2b).
75
- center_x : float, optional
76
- The ellipse center coordinate X.
77
- center_y : float, optional
78
- The ellipse center coordinate Y.
79
-
80
- """
1
+
2
+ from syned.beamline.shape import BoundaryShape
3
+ from syned.beamline.shape import Rectangle, Ellipse, Circle
4
+
5
+ from syned.beamline.optical_elements.absorbers.absorber import Absorber
6
+
7
+ class Slit(Absorber):
8
+ """
9
+ Slit or aperture.
10
+
11
+ Constructor.
12
+
13
+ Note that:
14
+ Slit BeamStopper Filter HoledFilter
15
+ beam pass at center Yes No Yes No
16
+ apply attenuation No No Yes Yes
17
+
18
+ Parameters
19
+ ----------
20
+ name : str
21
+ The name of the optical element.
22
+ boundary_shape : instance of BoundaryShape, optional
23
+ The geometry of the slit aperture. if None, it is initialized to BoundaryShape().
24
+
25
+ """
26
+ def __init__(self, name="Undefined", boundary_shape=None):
27
+ if boundary_shape is None:
28
+ boundary_shape = BoundaryShape()
29
+ Absorber.__init__(self, name=name, boundary_shape=boundary_shape)
30
+
31
+ def set_rectangle(self,width=3e-3,height=4e-3,center_x=0.0,center_y=0.0):
32
+ """
33
+ Sets the aperture as a rectangle.
34
+
35
+ Parameters
36
+ ----------
37
+ width : float, optional
38
+ The rectangle width.
39
+ length : float, optional
40
+ The rectangle length.
41
+ center_x : float, optional
42
+ The center coordinate X.
43
+ center_y : float, optional
44
+ The center coordinate Y.
45
+
46
+ """
47
+ self._boundary_shape=Rectangle(-0.5*width+center_x,0.5*width+center_x,-0.5*height+center_y,0.5*height+center_y)
48
+
49
+ def set_circle(self,radius=3e-3,center_x=0.0,center_y=0.0):
50
+ """
51
+ Sets the aperture as a circle.
52
+
53
+ Parameters
54
+ ----------
55
+ radius : float
56
+ The radius of the circle.
57
+ center_x : float
58
+ The x coordinate of the center of the circle.
59
+ center_y : float
60
+ The y coordinate of the center of the circle.
61
+
62
+ """
63
+ self._boundary_shape=Circle(radius,center_x,center_y)
64
+
65
+ def set_ellipse(self,width=3e-3,height=4e-3,center_x=0.0,center_y=0.0):
66
+ """
67
+ Sets the aperture as an ellipse.
68
+
69
+ Parameters
70
+ ----------
71
+ width : float, optional
72
+ The ellipse width (2a).
73
+ height : float, optional
74
+ The ellipse height (2b).
75
+ center_x : float, optional
76
+ The ellipse center coordinate X.
77
+ center_y : float, optional
78
+ The ellipse center coordinate Y.
79
+
80
+ """
81
81
  self._boundary_shape=Ellipse(-0.5*width+center_x,0.5*width+center_x,-0.5*height+center_y,0.5*height+center_y)
@@ -1 +1 @@
1
-
1
+
@@ -1,70 +1,70 @@
1
- from syned.beamline.shape import SurfaceShape
2
- from syned.beamline.optical_element_with_surface_shape import OpticalElementsWithSurfaceShape
3
-
4
- class DiffractionGeometry:
5
- BRAGG = 0
6
- LAUE = 1
7
-
8
- class Crystal(OpticalElementsWithSurfaceShape):
9
- """
10
- Constructor.
11
-
12
- Parameters
13
- ----------
14
- name : str, optional
15
- The name of the optical element.
16
- surface_shape : instance of SurfaceShape, optional
17
- The geometry of the crystal surface. if None, it is initialized to SurfaceShape().
18
- boundary_shape : instance of BoundaryShape, optional
19
- The geometry of the slit aperture. if None, it is initialized to BoundaryShape().
20
- material : str, optional
21
- The material name.
22
- diffraction_geometry : int (as defined in DiffractionGeometry, optional
23
- BRAGG = 0, LAUE = 1.
24
- miller_index_h : int, optional
25
- The Miller index H.
26
- miller_index_k : int, optional
27
- The Miller index K.
28
- miller_index_l : int, optional
29
- The Miller index L.
30
- asymmetry_angle : float, optional
31
- The asymmetry angle in rad.
32
- thickness : float, optional
33
- The crystal thickness in m.
34
-
35
- """
36
- def __init__(self,
37
- name="Undefined",
38
- surface_shape=SurfaceShape(), # TODO: this should be None
39
- boundary_shape=None,
40
- material="Si",
41
- diffraction_geometry=DiffractionGeometry.BRAGG,
42
- miller_index_h=1,
43
- miller_index_k=1,
44
- miller_index_l=1,
45
- asymmetry_angle=0.0,
46
- thickness=0.0,
47
- ):
48
- super().__init__(name, surface_shape, boundary_shape)
49
- self._material = material
50
- self._diffraction_geometry = diffraction_geometry
51
- self._miller_index_h = miller_index_h
52
- self._miller_index_k = miller_index_k
53
- self._miller_index_l = miller_index_l
54
- self._asymmetry_angle = asymmetry_angle
55
- self._thickness = thickness
56
-
57
- # support text containg name of variable, help text and unit. Will be stored in self._support_dictionary
58
- self._set_support_text([
59
- ("name", "Name" , "" ),
60
- ("surface_shape", "Surface Shape" , "" ),
61
- ("boundary_shape", "Boundary Shape" , "" ),
62
- ("material", "Material (name)" , "" ),
63
- ("diffraction_geometry","Diffraction Geometry", "" ),
64
- ("miller_index_h", "Miller index h", "" ),
65
- ("miller_index_k", "Miller index k", "" ),
66
- ("miller_index_l", "Miller index l", "" ),
67
- ("asymmetry_angle", "Asymmetry angle", "rad"),
68
- ("thickness", "Thickness", "m"),
69
- ] )
70
-
1
+ from syned.beamline.shape import SurfaceShape
2
+ from syned.beamline.optical_element_with_surface_shape import OpticalElementsWithSurfaceShape
3
+
4
+ class DiffractionGeometry:
5
+ BRAGG = 0
6
+ LAUE = 1
7
+
8
+ class Crystal(OpticalElementsWithSurfaceShape):
9
+ """
10
+ Constructor.
11
+
12
+ Parameters
13
+ ----------
14
+ name : str, optional
15
+ The name of the optical element.
16
+ surface_shape : instance of SurfaceShape, optional
17
+ The geometry of the crystal surface. if None, it is initialized to SurfaceShape().
18
+ boundary_shape : instance of BoundaryShape, optional
19
+ The geometry of the slit aperture. if None, it is initialized to BoundaryShape().
20
+ material : str, optional
21
+ The material name.
22
+ diffraction_geometry : int (as defined in DiffractionGeometry, optional
23
+ BRAGG = 0, LAUE = 1.
24
+ miller_index_h : int, optional
25
+ The Miller index H.
26
+ miller_index_k : int, optional
27
+ The Miller index K.
28
+ miller_index_l : int, optional
29
+ The Miller index L.
30
+ asymmetry_angle : float, optional
31
+ The asymmetry angle in rad.
32
+ thickness : float, optional
33
+ The crystal thickness in m.
34
+
35
+ """
36
+ def __init__(self,
37
+ name="Undefined",
38
+ surface_shape=SurfaceShape(), # TODO: this should be None
39
+ boundary_shape=None,
40
+ material="Si",
41
+ diffraction_geometry=DiffractionGeometry.BRAGG,
42
+ miller_index_h=1,
43
+ miller_index_k=1,
44
+ miller_index_l=1,
45
+ asymmetry_angle=0.0,
46
+ thickness=0.0,
47
+ ):
48
+ super().__init__(name, surface_shape, boundary_shape)
49
+ self._material = material
50
+ self._diffraction_geometry = diffraction_geometry
51
+ self._miller_index_h = miller_index_h
52
+ self._miller_index_k = miller_index_k
53
+ self._miller_index_l = miller_index_l
54
+ self._asymmetry_angle = asymmetry_angle
55
+ self._thickness = thickness
56
+
57
+ # support text containg name of variable, help text and unit. Will be stored in self._support_dictionary
58
+ self._set_support_text([
59
+ ("name", "Name" , "" ),
60
+ ("surface_shape", "Surface Shape" , "" ),
61
+ ("boundary_shape", "Boundary Shape" , "" ),
62
+ ("material", "Material (name)" , "" ),
63
+ ("diffraction_geometry","Diffraction Geometry", "" ),
64
+ ("miller_index_h", "Miller index h", "" ),
65
+ ("miller_index_k", "Miller index k", "" ),
66
+ ("miller_index_l", "Miller index l", "" ),
67
+ ("asymmetry_angle", "Asymmetry angle", "rad"),
68
+ ("thickness", "Thickness", "m"),
69
+ ] )
70
+
@@ -1 +1 @@
1
-
1
+