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,40 +1,40 @@
1
- """
2
- Base class for LighSource, which contains:
3
- - a name
4
- - an electron beam
5
- - a magnetic structure
6
-
7
- """
8
- from syned.syned_object import SynedObject
9
-
10
-
11
- class EmptyLightSource(SynedObject):
12
- """
13
- Defines an empty light source. This is for creating "movable" beamlines (using Beamline()). These are beamlines
14
- that do not have a particular light source.
15
-
16
- Parameters
17
- ----------
18
- name : str, optional
19
- The name of the (empty) light source.
20
-
21
- """
22
- def __init__(self, name="Empty"):
23
- self._name = name
24
- # support text containg name of variable, help text and unit. Will be stored in self._support_dictionary
25
- self._set_support_text([
26
- ("name", "Name",""),
27
- ] )
28
-
29
-
30
- def get_name(self):
31
- """
32
- Returns the name of the light source.
33
-
34
- Returns
35
- -------
36
- str
37
-
38
- """
39
- return self._name
40
-
1
+ """
2
+ Base class for LighSource, which contains:
3
+ - a name
4
+ - an electron beam
5
+ - a magnetic structure
6
+
7
+ """
8
+ from syned.syned_object import SynedObject
9
+
10
+
11
+ class EmptyLightSource(SynedObject):
12
+ """
13
+ Defines an empty light source. This is for creating "movable" beamlines (using Beamline()). These are beamlines
14
+ that do not have a particular light source.
15
+
16
+ Parameters
17
+ ----------
18
+ name : str, optional
19
+ The name of the (empty) light source.
20
+
21
+ """
22
+ def __init__(self, name="Empty"):
23
+ self._name = name
24
+ # support text containg name of variable, help text and unit. Will be stored in self._support_dictionary
25
+ self._set_support_text([
26
+ ("name", "Name",""),
27
+ ] )
28
+
29
+
30
+ def get_name(self):
31
+ """
32
+ Returns the name of the light source.
33
+
34
+ Returns
35
+ -------
36
+ str
37
+
38
+ """
39
+ return self._name
40
+
@@ -1,90 +1,90 @@
1
- """
2
-
3
-
4
- """
5
- from syned.syned_object import SynedObject
6
- from syned.storage_ring.magnetic_structure import MagneticStructure
7
- from syned.storage_ring.electron_beam import ElectronBeam
8
-
9
- class LightSource(SynedObject):
10
- """
11
- Base class for LighSource. A light source contains:
12
- * a name
13
- * an electron beam
14
- * a magnetic structure
15
-
16
- Parameters
17
- ----------
18
- name : str, optional
19
- The light source name.
20
- electron_beam : instance of ElectronBeam, optional
21
- The electron beam. If None, it is initialized with ElectronBeam().
22
- magnetic_structure : instance of MagneticStructure, optional
23
- The electron beam. If None, it is initialized with MagneticStructure().
24
-
25
- """
26
- def __init__(self, name="Undefined", electron_beam=None, magnetic_structure=None):
27
- self._name = name
28
- if electron_beam is None:
29
- self._electron_beam = ElectronBeam()
30
- else:
31
- self._electron_beam = electron_beam
32
- if magnetic_structure is None:
33
- self._magnetic_structure = MagneticStructure()
34
- else:
35
- self._magnetic_structure = magnetic_structure
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
- ("electron_beam", "Electron Beam",""),
40
- ("magnetic_structure","Magnetic Strtructure",""),
41
- ] )
42
-
43
-
44
- def get_name(self):
45
- """
46
- Returns the name of the light source.
47
-
48
- Returns
49
- -------
50
- str
51
-
52
- """
53
- return self._name
54
-
55
- def get_electron_beam(self):
56
- """
57
- Returns the electron beam.
58
-
59
- Returns
60
- -------
61
- instance of ElectronBeam
62
-
63
- """
64
- return self._electron_beam
65
-
66
- def get_magnetic_structure(self):
67
- """
68
- Returns the magnetic structure.
69
-
70
- Returns
71
- -------
72
- instance of MagneticStructure
73
-
74
- """
75
- return self._magnetic_structure
76
-
77
-
78
-
79
-
80
- if __name__ == "__main__":
81
-
82
- from syned.storage_ring.magnetic_structures.undulator import Undulator
83
-
84
- eb = ElectronBeam.initialize_as_pencil_beam( energy_in_GeV=2.0,energy_spread=0.0,current=0.5)
85
- ms = Undulator.initialize_as_vertical_undulator( K=1.8, period_length=0.038, periods_number=56.0 )
86
-
87
- light_source = LightSource(name="",electron_beam=eb,magnetic_structure=ms)
88
-
89
- print(light_source.info())
90
-
1
+ """
2
+
3
+
4
+ """
5
+ from syned.syned_object import SynedObject
6
+ from syned.storage_ring.magnetic_structure import MagneticStructure
7
+ from syned.storage_ring.electron_beam import ElectronBeam
8
+
9
+ class LightSource(SynedObject):
10
+ """
11
+ Base class for LighSource. A light source contains:
12
+ * a name
13
+ * an electron beam
14
+ * a magnetic structure
15
+
16
+ Parameters
17
+ ----------
18
+ name : str, optional
19
+ The light source name.
20
+ electron_beam : instance of ElectronBeam, optional
21
+ The electron beam. If None, it is initialized with ElectronBeam().
22
+ magnetic_structure : instance of MagneticStructure, optional
23
+ The electron beam. If None, it is initialized with MagneticStructure().
24
+
25
+ """
26
+ def __init__(self, name="Undefined", electron_beam=None, magnetic_structure=None):
27
+ self._name = name
28
+ if electron_beam is None:
29
+ self._electron_beam = ElectronBeam()
30
+ else:
31
+ self._electron_beam = electron_beam
32
+ if magnetic_structure is None:
33
+ self._magnetic_structure = MagneticStructure()
34
+ else:
35
+ self._magnetic_structure = magnetic_structure
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
+ ("electron_beam", "Electron Beam",""),
40
+ ("magnetic_structure","Magnetic Strtructure",""),
41
+ ] )
42
+
43
+
44
+ def get_name(self):
45
+ """
46
+ Returns the name of the light source.
47
+
48
+ Returns
49
+ -------
50
+ str
51
+
52
+ """
53
+ return self._name
54
+
55
+ def get_electron_beam(self):
56
+ """
57
+ Returns the electron beam.
58
+
59
+ Returns
60
+ -------
61
+ instance of ElectronBeam
62
+
63
+ """
64
+ return self._electron_beam
65
+
66
+ def get_magnetic_structure(self):
67
+ """
68
+ Returns the magnetic structure.
69
+
70
+ Returns
71
+ -------
72
+ instance of MagneticStructure
73
+
74
+ """
75
+ return self._magnetic_structure
76
+
77
+
78
+
79
+
80
+ if __name__ == "__main__":
81
+
82
+ from syned.storage_ring.magnetic_structures.undulator import Undulator
83
+
84
+ eb = ElectronBeam.initialize_as_pencil_beam( energy_in_GeV=2.0,energy_spread=0.0,current=0.5)
85
+ ms = Undulator.initialize_as_vertical_undulator( K=1.8, period_length=0.038, periods_number=56.0 )
86
+
87
+ light_source = LightSource(name="",electron_beam=eb,magnetic_structure=ms)
88
+
89
+ print(light_source.info())
90
+
@@ -1,8 +1,8 @@
1
- from syned.syned_object import SynedObject
2
-
3
- class MagneticStructure(SynedObject):
4
- """
5
- Base clase for magnetic structures (from where BM, Wiggler and Undulator will heritate)
6
- """
7
- def __init__(self):
8
- super().__init__()
1
+ from syned.syned_object import SynedObject
2
+
3
+ class MagneticStructure(SynedObject):
4
+ """
5
+ Base clase for magnetic structures (from where BM, Wiggler and Undulator will heritate)
6
+ """
7
+ def __init__(self):
8
+ super().__init__()
@@ -1 +1 @@
1
-
1
+