syned 1.0.40__tar.gz → 1.0.42__tar.gz

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 (186) hide show
  1. {syned-1.0.40 → syned-1.0.42}/PKG-INFO +1 -1
  2. {syned-1.0.40 → syned-1.0.42}/setup.py +1 -1
  3. syned-1.0.42/syned/beamline/optical_elements/__init__.py +1 -0
  4. syned-1.0.42/syned/beamline/optical_elements/crystals/__init__.py +1 -0
  5. syned-1.0.42/syned/beamline/optical_elements/gratings/__init__.py +1 -0
  6. syned-1.0.42/syned/beamline/optical_elements/ideal_elements/__init__.py +1 -0
  7. syned-1.0.42/syned/beamline/optical_elements/ideal_elements/ideal_fzp.py +183 -0
  8. syned-1.0.42/syned/beamline/optical_elements/mirrors/__init__.py +1 -0
  9. syned-1.0.42/syned/beamline/optical_elements/refractors/__init__.py +1 -0
  10. syned-1.0.42/syned/storage_ring/__init__.py +1 -0
  11. syned-1.0.42/syned/storage_ring/magnetic_structures/__init__.py +1 -0
  12. {syned-1.0.40 → syned-1.0.42}/syned/version.py +4 -4
  13. {syned-1.0.40 → syned-1.0.42}/syned/widget/widget_decorator.py +20 -2
  14. {syned-1.0.40 → syned-1.0.42}/syned.egg-info/PKG-INFO +1 -1
  15. syned-1.0.42/syned.egg-info/SOURCES.txt +60 -0
  16. syned-1.0.40/examples/example_get_source.py +0 -48
  17. syned-1.0.40/shadow4/examples/optical_elements/examples_crystal.py +0 -134
  18. syned-1.0.40/shadow4/examples/optical_elements/examples_crystal_asymmetric.py +0 -134
  19. syned-1.0.40/shadow4/examples/optical_elements/examples_crystal_yb66.py +0 -124
  20. syned-1.0.40/shadow4/examples/optical_elements/examples_ideal_lens.py +0 -283
  21. syned-1.0.40/shadow4/examples/optical_elements/examples_mirror.py +0 -505
  22. syned-1.0.40/shadow4/examples/optical_elements/examples_screen.py +0 -184
  23. syned-1.0.40/shadow4/examples/sources/example_bending_magnet_als_infrared.py +0 -64
  24. syned-1.0.40/shadow4/examples/sources/example_bending_magnet_esrf1.py +0 -60
  25. syned-1.0.40/shadow4/examples/sources/example_source_undulator.py +0 -96
  26. syned-1.0.40/shadow4/examples/sources/example_wiggler_als_infrared.py +0 -134
  27. syned-1.0.40/shadow4/examples/sources/examples_source_gaussian.py +0 -86
  28. syned-1.0.40/shadow4/examples/sources/examples_source_geometrical.py +0 -91
  29. syned-1.0.40/shadow4/examples/sources/examples_sources_file_io.py +0 -128
  30. syned-1.0.40/shadow4/setup.py +0 -95
  31. syned-1.0.40/shadow4/shadow4/__init__.py +0 -2
  32. syned-1.0.40/shadow4/shadow4/beam/__init__.py +0 -1
  33. syned-1.0.40/shadow4/shadow4/beam/s4_beam.py +0 -2350
  34. syned-1.0.40/shadow4/shadow4/beamline/__init__.py +0 -0
  35. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/__init__.py +0 -1
  36. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/absorbers/__init__.py +0 -0
  37. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/absorbers/s4_screen.py +0 -200
  38. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/crystals/__init__.py +0 -0
  39. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/crystals/s4_additional_numerical_mesh_crystal.py +0 -161
  40. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/crystals/s4_conic_crystal.py +0 -236
  41. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/crystals/s4_crystal.py +0 -867
  42. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/crystals/s4_ellipsoid_crystal.py +0 -263
  43. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/crystals/s4_hyperboloid_crystal.py +0 -263
  44. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/crystals/s4_numerical_mesh_crystal.py +0 -292
  45. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/crystals/s4_paraboloid_crystal.py +0 -266
  46. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/crystals/s4_plane_crystal.py +0 -231
  47. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/crystals/s4_sphere_crystal.py +0 -253
  48. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/crystals/s4_toroid_crystal.py +0 -257
  49. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/gratings/__init__.py +0 -0
  50. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/gratings/s4_additional_numerical_mesh_grating.py +0 -160
  51. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/gratings/s4_conic_grating.py +0 -162
  52. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/gratings/s4_ellipsoid_grating.py +0 -175
  53. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/gratings/s4_grating.py +0 -289
  54. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/gratings/s4_hyperboloid_grating.py +0 -175
  55. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/gratings/s4_numerical_mesh_grating.py +0 -161
  56. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/gratings/s4_paraboloid_grating.py +0 -180
  57. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/gratings/s4_plane_grating.py +0 -156
  58. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/gratings/s4_sphere_grating.py +0 -176
  59. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/gratings/s4_toroid_grating.py +0 -171
  60. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/ideal_elements/__init__.py +0 -0
  61. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/ideal_elements/s4_beam_movement.py +0 -108
  62. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/ideal_elements/s4_empty.py +0 -78
  63. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/ideal_elements/s4_ideal_lens.py +0 -176
  64. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/mirrors/__init__.py +0 -0
  65. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/mirrors/s4_additional_numerical_mesh_mirror.py +0 -183
  66. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/mirrors/s4_conic_mirror.py +0 -89
  67. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/mirrors/s4_ellipsoid_mirror.py +0 -121
  68. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/mirrors/s4_hyperboloid_mirror.py +0 -126
  69. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/mirrors/s4_mirror.py +0 -442
  70. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/mirrors/s4_numerical_mesh_mirror.py +0 -98
  71. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/mirrors/s4_paraboloid_mirror.py +0 -116
  72. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/mirrors/s4_plane_mirror.py +0 -90
  73. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/mirrors/s4_sphere_mirror.py +0 -101
  74. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/mirrors/s4_toroid_mirror.py +0 -108
  75. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/refractors/__init__.py +0 -0
  76. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/refractors/s4_conic_interface.py +0 -254
  77. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/refractors/s4_crl.py +0 -219
  78. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/refractors/s4_interface.py +0 -227
  79. syned-1.0.40/shadow4/shadow4/beamline/optical_elements/refractors/s4_lens.py +0 -315
  80. syned-1.0.40/shadow4/shadow4/beamline/s4_beamline.py +0 -76
  81. syned-1.0.40/shadow4/shadow4/beamline/s4_beamline_element.py +0 -36
  82. syned-1.0.40/shadow4/shadow4/beamline/s4_beamline_element_movements.py +0 -24
  83. syned-1.0.40/shadow4/shadow4/beamline/s4_optical_element_decorators.py +0 -725
  84. syned-1.0.40/shadow4/shadow4/optical_surfaces/__init__.py +0 -1
  85. syned-1.0.40/shadow4/shadow4/optical_surfaces/s4_conic.py +0 -1379
  86. syned-1.0.40/shadow4/shadow4/optical_surfaces/s4_mesh.py +0 -523
  87. syned-1.0.40/shadow4/shadow4/optical_surfaces/s4_mesh_old.py +0 -629
  88. syned-1.0.40/shadow4/shadow4/optical_surfaces/s4_optical_surface.py +0 -141
  89. syned-1.0.40/shadow4/shadow4/optical_surfaces/s4_toroid.py +0 -459
  90. syned-1.0.40/shadow4/shadow4/physical_models/__init__.py +0 -0
  91. syned-1.0.40/shadow4/shadow4/physical_models/bragg/__init__.py +0 -0
  92. syned-1.0.40/shadow4/shadow4/physical_models/bragg/bragg.py +0 -281
  93. syned-1.0.40/shadow4/shadow4/physical_models/mlayer/__init__.py +0 -1
  94. syned-1.0.40/shadow4/shadow4/physical_models/mlayer/mlayer.py +0 -1078
  95. syned-1.0.40/shadow4/shadow4/physical_models/prerefl/__init__.py +0 -1
  96. syned-1.0.40/shadow4/shadow4/physical_models/prerefl/prerefl.py +0 -748
  97. syned-1.0.40/shadow4/shadow4/sources/__init__.py +0 -0
  98. syned-1.0.40/shadow4/shadow4/sources/bending_magnet/__init__.py +0 -1
  99. syned-1.0.40/shadow4/shadow4/sources/bending_magnet/s4_bending_magnet.py +0 -252
  100. syned-1.0.40/shadow4/shadow4/sources/bending_magnet/s4_bending_magnet_light_source.py +0 -720
  101. syned-1.0.40/shadow4/shadow4/sources/s4_electron_beam.py +0 -88
  102. syned-1.0.40/shadow4/shadow4/sources/s4_light_source.py +0 -159
  103. syned-1.0.40/shadow4/shadow4/sources/s4_light_source_base.py +0 -120
  104. syned-1.0.40/shadow4/shadow4/sources/source_geometrical/__init__.py +0 -1
  105. syned-1.0.40/shadow4/shadow4/sources/source_geometrical/probability_distributions.py +0 -707
  106. syned-1.0.40/shadow4/shadow4/sources/source_geometrical/source_gaussian.py +0 -405
  107. syned-1.0.40/shadow4/shadow4/sources/source_geometrical/source_geometrical.py +0 -1006
  108. syned-1.0.40/shadow4/shadow4/sources/source_geometrical/source_grid_cartesian.py +0 -460
  109. syned-1.0.40/shadow4/shadow4/sources/source_geometrical/source_grid_polar.py +0 -424
  110. syned-1.0.40/shadow4/shadow4/sources/undulator/hankel_example_srio.py +0 -186
  111. syned-1.0.40/shadow4/shadow4/sources/undulator/s4_undulator.py +0 -338
  112. syned-1.0.40/shadow4/shadow4/sources/undulator/s4_undulator_light_source.py +0 -1499
  113. syned-1.0.40/shadow4/shadow4/sources/undulator/source_undulator_factory.py +0 -297
  114. syned-1.0.40/shadow4/shadow4/sources/undulator/source_undulator_factory_pysru.py +0 -525
  115. syned-1.0.40/shadow4/shadow4/sources/undulator/source_undulator_factory_srw.py +0 -484
  116. syned-1.0.40/shadow4/shadow4/sources/undulator/source_undulator_input_output.py +0 -421
  117. syned-1.0.40/shadow4/shadow4/sources/wiggler/__init__.py +0 -1
  118. syned-1.0.40/shadow4/shadow4/sources/wiggler/s4_wiggler.py +0 -454
  119. syned-1.0.40/shadow4/shadow4/sources/wiggler/s4_wiggler_light_source.py +0 -1231
  120. syned-1.0.40/shadow4/shadow4/tools/__init__.py +0 -0
  121. syned-1.0.40/shadow4/shadow4/tools/arrayofvectors.py +0 -231
  122. syned-1.0.40/shadow4/shadow4/tools/graphics.py +0 -482
  123. syned-1.0.40/shadow4/shadow4/tools/sync_f_sigma_and_pi.py +0 -217
  124. syned-1.0.40/syned/__init__.py +0 -1
  125. syned-1.0.40/syned/beamline/__init__.py +0 -2
  126. syned-1.0.40/syned/beamline/optical_elements/__init__.py +0 -2
  127. syned-1.0.40/syned/beamline/optical_elements/absorbers/__init__.py +0 -1
  128. syned-1.0.40/syned/beamline/optical_elements/crystals/__init__.py +0 -1
  129. syned-1.0.40/syned/beamline/optical_elements/gratings/__init__.py +0 -1
  130. syned-1.0.40/syned/beamline/optical_elements/gratings/tmp1.py +0 -104
  131. syned-1.0.40/syned/beamline/optical_elements/ideal_elements/__init__.py +0 -1
  132. syned-1.0.40/syned/beamline/optical_elements/mirrors/__init__.py +0 -1
  133. syned-1.0.40/syned/beamline/optical_elements/refractors/__init__.py +0 -1
  134. syned-1.0.40/syned/beamline/optical_elements/tmp.py +0 -23
  135. syned-1.0.40/syned/storage_ring/__init__.py +0 -2
  136. syned-1.0.40/syned/storage_ring/magnetic_structures/__init__.py +0 -2
  137. syned-1.0.40/syned/util/__init__.py +0 -1
  138. syned-1.0.40/syned/widget/__init__.py +0 -1
  139. syned-1.0.40/syned.egg-info/SOURCES.txt +0 -174
  140. {syned-1.0.40 → syned-1.0.42}/LICENSE +0 -0
  141. {syned-1.0.40 → syned-1.0.42}/MANIFEST.in +0 -0
  142. {syned-1.0.40 → syned-1.0.42}/README.rst +0 -0
  143. {syned-1.0.40 → syned-1.0.42}/examples/__init__.py +0 -0
  144. {syned-1.0.40 → syned-1.0.42}/examples/example_beamline.py +0 -0
  145. {syned-1.0.40 → syned-1.0.42}/examples/example_double_slit.py +0 -0
  146. {syned-1.0.40 → syned-1.0.42}/examples/example_json_input_output.py +0 -0
  147. {syned-1.0.40 → syned-1.0.42}/setup.cfg +0 -0
  148. {syned-1.0.40/shadow4 → syned-1.0.42/syned}/__init__.py +0 -0
  149. {syned-1.0.40/shadow4/shadow4/sources/undulator → syned-1.0.42/syned/beamline}/__init__.py +0 -0
  150. {syned-1.0.40 → syned-1.0.42}/syned/beamline/beamline.py +0 -0
  151. {syned-1.0.40 → syned-1.0.42}/syned/beamline/beamline_element.py +0 -0
  152. {syned-1.0.40 → syned-1.0.42}/syned/beamline/element_coordinates.py +0 -0
  153. {syned-1.0.40 → syned-1.0.42}/syned/beamline/optical_element.py +0 -0
  154. {syned-1.0.40 → syned-1.0.42}/syned/beamline/optical_element_with_surface_shape.py +0 -0
  155. {syned-1.0.40/shadow4/examples → syned-1.0.42/syned/beamline/optical_elements/absorbers}/__init__.py +0 -0
  156. {syned-1.0.40 → syned-1.0.42}/syned/beamline/optical_elements/absorbers/absorber.py +0 -0
  157. {syned-1.0.40 → syned-1.0.42}/syned/beamline/optical_elements/absorbers/beam_stopper.py +0 -0
  158. {syned-1.0.40 → syned-1.0.42}/syned/beamline/optical_elements/absorbers/filter.py +0 -0
  159. {syned-1.0.40 → syned-1.0.42}/syned/beamline/optical_elements/absorbers/holed_filter.py +0 -0
  160. {syned-1.0.40 → syned-1.0.42}/syned/beamline/optical_elements/absorbers/slit.py +0 -0
  161. {syned-1.0.40 → syned-1.0.42}/syned/beamline/optical_elements/crystals/crystal.py +0 -0
  162. {syned-1.0.40 → syned-1.0.42}/syned/beamline/optical_elements/gratings/grating.py +0 -0
  163. {syned-1.0.40 → syned-1.0.42}/syned/beamline/optical_elements/ideal_elements/ideal_element.py +0 -0
  164. {syned-1.0.40 → syned-1.0.42}/syned/beamline/optical_elements/ideal_elements/ideal_lens.py +0 -0
  165. {syned-1.0.40 → syned-1.0.42}/syned/beamline/optical_elements/ideal_elements/screen.py +0 -0
  166. {syned-1.0.40 → syned-1.0.42}/syned/beamline/optical_elements/mirrors/mirror.py +0 -0
  167. {syned-1.0.40 → syned-1.0.42}/syned/beamline/optical_elements/refractors/crl.py +0 -0
  168. {syned-1.0.40 → syned-1.0.42}/syned/beamline/optical_elements/refractors/interface.py +0 -0
  169. {syned-1.0.40 → syned-1.0.42}/syned/beamline/optical_elements/refractors/lens.py +0 -0
  170. {syned-1.0.40 → syned-1.0.42}/syned/beamline/shape.py +0 -0
  171. {syned-1.0.40 → syned-1.0.42}/syned/storage_ring/electron_beam.py +0 -0
  172. {syned-1.0.40 → syned-1.0.42}/syned/storage_ring/empty_light_source.py +0 -0
  173. {syned-1.0.40 → syned-1.0.42}/syned/storage_ring/light_source.py +0 -0
  174. {syned-1.0.40 → syned-1.0.42}/syned/storage_ring/magnetic_structure.py +0 -0
  175. {syned-1.0.40 → syned-1.0.42}/syned/storage_ring/magnetic_structures/bending_magnet.py +0 -0
  176. {syned-1.0.40 → syned-1.0.42}/syned/storage_ring/magnetic_structures/insertion_device.py +0 -0
  177. {syned-1.0.40 → syned-1.0.42}/syned/storage_ring/magnetic_structures/undulator.py +0 -0
  178. {syned-1.0.40 → syned-1.0.42}/syned/storage_ring/magnetic_structures/wiggler.py +0 -0
  179. {syned-1.0.40 → syned-1.0.42}/syned/syned_object.py +0 -0
  180. {syned-1.0.40/shadow4/examples/optical_elements → syned-1.0.42/syned/util}/__init__.py +0 -0
  181. {syned-1.0.40 → syned-1.0.42}/syned/util/json_tools.py +0 -0
  182. {syned-1.0.40/shadow4/examples/sources → syned-1.0.42/syned/widget}/__init__.py +0 -0
  183. {syned-1.0.40 → syned-1.0.42}/syned.egg-info/dependency_links.txt +0 -0
  184. {syned-1.0.40 → syned-1.0.42}/syned.egg-info/not-zip-safe +0 -0
  185. {syned-1.0.40 → syned-1.0.42}/syned.egg-info/requires.txt +0 -0
  186. {syned-1.0.40 → syned-1.0.42}/syned.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: syned
3
- Version: 1.0.40
3
+ Version: 1.0.42
4
4
  Summary: SYNED (SYNchrotron Elements Dictionary) kernel library
5
5
  Home-page: https://github.com/oasys-kit/syned
6
6
  Download-URL: https://github.com/oasys-kit/syned
@@ -9,7 +9,7 @@ except AttributeError:
9
9
 
10
10
  NAME = 'syned'
11
11
 
12
- VERSION = '1.0.40'
12
+ VERSION = '1.0.42'
13
13
  ISRELEASED = True
14
14
 
15
15
  DESCRIPTION = 'SYNED (SYNchrotron Elements Dictionary) kernel library'
@@ -0,0 +1,183 @@
1
+ import numpy
2
+ from syned.beamline.optical_elements.ideal_elements.ideal_element import IdealElement
3
+
4
+ class IdealFZP(IdealElement):
5
+ """
6
+ Defines an ideal Fresnel Zone Plate.
7
+
8
+ Constructor.
9
+
10
+ Parameters
11
+ ----------
12
+ name : str, optional
13
+ The name of the optical element.
14
+ focusing_direction : int
15
+ 0=None, 1=x (sagittal), 2=z (meridional), 3=2D focusing.
16
+ focal : float
17
+ The focal length in meters.
18
+ nominal_wavelength : float
19
+ The nominal wavelength in m for where the focal length is defined.
20
+ diameter : float
21
+ The FZP diameter in m.
22
+
23
+ """
24
+ def __init__(self,
25
+ name="Undefined",
26
+ focusing_direction=3, # 0=None, 1=x (sagittal), 2=z (meridional), 3=2D focusing.
27
+ focal=1.0, # focal distance (m)
28
+ nominal_wavelength=1e-10, # nominal wavelength in m
29
+ # r0=10.0e-6, # inner zone radius (m)
30
+ diameter=0.001, # FZP diameter in m
31
+ ):
32
+ IdealElement.__init__(self, name=name)
33
+ self._focusing_direction = focusing_direction
34
+ self._focal = focal
35
+ self._nominal_wavelength = nominal_wavelength
36
+ self._diameter = diameter
37
+
38
+ # support text containg name of variable, help text and unit. Will be stored in self._support_dictionary
39
+ self._set_support_text([
40
+ ("name" , "Name" , ""),
41
+ ("boundary_shape" , "" , ""),
42
+ ("focusing_direction", "Focusing direction: 0=None, 1=1D along X, 2=1D along Z, 3=2D", ""),
43
+ ("focal" , "Focal length" , "m"),
44
+ ("nominal_wavelength", "Nominal wavelength" , "m"),
45
+ ("diameter" , "FZP diameter" , "m"),
46
+ ] )
47
+
48
+ def focusing_direction(self):
49
+ """
50
+ Returns the focusing direction.
51
+
52
+ Returns
53
+ -------
54
+ int
55
+ 0=None,
56
+ 1=1D along X,
57
+ 2=1D along Z,
58
+ 3=2D.
59
+ """
60
+ return self._focusing_direction
61
+
62
+ def focal(self):
63
+ """
64
+ Returns the focal length.
65
+
66
+ Returns
67
+ -------
68
+ float
69
+
70
+ """
71
+ return self._focal
72
+
73
+ def nominal_wavelength(self):
74
+ """
75
+ Returns the nominal wavelength.
76
+
77
+ Returns
78
+ -------
79
+ float
80
+
81
+ """
82
+ return self._nominal_wavelength
83
+
84
+ def diameter(self):
85
+ """
86
+ Returns the FZP diameter.
87
+
88
+ Returns
89
+ -------
90
+ float
91
+
92
+ """
93
+ return self._diameter
94
+
95
+ #
96
+ # calculated. The exact expression is rn = sqrt( n lambda f + (n lambda / 2)**2 )
97
+ #
98
+ def rn(self):
99
+ return 0.5 * self.diameter()
100
+
101
+ def r0(self):
102
+ """
103
+ Returns the innermost radius (approximated calculation r0=sqrt(wavelength * focal)).
104
+
105
+ Returns
106
+ -------
107
+ float
108
+
109
+ """
110
+ return numpy.sqrt(self.nominal_wavelength() * self.focal())
111
+
112
+ def r0_exact(self):
113
+ """
114
+ Returns the innermost radius (exact calculation r0=sqrt(wavelength * focal + (wavelength/2)**2)).
115
+
116
+ Returns
117
+ -------
118
+ float
119
+
120
+ """
121
+ return numpy.sqrt(self.nominal_wavelength() * self.focal() + (0.5 * self.nominal_wavelength())**2)
122
+
123
+ def n_vs_r(self, r): # approximated if f >> diameter; eq 855 in Michette
124
+ """
125
+ Returns the zone number for a given distance r (approximated calculation).
126
+
127
+ Returns
128
+ -------
129
+ float
130
+
131
+ """
132
+ return (r ** 2 / self.nominal_wavelength() / self.focal())
133
+
134
+ def n_exact_vs_r(self, r): # Exact, solving n from rn = sqrt( n lambda f + (n lambda / 2)**2 )
135
+ """
136
+ Returns the zone number for a given distance r
137
+ (exact calculation solving n from rn = sqrt( n lambda f + (n lambda / 2)**2).
138
+
139
+ Returns
140
+ -------
141
+ float
142
+
143
+ """
144
+ nn = -2 * self.focal() + 2 * numpy.sqrt(self.focal()**2 + r**2)
145
+ return nn / self.nominal_wavelength()
146
+
147
+ def n(self):
148
+ """
149
+ Returns the zone number for a outermost zone (approximated calculation).
150
+
151
+ Returns
152
+ -------
153
+ float
154
+
155
+ """
156
+ return self.n_vs_r( self.rn() )
157
+
158
+ def n_exact(self):
159
+ """
160
+ Returns the zone number for a outermost zone (exact calculation using n_exact_vs_r() ).
161
+
162
+ Returns
163
+ -------
164
+ float
165
+
166
+ """
167
+ return self.n_exact_vs_r(self.rn())
168
+
169
+ if __name__ == "__main__":
170
+ fzp = IdealFZP(
171
+ name = "Undefined",
172
+ focusing_direction = 3, # 0=None, 1=x (sagittal), 2=z (meridional), 3=2D focusing.
173
+ focal = 1.0, # focal distance (m)
174
+ nominal_wavelength = 1e-10, # nominal wavelength in m
175
+ diameter = 0.001, # FZP diameter in m
176
+ )
177
+
178
+ print(fzp.info())
179
+ print("r0, r0_exact: ", fzp.r0(), fzp.r0_exact())
180
+ print("rn: ", fzp.rn())
181
+ print("n, n_exact: ", fzp.n(), fzp.n_exact())
182
+
183
+
@@ -1,9 +1,9 @@
1
1
 
2
2
  # THIS FILE IS GENERATED FROM syned SETUP.PY
3
- short_version = '1.0.36'
4
- version = '1.0.36'
5
- full_version = '1.0.36'
6
- git_revision = '357978d095b652b7164ba28368dc272a962652c1'
3
+ short_version = '1.0.38'
4
+ version = '1.0.38'
5
+ full_version = '1.0.38'
6
+ git_revision = ''
7
7
  release = True
8
8
 
9
9
  if not release:
@@ -8,7 +8,7 @@ class WidgetDecorator(object):
8
8
  """
9
9
 
10
10
  @classmethod
11
- def syned_input_data(cls):
11
+ def syned_input_data(cls, multi_input=False):
12
12
  """
13
13
  A string to help defining SYNED data in OASYS.
14
14
 
@@ -18,7 +18,25 @@ class WidgetDecorator(object):
18
18
  [("SynedData", Beamline, "receive_syned_data")]
19
19
 
20
20
  """
21
- return [("SynedData", Beamline, "receive_syned_data")]
21
+ try: # OASYS2
22
+ import oasys2
23
+
24
+ if not multi_input:
25
+ from orangewidget.widget import Input
26
+
27
+ return Input(name="SynedData",
28
+ type=Beamline,
29
+ id="SynedData",
30
+ default=True, auto_summary=False)
31
+ else:
32
+ from orangewidget.widget import MultiInput
33
+
34
+ return MultiInput(name="SynedData",
35
+ type=Beamline,
36
+ id="SynedData",
37
+ default=True, auto_summary=False)
38
+ except:
39
+ return [("SynedData", Beamline, "receive_syned_data")]
22
40
 
23
41
  @classmethod
24
42
  def append_syned_input_data(cls, inputs):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: syned
3
- Version: 1.0.40
3
+ Version: 1.0.42
4
4
  Summary: SYNED (SYNchrotron Elements Dictionary) kernel library
5
5
  Home-page: https://github.com/oasys-kit/syned
6
6
  Download-URL: https://github.com/oasys-kit/syned
@@ -0,0 +1,60 @@
1
+ LICENSE
2
+ MANIFEST.in
3
+ README.rst
4
+ setup.py
5
+ examples/__init__.py
6
+ examples/example_beamline.py
7
+ examples/example_double_slit.py
8
+ examples/example_json_input_output.py
9
+ syned/__init__.py
10
+ syned/syned_object.py
11
+ syned/version.py
12
+ syned.egg-info/PKG-INFO
13
+ syned.egg-info/SOURCES.txt
14
+ syned.egg-info/dependency_links.txt
15
+ syned.egg-info/not-zip-safe
16
+ syned.egg-info/requires.txt
17
+ syned.egg-info/top_level.txt
18
+ syned/beamline/__init__.py
19
+ syned/beamline/beamline.py
20
+ syned/beamline/beamline_element.py
21
+ syned/beamline/element_coordinates.py
22
+ syned/beamline/optical_element.py
23
+ syned/beamline/optical_element_with_surface_shape.py
24
+ syned/beamline/shape.py
25
+ syned/beamline/optical_elements/__init__.py
26
+ syned/beamline/optical_elements/absorbers/__init__.py
27
+ syned/beamline/optical_elements/absorbers/absorber.py
28
+ syned/beamline/optical_elements/absorbers/beam_stopper.py
29
+ syned/beamline/optical_elements/absorbers/filter.py
30
+ syned/beamline/optical_elements/absorbers/holed_filter.py
31
+ syned/beamline/optical_elements/absorbers/slit.py
32
+ syned/beamline/optical_elements/crystals/__init__.py
33
+ syned/beamline/optical_elements/crystals/crystal.py
34
+ syned/beamline/optical_elements/gratings/__init__.py
35
+ syned/beamline/optical_elements/gratings/grating.py
36
+ syned/beamline/optical_elements/ideal_elements/__init__.py
37
+ syned/beamline/optical_elements/ideal_elements/ideal_element.py
38
+ syned/beamline/optical_elements/ideal_elements/ideal_fzp.py
39
+ syned/beamline/optical_elements/ideal_elements/ideal_lens.py
40
+ syned/beamline/optical_elements/ideal_elements/screen.py
41
+ syned/beamline/optical_elements/mirrors/__init__.py
42
+ syned/beamline/optical_elements/mirrors/mirror.py
43
+ syned/beamline/optical_elements/refractors/__init__.py
44
+ syned/beamline/optical_elements/refractors/crl.py
45
+ syned/beamline/optical_elements/refractors/interface.py
46
+ syned/beamline/optical_elements/refractors/lens.py
47
+ syned/storage_ring/__init__.py
48
+ syned/storage_ring/electron_beam.py
49
+ syned/storage_ring/empty_light_source.py
50
+ syned/storage_ring/light_source.py
51
+ syned/storage_ring/magnetic_structure.py
52
+ syned/storage_ring/magnetic_structures/__init__.py
53
+ syned/storage_ring/magnetic_structures/bending_magnet.py
54
+ syned/storage_ring/magnetic_structures/insertion_device.py
55
+ syned/storage_ring/magnetic_structures/undulator.py
56
+ syned/storage_ring/magnetic_structures/wiggler.py
57
+ syned/util/__init__.py
58
+ syned/util/json_tools.py
59
+ syned/widget/__init__.py
60
+ syned/widget/widget_decorator.py
@@ -1,48 +0,0 @@
1
-
2
-
3
- from syned.storage_ring.magnetic_structures.undulator import Undulator
4
- from syned.storage_ring.magnetic_structures.wiggler import Wiggler
5
- from syned.storage_ring.magnetic_structures.bending_magnet import BendingMagnet
6
- from syned.storage_ring.light_source import LightSource
7
- from syned.storage_ring.electron_beam import ElectronBeam
8
-
9
- from syned.beamline.beamline import Beamline
10
-
11
- if __name__ == "__main__":
12
-
13
-
14
-
15
- src1 = ElectronBeam.initialize_as_pencil_beam(energy_in_GeV=6.0,current=0.2)
16
- src2 = Undulator()
17
- src = LightSource("test",src1,src2)
18
- magnetic_structure = src.get_magnetic_structure()
19
-
20
- print(magnetic_structure)
21
- if isinstance(magnetic_structure, Undulator):
22
- print(" I am undulator")
23
- elif isinstance(magnetic_structure, Wiggler):
24
- print("I am wiggler")
25
- elif isinstance(magnetic_structure, BendingMagnet):
26
- print("I am a Bending Magnet")
27
- else:
28
- print("I do not know what I am...")
29
-
30
-
31
- #
32
- #
33
- #
34
-
35
- a = Beamline()
36
- magnetic_structure = a.get_light_source().get_magnetic_structure()
37
-
38
- print(magnetic_structure)
39
- if isinstance(magnetic_structure, Undulator):
40
- print(" I am undulator")
41
- elif isinstance(magnetic_structure, Wiggler):
42
- print("I am wiggler")
43
- elif isinstance(magnetic_structure, BendingMagnet):
44
- print("I am a Bending Magnet")
45
- else:
46
- print("I do not know what I am...")
47
-
48
-
@@ -1,134 +0,0 @@
1
-
2
- import numpy
3
-
4
- from shadow4.sources.source_geometrical.source_geometrical import SourceGeometrical
5
- from shadow4.beamline.optical_elements.crystals.s4_plane_crystal import S4PlaneCrystal, S4PlaneCrystalElement
6
-
7
-
8
- from shadow4.tools.graphics import plotxy
9
-
10
- from syned.beamline.element_coordinates import ElementCoordinates
11
-
12
- from syned.beamline.optical_elements.crystals.crystal import Crystal, DiffractionGeometry
13
-
14
-
15
- def get_sigmas_radiation(photon_energy,undulator_length):
16
- import scipy.constants as codata
17
- lambdan = 1e-10 * codata.h*codata.c/codata.e*1e10 / photon_energy # in m
18
- print("wavelength in m",lambdan)
19
- return 1e6*2.740/4/numpy.pi*numpy.sqrt(lambdan*undulator_length),1e6*0.69*numpy.sqrt(lambdan/undulator_length)
20
-
21
-
22
- def crystal_diffraction_with_collimated_beam(do_plot=True):
23
-
24
- #
25
- # collimated source
26
- #
27
-
28
- if True:
29
- src = SourceGeometrical()
30
- src.set_energy_distribution_singleline(value=8000, unit='eV')
31
- src.set_spatial_type_rectangle(width=1e-3, height=1e-3)
32
- src.set_angular_distribution_uniform(0,0,-100e-6,100e-6)
33
- src.set_polarization(polarization_degree= 0.5, phase_diff=numpy.pi/4, coherent_beam=True)
34
- beam = src.get_beam()
35
-
36
- print(beam.info())
37
- SX, SZ = (1e6*beam.get_standard_deviation(1),1e6*beam.get_standard_deviation(3))
38
-
39
-
40
- #
41
- # crystal definition
42
- #
43
-
44
-
45
- if False:
46
- crystal1 = S4PlaneCrystalElement(
47
- optical_element=S4PlaneCrystal(
48
- name="Plane crystal",
49
- boundary_shape=None,
50
- material="Si",
51
- diffraction_geometry=DiffractionGeometry.BRAGG, # ?? not supposed to be in syned...
52
- miller_index_h=1,
53
- miller_index_k=1,
54
- miller_index_l=1,
55
- asymmetry_angle=0.0,
56
- thickness=0.010, # this is thick crystal approximation
57
- f_central=True,
58
- f_phot_cent=0,
59
- phot_cent=8000.0,
60
- file_refl="",
61
- f_bragg_a=False,
62
- # a_bragg=0.0,
63
- f_johansson=False,
64
- r_johansson=1.0,
65
- f_mosaic=False,
66
- spread_mos=0.4 * numpy.pi / 180,
67
- f_ext=0, ),
68
- coordinates=ElementCoordinates(p=0.0, q=5000.0e-3,
69
- angle_radial=0.0, angle_azimuthal=0.0, angle_radial_out=0.0),
70
- input_beam=beam)
71
- else:
72
- crystal1 = S4PlaneCrystalElement()
73
- optical_element = S4PlaneCrystal(
74
- name="Plane crystal",
75
- boundary_shape=None,
76
- material="Si",
77
- diffraction_geometry=DiffractionGeometry.BRAGG, # ?? not supposed to be in syned...
78
- miller_index_h=1,
79
- miller_index_k=1,
80
- miller_index_l=1,
81
- asymmetry_angle=0.0,
82
- thickness=0.010, # this is thick crystal approximation
83
- f_central=True,
84
- f_phot_cent=0,
85
- phot_cent=8000.0,
86
- file_refl="",
87
- f_bragg_a=False,
88
- # a_bragg=0.0,
89
- f_johansson=False,
90
- r_johansson=1.0,
91
- f_mosaic=False,
92
- spread_mos=0.4 * numpy.pi / 180,
93
- f_ext=0, )
94
-
95
- crystal1.set_optical_element(optical_element)
96
- crystal1.set_coordinates(
97
- ElementCoordinates(p=0.0, q=5000.0e-3,
98
- angle_radial=0.0, angle_azimuthal=0.0, angle_radial_out=0.0))
99
- crystal1.set_input_beam(beam)
100
-
101
-
102
- # print(crystal1.info())
103
- # print(crystal1.get_optical_element().get_surface_shape().get_conic_coefficients())
104
- #
105
- # trace
106
- #
107
-
108
- beam2, mirr2 = crystal1.trace_beam()
109
-
110
- if do_plot:
111
- plotxy(beam2, 6, 23, nbins=100, title="INTENSITY VS Z'")
112
-
113
- #
114
- # #
115
- # if do_plot:
116
- # plotxy(beam2, 1, 3, nbins=100, title="FOCAL PLANE")
117
- # plotxy(mirr2, 1, 3, nbins=100, title="LENS HEIGHT")
118
- # # plotxy(mirr2, 4, 5, nbins=100, title="FOOT DIV")
119
- #
120
- # FX, FZ = (1e6*beam2.get_standard_deviation(1),1e6*beam2.get_standard_deviation(3))
121
- # print("Source dimensions: %f %f um"%(SX,SZ))
122
- # print("Focal dimensions: %f %f um"%(FX,FZ))
123
- # print("Demagnification: %g %g"%(SX/FX,SX/FZ))
124
-
125
-
126
-
127
-
128
- if __name__ == "__main__":
129
- from srxraylib.plot.gol import set_qt
130
- set_qt()
131
-
132
- crystal_diffraction_with_collimated_beam(do_plot=True)
133
-
134
-
@@ -1,134 +0,0 @@
1
-
2
- import numpy
3
-
4
- from shadow4.sources.source_geometrical.source_geometrical import SourceGeometrical
5
- from shadow4.beamline.optical_elements.crystals.s4_plane_crystal import S4PlaneCrystal, S4PlaneCrystalElement
6
-
7
-
8
- from shadow4.tools.graphics import plotxy
9
-
10
- from syned.beamline.element_coordinates import ElementCoordinates
11
-
12
- from syned.beamline.optical_elements.crystals.crystal import Crystal, DiffractionGeometry
13
-
14
-
15
- def get_sigmas_radiation(photon_energy,undulator_length):
16
- import scipy.constants as codata
17
- lambdan = 1e-10 * codata.h*codata.c/codata.e*1e10 / photon_energy # in m
18
- print("wavelength in m",lambdan)
19
- return 1e6*2.740/4/numpy.pi*numpy.sqrt(lambdan*undulator_length),1e6*0.69*numpy.sqrt(lambdan/undulator_length)
20
-
21
-
22
- def crystal_diffraction_with_collimated_beam(do_plot=True):
23
-
24
- #
25
- # collimated source
26
- #
27
-
28
- if True:
29
- src = SourceGeometrical(nrays=300)
30
- src.set_energy_distribution_singleline(value=8000, unit='eV')
31
- src.set_spatial_type_rectangle(width=1e-3, height=1e-3)
32
- src.set_angular_distribution_uniform(0,0,-100e-6,100e-6)
33
- src.set_polarization(polarization_degree= 0.5, phase_diff=numpy.pi/4, coherent_beam=True)
34
- beam = src.get_beam()
35
-
36
- print(beam.info())
37
- SX, SZ = (1e6*beam.get_standard_deviation(1),1e6*beam.get_standard_deviation(3))
38
-
39
-
40
- #
41
- # crystal definition
42
- #
43
-
44
-
45
- if False:
46
- crystal1 = S4PlaneCrystalElement(
47
- optical_element=S4PlaneCrystal(
48
- name="Plane crystal",
49
- boundary_shape=None,
50
- material="Si",
51
- diffraction_geometry=DiffractionGeometry.BRAGG, # ?? not supposed to be in syned...
52
- miller_index_h=1,
53
- miller_index_k=1,
54
- miller_index_l=1,
55
- asymmetry_angle=0.0,
56
- thickness=0.010, # this is thick crystal approximation
57
- f_central=True,
58
- f_phot_cent=0,
59
- phot_cent=8000.0,
60
- file_refl="",
61
- f_bragg_a=False,
62
- # a_bragg=0.0,
63
- f_johansson=False,
64
- r_johansson=1.0,
65
- f_mosaic=False,
66
- spread_mos=0.4 * numpy.pi / 180,
67
- f_ext=0, ),
68
- coordinates=ElementCoordinates(p=0.0, q=5000.0e-3,
69
- angle_radial=0.0, angle_azimuthal=0.0, angle_radial_out=0.0),
70
- input_beam=beam)
71
- else:
72
- crystal1 = S4PlaneCrystalElement()
73
- optical_element = S4PlaneCrystal(
74
- name="Plane crystal",
75
- boundary_shape=None,
76
- material="Si",
77
- diffraction_geometry=DiffractionGeometry.BRAGG, # ?? not supposed to be in syned...
78
- miller_index_h=1,
79
- miller_index_k=1,
80
- miller_index_l=1,
81
- asymmetry_angle=numpy.radians(10.0),
82
- thickness=0.010, # this is thick crystal approximation
83
- f_central=True,
84
- f_phot_cent=0,
85
- phot_cent=8000.0,
86
- file_refl="",
87
- f_bragg_a=False,
88
- # a_bragg=0.0,
89
- f_johansson=False,
90
- r_johansson=1.0,
91
- f_mosaic=False,
92
- spread_mos=0.4 * numpy.pi / 180,
93
- f_ext=0, )
94
-
95
- crystal1.set_optical_element(optical_element)
96
- crystal1.set_coordinates(
97
- ElementCoordinates(p=0.0, q=5000.0e-3,
98
- angle_radial=0.0, angle_azimuthal=0.0, angle_radial_out=0.0))
99
- crystal1.set_input_beam(beam)
100
-
101
-
102
- # print(crystal1.info())
103
- # print(crystal1.get_optical_element().get_surface_shape().get_conic_coefficients())
104
- #
105
- # trace
106
- #
107
-
108
- beam2, mirr2 = crystal1.trace_beam()
109
-
110
- if do_plot:
111
- plotxy(beam2, 6, 23, nbins=100, title="INTENSITY VS Z'")
112
-
113
- #
114
- # #
115
- # if do_plot:
116
- # plotxy(beam2, 1, 3, nbins=100, title="FOCAL PLANE")
117
- # plotxy(mirr2, 1, 3, nbins=100, title="LENS HEIGHT")
118
- # # plotxy(mirr2, 4, 5, nbins=100, title="FOOT DIV")
119
- #
120
- # FX, FZ = (1e6*beam2.get_standard_deviation(1),1e6*beam2.get_standard_deviation(3))
121
- # print("Source dimensions: %f %f um"%(SX,SZ))
122
- # print("Focal dimensions: %f %f um"%(FX,FZ))
123
- # print("Demagnification: %g %g"%(SX/FX,SX/FZ))
124
-
125
-
126
-
127
-
128
- if __name__ == "__main__":
129
- from srxraylib.plot.gol import set_qt
130
- set_qt()
131
-
132
- crystal_diffraction_with_collimated_beam(do_plot=True)
133
-
134
-