syned 1.0.48__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 -275
  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.48.dist-info → syned-1.0.49.dist-info}/METADATA +88 -87
  46. syned-1.0.49.dist-info/RECORD +52 -0
  47. {syned-1.0.48.dist-info → syned-1.0.49.dist-info}/WHEEL +1 -1
  48. {syned-1.0.48.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.48.dist-info/RECORD +0 -54
  52. {syned-1.0.48.dist-info → syned-1.0.49.dist-info}/top_level.txt +0 -0
@@ -1,46 +1,46 @@
1
- #!/usr/bin/env python
2
- # -*- coding: utf-8 -*-
3
- # ----------------------------------------------------------------------- #
4
- # Copyright (c) 2025, UChicago Argonne, LLC. All rights reserved. #
5
- # #
6
- # Copyright 2025. UChicago Argonne, LLC. This software was produced #
7
- # under U.S. Government contract DE-AC02-06CH11357 for Argonne National #
8
- # Laboratory (ANL), which is operated by UChicago Argonne, LLC for the #
9
- # U.S. Department of Energy. The U.S. Government has rights to use, #
10
- # reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR #
11
- # UChicago Argonne, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR #
12
- # ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is #
13
- # modified to produce derivative works, such modified software should #
14
- # be clearly marked, so as not to confuse it with the version available #
15
- # from ANL. #
16
- # #
17
- # Additionally, redistribution and use in source and binary forms, with #
18
- # or without modification, are permitted provided that the following #
19
- # conditions are met: #
20
- # #
21
- # * Redistributions of source code must retain the above copyright #
22
- # notice, this list of conditions and the following disclaimer. #
23
- # #
24
- # * Redistributions in binary form must reproduce the above copyright #
25
- # notice, this list of conditions and the following disclaimer in #
26
- # the documentation and/or other materials provided with the #
27
- # distribution. #
28
- # #
29
- # * Neither the name of UChicago Argonne, LLC, Argonne National #
30
- # Laboratory, ANL, the U.S. Government, nor the names of its #
31
- # contributors may be used to endorse or promote products derived #
32
- # from this software without specific prior written permission. #
33
- # #
34
- # THIS SOFTWARE IS PROVIDED BY UChicago Argonne, LLC AND CONTRIBUTORS #
35
- # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT #
36
- # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS #
37
- # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UChicago #
38
- # Argonne, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, #
39
- # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, #
40
- # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; #
41
- # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER #
42
- # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT #
43
- # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN #
44
- # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #
45
- # POSSIBILITY OF SUCH DAMAGE. #
46
- # ----------------------------------------------------------------------- #
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+ # ----------------------------------------------------------------------- #
4
+ # Copyright (c) 2025, UChicago Argonne, LLC. All rights reserved. #
5
+ # #
6
+ # Copyright 2025. UChicago Argonne, LLC. This software was produced #
7
+ # under U.S. Government contract DE-AC02-06CH11357 for Argonne National #
8
+ # Laboratory (ANL), which is operated by UChicago Argonne, LLC for the #
9
+ # U.S. Department of Energy. The U.S. Government has rights to use, #
10
+ # reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR #
11
+ # UChicago Argonne, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR #
12
+ # ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is #
13
+ # modified to produce derivative works, such modified software should #
14
+ # be clearly marked, so as not to confuse it with the version available #
15
+ # from ANL. #
16
+ # #
17
+ # Additionally, redistribution and use in source and binary forms, with #
18
+ # or without modification, are permitted provided that the following #
19
+ # conditions are met: #
20
+ # #
21
+ # * Redistributions of source code must retain the above copyright #
22
+ # notice, this list of conditions and the following disclaimer. #
23
+ # #
24
+ # * Redistributions in binary form must reproduce the above copyright #
25
+ # notice, this list of conditions and the following disclaimer in #
26
+ # the documentation and/or other materials provided with the #
27
+ # distribution. #
28
+ # #
29
+ # * Neither the name of UChicago Argonne, LLC, Argonne National #
30
+ # Laboratory, ANL, the U.S. Government, nor the names of its #
31
+ # contributors may be used to endorse or promote products derived #
32
+ # from this software without specific prior written permission. #
33
+ # #
34
+ # THIS SOFTWARE IS PROVIDED BY UChicago Argonne, LLC AND CONTRIBUTORS #
35
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT #
36
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS #
37
+ # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UChicago #
38
+ # Argonne, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, #
39
+ # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, #
40
+ # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; #
41
+ # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER #
42
+ # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT #
43
+ # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN #
44
+ # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #
45
+ # POSSIBILITY OF SUCH DAMAGE. #
46
+ # ----------------------------------------------------------------------- #
@@ -1,45 +1,45 @@
1
- from syned.beamline.shape import SurfaceShape
2
- from syned.beamline.optical_element_with_surface_shape import OpticalElementsWithSurfaceShape
3
-
4
- class Multilayer(OpticalElementsWithSurfaceShape):
5
- """
6
- Constructor.
7
-
8
- Parameters
9
- ----------
10
- name : str
11
- The name of the optical element.
12
- surface_shape : instance of SurfaceShape, optional
13
- The geometry of the crystal surface. if None, it is initialized to SurfaceShape().
14
- boundary_shape : instance of BoundaryShape, optional
15
- The geometry of the slit aperture. if None, it is initialized to BoundaryShape().
16
- structure : str, optional
17
- The multilayer structure e.g. [B,W]x50+Si.
18
- period : float, optional
19
- The period of the repeated bilayer in A.
20
- Gamma : float, optional
21
- The gamma factor.
22
- """
23
- def __init__(self,
24
- name="Undefined",
25
- surface_shape=SurfaceShape(),
26
- boundary_shape=None,
27
- structure='[B/W]x50+Si',
28
- period=25.0,
29
- Gamma=0.5,
30
- ):
31
-
32
- super().__init__(name, surface_shape, boundary_shape)
33
- self._structure = structure
34
- self._period = period
35
- self._Gamma = Gamma
36
- # support text containg name of variable, help text and unit. Will be stored in self._support_dictionary
37
- self._set_support_text([
38
- ("name", "Name" , "" ),
39
- ("surface_shape", "Surface shape", "" ),
40
- ("boundary_shape", "Boundary shape", "" ),
41
- ("structure", "structure ([Odd,Even]xN+Substrate)", "" ),
42
- ("period", "period of the repeated structure", "A"),
43
- ("Gamma", "Gamma factor [thickness ratio Even)/(Odd+Even)", ""),
44
- ] )
45
-
1
+ from syned.beamline.shape import SurfaceShape
2
+ from syned.beamline.optical_element_with_surface_shape import OpticalElementsWithSurfaceShape
3
+
4
+ class Multilayer(OpticalElementsWithSurfaceShape):
5
+ """
6
+ Constructor.
7
+
8
+ Parameters
9
+ ----------
10
+ name : str
11
+ The name of the optical element.
12
+ surface_shape : instance of SurfaceShape, optional
13
+ The geometry of the crystal surface. if None, it is initialized to SurfaceShape().
14
+ boundary_shape : instance of BoundaryShape, optional
15
+ The geometry of the slit aperture. if None, it is initialized to BoundaryShape().
16
+ structure : str, optional
17
+ The multilayer structure e.g. [B,W]x50+Si.
18
+ period : float, optional
19
+ The period of the repeated bilayer in A.
20
+ Gamma : float, optional
21
+ The gamma factor.
22
+ """
23
+ def __init__(self,
24
+ name="Undefined",
25
+ surface_shape=SurfaceShape(),
26
+ boundary_shape=None,
27
+ structure='[B/W]x50+Si',
28
+ period=25.0,
29
+ Gamma=0.5,
30
+ ):
31
+
32
+ super().__init__(name, surface_shape, boundary_shape)
33
+ self._structure = structure
34
+ self._period = period
35
+ self._Gamma = Gamma
36
+ # support text containg name of variable, help text and unit. Will be stored in self._support_dictionary
37
+ self._set_support_text([
38
+ ("name", "Name" , "" ),
39
+ ("surface_shape", "Surface shape", "" ),
40
+ ("boundary_shape", "Boundary shape", "" ),
41
+ ("structure", "structure ([Odd,Even]xN+Substrate)", "" ),
42
+ ("period", "period of the repeated structure", "A"),
43
+ ("Gamma", "Gamma factor [thickness ratio Even)/(Odd+Even)", ""),
44
+ ] )
45
+
@@ -1 +1 @@
1
-
1
+
@@ -1,79 +1,79 @@
1
- from syned.beamline.optical_elements.refractors.lens import Lens
2
-
3
- class CRL(Lens):
4
- """
5
- Defines a Compound refractive lens (CRL). It is composed by a number (n_lens) of identical lenses.
6
-
7
- Constructor.
8
-
9
- Parameters
10
- ----------
11
- name : str, optional
12
- The name of the optical element.
13
- n_lens : int, optional
14
- The number of (identical) lenses.
15
- surface_shape1 : instance of SurfaceShape, optional
16
- The geometry of the lens surface 1. if None, it is initialized to SurfaceShape().
17
- surface_shape2 : instance of SurfaceShape, optional
18
- The geometry of the lens surface 2. if None, it is initialized to SurfaceShape().
19
- boundary_shape : instance of BoundaryShape, optional
20
- The geometry of the slit aperture. if None, it is initialized to BoundaryShape().
21
- material : str
22
- A string defining the material within the two surfaces.
23
- thickness : float
24
- The distance between the two surfaces at the center of the lens in m.
25
- piling_thickness : float, optional
26
- The piling distance in m, or spatial periodicity in the stack. In other words, the distance from the
27
- lens1-surface1 to the lens2-surface1.
28
-
29
- """
30
- def __init__(self,
31
- name="Undefined",
32
- n_lens=1,
33
- surface_shape1=None,
34
- surface_shape2=None,
35
- boundary_shape=None,
36
- material="",
37
- thickness=0.0,
38
- piling_thickness=0.0):
39
- super().__init__(name=name,
40
- surface_shape1=surface_shape1,
41
- surface_shape2=surface_shape2,
42
- boundary_shape=boundary_shape,
43
- material=material,
44
- thickness=thickness)
45
- self._n_lens = n_lens
46
- self._piling_thickness = piling_thickness
47
-
48
- # support text contaning name of variable, help text and unit. Will be stored in self._support_dictionary
49
- self._set_support_text([
50
- ("name", "Name" , "" ),
51
- ("n_lens", "N Lens" , "" ),
52
- ("surface_shapes", "Surface shapes", "" ),
53
- ("boundary_shape", "Boundary shape", "" ),
54
- ("material", "Material (element, compound or name)", "" ),
55
- ("thickness", "Thickness", "m"),
56
- ("piling_thickness", "Piling Thickness", "m")
57
- ] )
58
-
59
- def get_n_lens(self):
60
- """
61
- Returns the number of lenses.
62
-
63
- Returns
64
- -------
65
- int
66
-
67
- """
68
- return self._n_lens
69
-
70
- def get_piling_thickness(self):
71
- """
72
- Returns the piling thickness.
73
-
74
- Returns
75
- -------
76
- float
77
-
78
- """
79
- return self._piling_thickness
1
+ from syned.beamline.optical_elements.refractors.lens import Lens
2
+
3
+ class CRL(Lens):
4
+ """
5
+ Defines a Compound refractive lens (CRL). It is composed by a number (n_lens) of identical lenses.
6
+
7
+ Constructor.
8
+
9
+ Parameters
10
+ ----------
11
+ name : str, optional
12
+ The name of the optical element.
13
+ n_lens : int, optional
14
+ The number of (identical) lenses.
15
+ surface_shape1 : instance of SurfaceShape, optional
16
+ The geometry of the lens surface 1. if None, it is initialized to SurfaceShape().
17
+ surface_shape2 : instance of SurfaceShape, optional
18
+ The geometry of the lens surface 2. if None, it is initialized to SurfaceShape().
19
+ boundary_shape : instance of BoundaryShape, optional
20
+ The geometry of the slit aperture. if None, it is initialized to BoundaryShape().
21
+ material : str
22
+ A string defining the material within the two surfaces.
23
+ thickness : float
24
+ The distance between the two surfaces at the center of the lens in m.
25
+ piling_thickness : float, optional
26
+ The piling distance in m, or spatial periodicity in the stack. In other words, the distance from the
27
+ lens1-surface1 to the lens2-surface1.
28
+
29
+ """
30
+ def __init__(self,
31
+ name="Undefined",
32
+ n_lens=1,
33
+ surface_shape1=None,
34
+ surface_shape2=None,
35
+ boundary_shape=None,
36
+ material="",
37
+ thickness=0.0,
38
+ piling_thickness=0.0):
39
+ super().__init__(name=name,
40
+ surface_shape1=surface_shape1,
41
+ surface_shape2=surface_shape2,
42
+ boundary_shape=boundary_shape,
43
+ material=material,
44
+ thickness=thickness)
45
+ self._n_lens = n_lens
46
+ self._piling_thickness = piling_thickness
47
+
48
+ # support text contaning name of variable, help text and unit. Will be stored in self._support_dictionary
49
+ self._set_support_text([
50
+ ("name", "Name" , "" ),
51
+ ("n_lens", "N Lens" , "" ),
52
+ ("surface_shapes", "Surface shapes", "" ),
53
+ ("boundary_shape", "Boundary shape", "" ),
54
+ ("material", "Material (element, compound or name)", "" ),
55
+ ("thickness", "Thickness", "m"),
56
+ ("piling_thickness", "Piling Thickness", "m")
57
+ ] )
58
+
59
+ def get_n_lens(self):
60
+ """
61
+ Returns the number of lenses.
62
+
63
+ Returns
64
+ -------
65
+ int
66
+
67
+ """
68
+ return self._n_lens
69
+
70
+ def get_piling_thickness(self):
71
+ """
72
+ Returns the piling thickness.
73
+
74
+ Returns
75
+ -------
76
+ float
77
+
78
+ """
79
+ return self._piling_thickness
@@ -1,61 +1,61 @@
1
- from syned.beamline.shape import SurfaceShape
2
- from syned.beamline.optical_element_with_surface_shape import OpticalElementsWithSurfaceShape
3
-
4
- class Interface(OpticalElementsWithSurfaceShape):
5
- def __init__(self,
6
- name="Undefined",
7
- surface_shape=SurfaceShape(),
8
- boundary_shape=None,
9
- material_object=None,
10
- material_image=None,):
11
- """
12
- Defines an interface (a surface with different materials in side 1 and side 2).
13
-
14
- Parameters
15
- ----------
16
- name : str, optional
17
- The name of the optical element.
18
- surface_shape : instance of SurfaceShape, optional
19
- The geometry of the crystal surface. if None, it is initialized to SurfaceShape().
20
- boundary_shape : instance of BoundaryShape, optional
21
- The geometry of the slit aperture. if None, it is initialized to BoundaryShape().
22
- material_object : str, optional
23
- The material in side 1 (object side).
24
- material_image : str, optional
25
- The material in side 2 (object image).
26
-
27
- """
28
-
29
- super().__init__(name, surface_shape, boundary_shape)
30
- self._material_object = material_object
31
- self._material_image = material_image
32
- # support text containg name of variable, help text and unit. Will be stored in self._support_dictionary
33
- self._set_support_text([
34
- ("name", "Name" , "" ),
35
- ("surface_shape", "Surface shape", "" ),
36
- ("boundary_shape", "Boundary shape", "" ),
37
- ("material_object", "Material in object side (element, compound, name or refraction index)", "" ),
38
- ("material_image", "Material in image side (element, compound, name or refraction index)", ""),
39
- ] )
40
-
41
- def get_material_object(self):
42
- """
43
- Returns the material of side 1 (object).
44
-
45
- Returns
46
- -------
47
- str
48
-
49
- """
50
- return self._material_object
51
-
52
- def get_material_image(self):
53
- """
54
- Returns the material of side 2 (image).
55
-
56
- Returns
57
- -------
58
- str
59
-
60
- """
1
+ from syned.beamline.shape import SurfaceShape
2
+ from syned.beamline.optical_element_with_surface_shape import OpticalElementsWithSurfaceShape
3
+
4
+ class Interface(OpticalElementsWithSurfaceShape):
5
+ def __init__(self,
6
+ name="Undefined",
7
+ surface_shape=SurfaceShape(),
8
+ boundary_shape=None,
9
+ material_object=None,
10
+ material_image=None,):
11
+ """
12
+ Defines an interface (a surface with different materials in side 1 and side 2).
13
+
14
+ Parameters
15
+ ----------
16
+ name : str, optional
17
+ The name of the optical element.
18
+ surface_shape : instance of SurfaceShape, optional
19
+ The geometry of the crystal surface. if None, it is initialized to SurfaceShape().
20
+ boundary_shape : instance of BoundaryShape, optional
21
+ The geometry of the slit aperture. if None, it is initialized to BoundaryShape().
22
+ material_object : str, optional
23
+ The material in side 1 (object side).
24
+ material_image : str, optional
25
+ The material in side 2 (object image).
26
+
27
+ """
28
+
29
+ super().__init__(name, surface_shape, boundary_shape)
30
+ self._material_object = material_object
31
+ self._material_image = material_image
32
+ # support text containg name of variable, help text and unit. Will be stored in self._support_dictionary
33
+ self._set_support_text([
34
+ ("name", "Name" , "" ),
35
+ ("surface_shape", "Surface shape", "" ),
36
+ ("boundary_shape", "Boundary shape", "" ),
37
+ ("material_object", "Material in object side (element, compound, name or refraction index)", "" ),
38
+ ("material_image", "Material in image side (element, compound, name or refraction index)", ""),
39
+ ] )
40
+
41
+ def get_material_object(self):
42
+ """
43
+ Returns the material of side 1 (object).
44
+
45
+ Returns
46
+ -------
47
+ str
48
+
49
+ """
50
+ return self._material_object
51
+
52
+ def get_material_image(self):
53
+ """
54
+ Returns the material of side 2 (image).
55
+
56
+ Returns
57
+ -------
58
+ str
59
+
60
+ """
61
61
  return self._material_image