xrt 2.0.0b0__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 (151) hide show
  1. xrt-2.0.0b0/LICENSE.txt +22 -0
  2. xrt-2.0.0b0/PKG-INFO +210 -0
  3. xrt-2.0.0b0/README.txt +15 -0
  4. xrt-2.0.0b0/setup.cfg +4 -0
  5. xrt-2.0.0b0/setup.py +214 -0
  6. xrt-2.0.0b0/xrt/__init__.py +247 -0
  7. xrt-2.0.0b0/xrt/backends/__init__.py +1 -0
  8. xrt-2.0.0b0/xrt/backends/dummy.py +24 -0
  9. xrt-2.0.0b0/xrt/backends/raycing/__init__.py +424 -0
  10. xrt-2.0.0b0/xrt/backends/raycing/_beam_props.py +167 -0
  11. xrt-2.0.0b0/xrt/backends/raycing/_epics.py +313 -0
  12. xrt-2.0.0b0/xrt/backends/raycing/_flow.py +384 -0
  13. xrt-2.0.0b0/xrt/backends/raycing/_flow_utils.py +557 -0
  14. xrt-2.0.0b0/xrt/backends/raycing/_named_arrays.py +76 -0
  15. xrt-2.0.0b0/xrt/backends/raycing/_rotate.py +108 -0
  16. xrt-2.0.0b0/xrt/backends/raycing/_sets_units.py +96 -0
  17. xrt-2.0.0b0/xrt/backends/raycing/apertures.py +1269 -0
  18. xrt-2.0.0b0/xrt/backends/raycing/beamline.py +1368 -0
  19. xrt-2.0.0b0/xrt/backends/raycing/coherence.py +404 -0
  20. xrt-2.0.0b0/xrt/backends/raycing/data/AtomicData.dat +93 -0
  21. xrt-2.0.0b0/xrt/backends/raycing/data/BrCo.npz +0 -0
  22. xrt-2.0.0b0/xrt/backends/raycing/data/Chantler.npz +0 -0
  23. xrt-2.0.0b0/xrt/backends/raycing/data/Henke.npz +0 -0
  24. xrt-2.0.0b0/xrt/backends/raycing/data/f0_xop.dat +1136 -0
  25. xrt-2.0.0b0/xrt/backends/raycing/figure_error.py +752 -0
  26. xrt-2.0.0b0/xrt/backends/raycing/modes.py +457 -0
  27. xrt-2.0.0b0/xrt/backends/raycing/myopencl.py +667 -0
  28. xrt-2.0.0b0/xrt/backends/raycing/physconsts.py +36 -0
  29. xrt-2.0.0b0/xrt/backends/raycing/pyTTE_x/__init__.py +9 -0
  30. xrt-2.0.0b0/xrt/backends/raycing/pyTTE_x/crystal_vectors.py +58 -0
  31. xrt-2.0.0b0/xrt/backends/raycing/pyTTE_x/deformation.py +300 -0
  32. xrt-2.0.0b0/xrt/backends/raycing/pyTTE_x/elastic_tensors.py +384 -0
  33. xrt-2.0.0b0/xrt/backends/raycing/pyTTE_x/legacy.py +326 -0
  34. xrt-2.0.0b0/xrt/backends/raycing/pyTTE_x/pyTTE.py +906 -0
  35. xrt-2.0.0b0/xrt/backends/raycing/pyTTE_x/pyTTE_rkpy.py +1038 -0
  36. xrt-2.0.0b0/xrt/backends/raycing/pyTTE_x/pyTTE_rkpy_qt.py +855 -0
  37. xrt-2.0.0b0/xrt/backends/raycing/pyTTE_x/quantity.py +344 -0
  38. xrt-2.0.0b0/xrt/backends/raycing/pyTTE_x/rotation_matrix.py +105 -0
  39. xrt-2.0.0b0/xrt/backends/raycing/pyTTE_x/ttcrystal.py +890 -0
  40. xrt-2.0.0b0/xrt/backends/raycing/pyTTE_x/ttscan.py +241 -0
  41. xrt-2.0.0b0/xrt/backends/raycing/run.py +7 -0
  42. xrt-2.0.0b0/xrt/backends/raycing/screens.py +564 -0
  43. xrt-2.0.0b0/xrt/backends/raycing/singletons.py +42 -0
  44. xrt-2.0.0b0/xrt/backends/raycing/stages.py +210 -0
  45. xrt-2.0.0b0/xrt/backends/raycing/waves.py +895 -0
  46. xrt-2.0.0b0/xrt/backends/shadow.py +503 -0
  47. xrt-2.0.0b0/xrt/gui/__init__.py +1 -0
  48. xrt-2.0.0b0/xrt/gui/commons/__init__.py +1 -0
  49. xrt-2.0.0b0/xrt/gui/commons/_images/1-LEG_profile-adhoc.png +0 -0
  50. xrt-2.0.0b0/xrt/gui/commons/_images/1-LEG_profile-default.png +0 -0
  51. xrt-2.0.0b0/xrt/gui/commons/_images/ePos=0.png +0 -0
  52. xrt-2.0.0b0/xrt/gui/commons/_images/ePos=1.png +0 -0
  53. xrt-2.0.0b0/xrt/gui/commons/_images/ePos=2.png +0 -0
  54. xrt-2.0.0b0/xrt/gui/commons/_images/ex03_glow.png +0 -0
  55. xrt-2.0.0b0/xrt/gui/commons/_images/ex03_p01.png +0 -0
  56. xrt-2.0.0b0/xrt/gui/commons/_images/ex03_p02.png +0 -0
  57. xrt-2.0.0b0/xrt/gui/commons/_images/ex03_p03a.png +0 -0
  58. xrt-2.0.0b0/xrt/gui/commons/_images/ex03_p03b.png +0 -0
  59. xrt-2.0.0b0/xrt/gui/commons/_images/ex03_p03c.png +0 -0
  60. xrt-2.0.0b0/xrt/gui/commons/_images/ex03_p03d.png +0 -0
  61. xrt-2.0.0b0/xrt/gui/commons/_images/filterFootprint2_I400mum.png +0 -0
  62. xrt-2.0.0b0/xrt/gui/commons/_images/filterFootprint2_I400mum_norm1.png +0 -0
  63. xrt-2.0.0b0/xrt/gui/commons/_images/filterFootprint2_I400mum_norm2.png +0 -0
  64. xrt-2.0.0b0/xrt/gui/commons/_images/invertColorMap=0_negative=0.png +0 -0
  65. xrt-2.0.0b0/xrt/gui/commons/_images/invertColorMap=0_negative=1.png +0 -0
  66. xrt-2.0.0b0/xrt/gui/commons/_images/invertColorMap=1_negative=0.png +0 -0
  67. xrt-2.0.0b0/xrt/gui/commons/_images/invertColorMap=1_negative=1.png +0 -0
  68. xrt-2.0.0b0/xrt/gui/commons/_images/negative=1+fullNegative.png +0 -0
  69. xrt-2.0.0b0/xrt/gui/commons/_images/offset0.png +0 -0
  70. xrt-2.0.0b0/xrt/gui/commons/_images/offset5000.png +0 -0
  71. xrt-2.0.0b0/xrt/gui/commons/_images/outline00.png +0 -0
  72. xrt-2.0.0b0/xrt/gui/commons/_images/outline05.png +0 -0
  73. xrt-2.0.0b0/xrt/gui/commons/_images/outline10.png +0 -0
  74. xrt-2.0.0b0/xrt/gui/commons/_images/qookSplash2.gif +0 -0
  75. xrt-2.0.0b0/xrt/gui/commons/_images/qookTutor01.png +0 -0
  76. xrt-2.0.0b0/xrt/gui/commons/_images/qookTutor02.png +0 -0
  77. xrt-2.0.0b0/xrt/gui/commons/_images/qookTutor03.png +0 -0
  78. xrt-2.0.0b0/xrt/gui/commons/_images/qookTutor04.png +0 -0
  79. xrt-2.0.0b0/xrt/gui/commons/_images/qookTutor05.png +0 -0
  80. xrt-2.0.0b0/xrt/gui/commons/_images/qookTutor06.png +0 -0
  81. xrt-2.0.0b0/xrt/gui/commons/_images/qookTutor07.png +0 -0
  82. xrt-2.0.0b0/xrt/gui/commons/_images/qookTutor08.png +0 -0
  83. xrt-2.0.0b0/xrt/gui/commons/_images/qookTutor09.png +0 -0
  84. xrt-2.0.0b0/xrt/gui/commons/_images/qookTutor10.png +0 -0
  85. xrt-2.0.0b0/xrt/gui/commons/_images/qookTutor11.png +0 -0
  86. xrt-2.0.0b0/xrt/gui/commons/_themes/qook/layout.html +18 -0
  87. xrt-2.0.0b0/xrt/gui/commons/_themes/qook/page.html +23 -0
  88. xrt-2.0.0b0/xrt/gui/commons/_themes/qook/static/default.css_t +342 -0
  89. xrt-2.0.0b0/xrt/gui/commons/_themes/qook/static/jquery.js +2 -0
  90. xrt-2.0.0b0/xrt/gui/commons/_themes/qook/static/math_config_win32.js +0 -0
  91. xrt-2.0.0b0/xrt/gui/commons/_themes/qook/static/utils.js +34 -0
  92. xrt-2.0.0b0/xrt/gui/commons/_themes/qook/theme.conf +31 -0
  93. xrt-2.0.0b0/xrt/gui/commons/conf.py +130 -0
  94. xrt-2.0.0b0/xrt/gui/commons/ext.py +125 -0
  95. xrt-2.0.0b0/xrt/gui/commons/gl.py +60 -0
  96. xrt-2.0.0b0/xrt/gui/commons/qt.py +512 -0
  97. xrt-2.0.0b0/xrt/gui/xrtBentXtal.py +1373 -0
  98. xrt-2.0.0b0/xrt/gui/xrtGlow/__init__.py +44 -0
  99. xrt-2.0.0b0/xrt/gui/xrtGlow/_constants.py +46 -0
  100. xrt-2.0.0b0/xrt/gui/xrtGlow/_icons/icon-GLow.ico +0 -0
  101. xrt-2.0.0b0/xrt/gui/xrtGlow/_utils.py +125 -0
  102. xrt-2.0.0b0/xrt/gui/xrtGlow/notes.py +115 -0
  103. xrt-2.0.0b0/xrt/gui/xrtQook/__init__.py +46 -0
  104. xrt-2.0.0b0/xrt/gui/xrtQook/_constants.py +24 -0
  105. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/3dg_256.png +0 -0
  106. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/GPU4.png +0 -0
  107. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/add-aperture.png +0 -0
  108. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/add-figure-error.png +0 -0
  109. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/add-material.png +0 -0
  110. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/add-oe.png +0 -0
  111. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/add-plot.png +0 -0
  112. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/add-screen.png +0 -0
  113. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/add-source.png +0 -0
  114. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/dialog-information.png +0 -0
  115. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/dialog-question.png +0 -0
  116. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/double-click.png +0 -0
  117. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/eyeglasses7_128.png +0 -0
  118. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/filenew.png +0 -0
  119. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/fileopen.png +0 -0
  120. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/filesave.png +0 -0
  121. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/filesaveas.png +0 -0
  122. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/home.png +0 -0
  123. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/icon-busy.png +0 -0
  124. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/icon-help.png +0 -0
  125. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/icon-info.png +0 -0
  126. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/index.txt +13 -0
  127. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/light_bulb.png +0 -0
  128. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/logo-xrtQt.png +0 -0
  129. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/pythonscript.png +0 -0
  130. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/pythonscriptsave.png +0 -0
  131. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/pythonscriptsaveas.png +0 -0
  132. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/readme.png +0 -0
  133. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/run.png +0 -0
  134. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/xbcc.ico +0 -0
  135. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/xbcc.png +0 -0
  136. xrt-2.0.0b0/xrt/gui/xrtQook/_icons/xrQt1.ico +0 -0
  137. xrt-2.0.0b0/xrt/gui/xrtQook/_objects_custom.py +144 -0
  138. xrt-2.0.0b0/xrt/gui/xrtQook/tutorial.py +121 -0
  139. xrt-2.0.0b0/xrt/gui/xrtQookStart.py +64 -0
  140. xrt-2.0.0b0/xrt/gui/xrtQookStart.pyw +52 -0
  141. xrt-2.0.0b0/xrt/kde.py +298 -0
  142. xrt-2.0.0b0/xrt/multipro.py +383 -0
  143. xrt-2.0.0b0/xrt/plotter.py +2291 -0
  144. xrt-2.0.0b0/xrt/runner.py +654 -0
  145. xrt-2.0.0b0/xrt/version.py +8 -0
  146. xrt-2.0.0b0/xrt.egg-info/PKG-INFO +210 -0
  147. xrt-2.0.0b0/xrt.egg-info/SOURCES.txt +151 -0
  148. xrt-2.0.0b0/xrt.egg-info/dependency_links.txt +1 -0
  149. xrt-2.0.0b0/xrt.egg-info/not-zip-safe +1 -0
  150. xrt-2.0.0b0/xrt.egg-info/requires.txt +23 -0
  151. xrt-2.0.0b0/xrt.egg-info/top_level.txt +1 -0
@@ -0,0 +1,22 @@
1
+ The MIT License
2
+ ---------------
3
+
4
+ Copyright (c) 2014 Konstantin Klementiev, Roman Chernikov
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ THE SOFTWARE.
xrt-2.0.0b0/PKG-INFO ADDED
@@ -0,0 +1,210 @@
1
+ Metadata-Version: 2.4
2
+ Name: xrt
3
+ Version: 2.0.0b0
4
+ Summary: Ray tracing and wave propagation in x-ray regime, primarily meant for modeling synchrotron sources, beamlines and beamline elements. Includes a GUI for creating a beamline and viewing it in 3D.
5
+ Home-page: http://xrt.readthedocs.io
6
+ Author: Konstantin Klementiev, Roman Chernikov
7
+ Author-email: konstantin.klementiev@gmail.com, rchernikov@gmail.com
8
+ License: MIT License
9
+ Platform: OS Independent
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: Natural Language :: English
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Topic :: Scientific/Engineering :: Physics
17
+ Classifier: Topic :: Scientific/Engineering :: Visualization
18
+ Requires-Python: >=3.9
19
+ Description-Content-Type: text/x-rst
20
+ License-File: LICENSE.txt
21
+ Requires-Dist: numpy>=1.8.0
22
+ Requires-Dist: scipy>=0.17.0
23
+ Requires-Dist: matplotlib>=2.0.0
24
+ Requires-Dist: sphinx>=1.6.2
25
+ Requires-Dist: sphinxcontrib-jquery
26
+ Requires-Dist: distro
27
+ Requires-Dist: colorama
28
+ Requires-Dist: pyopencl
29
+ Requires-Dist: pyopengl
30
+ Requires-Dist: siphash24
31
+ Requires-Dist: freetype-py
32
+ Provides-Extra: pyqt5
33
+ Requires-Dist: PyQt5; extra == "pyqt5"
34
+ Requires-Dist: PyQtWebEngine; extra == "pyqt5"
35
+ Provides-Extra: epics
36
+ Requires-Dist: softioc; extra == "epics"
37
+ Provides-Extra: all
38
+ Requires-Dist: PyQt5; extra == "all"
39
+ Requires-Dist: PyQtWebEngine; extra == "all"
40
+ Requires-Dist: softioc; extra == "all"
41
+ Dynamic: author
42
+ Dynamic: author-email
43
+ Dynamic: classifier
44
+ Dynamic: description
45
+ Dynamic: description-content-type
46
+ Dynamic: home-page
47
+ Dynamic: keywords
48
+ Dynamic: license
49
+ Dynamic: license-file
50
+ Dynamic: platform
51
+ Dynamic: provides-extra
52
+ Dynamic: requires-dist
53
+ Dynamic: requires-python
54
+ Dynamic: summary
55
+
56
+
57
+ Package xrt is a python software library for ray tracing and wave propagation
58
+ in x-ray regime. It is primarily meant for modeling synchrotron sources,
59
+ beamlines and beamline elements. Includes a GUI for creating a beamline and
60
+ interactively viewing it in 3D.
61
+
62
+ Features of xrt
63
+ ---------------
64
+
65
+ * *Rays and waves*. Classical ray tracing and wave propagation via Kirchhoff
66
+ integrals, also freely intermixed. No further approximations, such as thin
67
+ lens or paraxial. The optical surfaces may have figure errors, analytical or
68
+ measured. In wave propagation, partially coherent radiation is treated by
69
+ incoherent addition of coherently diffracted fields generated per electron.
70
+ Propagation of _individual_ coherent source modes is possible as waves,
71
+ hybrid waves (i.e. partially as rays and then as waves) and only rays.
72
+
73
+ * *Publication quality graphics*. 1D and 2D position histograms are
74
+ *simultaneously* coded by hue and brightness. Typically, colors represent
75
+ energy and brightness represents beam intensity. The user may select other
76
+ quantities to be encoded by colors: angular and positional distributions,
77
+ various polarization properties, beam categories, number of reflections,
78
+ incidence angle etc. Brightness can also encode partial flux for a selected
79
+ polarization and incident or absorbed power. Publication quality plots are
80
+ provided by matplotlib with image formats PNG, PostScript, PDF and SVG.
81
+
82
+ * *Unlimited number of rays*. The colored histograms are *cumulative*. The
83
+ accumulation can be stopped and resumed.
84
+
85
+ * *Parallel execution*. xrt can be run in parallel in several threads or
86
+ processes (can be opted), which accelerates the execution on multi-core
87
+ computers. Alternatively, xrt can use the power of GPUs via OpenCL for
88
+ running special tasks such as the calculation of an undulator source or
89
+ performing wave propagation.
90
+
91
+ * *Scripting in Python*. xrt can be run within Python scripts to generate a
92
+ series of images under changing geometrical or physical parameters. The image
93
+ brightness and 1D histograms can be normalized to the global maximum
94
+ throughout the series.
95
+
96
+ * *Synchrotron sources*. Bending magnet, wiggler, undulator and elliptic
97
+ undulator are calculated internally within xrt. Please look the section
98
+ "Comparison of synchrotron source codes" for the comparison other popular
99
+ codes. If the photon source is one of the synchrotron sources, the total flux
100
+ in the beam is reported not just in number of rays but in physical units of
101
+ ph/s. The total power or absorbed power can be opted instead of flux and is
102
+ reported in W. The power density can be visualized by isolines. The magnetic
103
+ gap of undulators can be tapered. Undulators can be calculated in near field.
104
+ Custom magnetic field is also possible. Undulators can be calculated on GPU,
105
+ with a high gain in computation speed, which is important for tapering and
106
+ near field calculations.
107
+
108
+ * *Shapes*. There are several predefined shapes of optical elements implemented
109
+ as python classes. The python inheritance mechanism simplifies creation of
110
+ other shapes: the user specifies methods for surface height and surface
111
+ normal. The surface and the normal are defined either in local Cartesian
112
+ coordinates or in user-defined parametric coordinates. Parametric
113
+ representation enables closed shapes such as capillaries or wave guides. It
114
+ also enables exact solutions for complex shapes (e.g. a logarithmic spiral or
115
+ an ellipsoid) without any expansion. The methods of finding the intersections
116
+ of rays with the surface are very robust and can cope with pathological cases
117
+ such as sharp surface kinks. Notice that the search for intersection points
118
+ does not involve any approximation and has only numerical inaccuracy which is
119
+ set by default as 1 fm. Any surface can be combined with a (differently and
120
+ variably oriented) crystal structure and/or (variable) grating vector.
121
+ Surfaces can be faceted.
122
+
123
+ * *Energy dispersive elements*. Implemented are crystals in dynamical
124
+ diffraction, gratings (also with efficiency calculations), Fresnel zone
125
+ plates, Bragg-Fresnel optics and multilayers in dynamical diffraction.
126
+ Crystals can work in Bragg or Laue cases, in reflection or in transmission.
127
+ The two-field polarization phenomena are fully preserved, also within the
128
+ Darwin diffraction plateau, thus enabling the ray tracing of crystal-based
129
+ phase retarders.
130
+
131
+ * *Materials*. The material properties are incorporated using three different
132
+ tabulations of the scattering factors, with differently wide and differently
133
+ dense energy meshes. Refractive index and absorption coefficient are
134
+ calculated from the scattering factors. Two-surface bodies, such as plates or
135
+ refractive lenses, are treated with both refraction and absorption.
136
+
137
+ * *Multiple reflections*. xrt can trace multiple reflections in a single
138
+ optical element. This is useful, for example in 'whispering gallery' optics
139
+ or in Montel or Wolter mirrors.
140
+
141
+ * *Non-sequential optics*. xrt can trace non-sequential optics where different
142
+ parts of the incoming beam meet different surfaces. Examples of such optics
143
+ are poly-capillaries and Wolter mirrors.
144
+
145
+ * *Singular optics*. xrt correctly propagates vortex beams, which can be used
146
+ for studying the creation of vortex beams by transmissive or reflective
147
+ optics.
148
+
149
+ * *Global coordinate system*. The optical elements are positioned in a global
150
+ coordinate system. This is convenient for modeling a real synchrotron
151
+ beamline. The coordinates in this system can be directly taken from a CAD
152
+ library. The optical surfaces are defined in their local systems for the
153
+ user's convenience.
154
+
155
+ * *Beam categories*. xrt discriminates rays by several categories: `good`,
156
+ `out`, `over` and `dead`. This distinction simplifies the adjustment of
157
+ entrance and exit slits. An alarm is triggered if the fraction of dead rays
158
+ exceeds a specified level.
159
+
160
+ * *Portability*. xrt runs on Windows and Unix-like platforms, wherever you can
161
+ run python.
162
+
163
+ * *Examples*. xrt comes with many examples; see the galleries, the links are at
164
+ the top bar.
165
+
166
+ xrtQook -- a GUI for creating scripts
167
+ -------------------------------------
168
+
169
+ The main interface to xrt is through a python script. Many examples of such
170
+ scripts can be found in the supplied folders 'examples' and 'tests'. The script
171
+ imports the modules of xrt, instantiates beamline parts, such as synchrotron or
172
+ geometric sources, various optical elements, apertures and screens, specifies
173
+ required materials for reflection, refraction or diffraction, defines plots and
174
+ sets job parameters.
175
+
176
+ The Qt tool xrtQook takes these ingredients as GUI elements and prepares a
177
+ ready to use script that can be run within the tool itself or in an external
178
+ Python context. xrtQook has a parallelly updated help panel that provides a
179
+ complete list of parameters for the used objects. xrtQook writes/reads the
180
+ recipes of beamlines into/from xml files.
181
+
182
+ xrtGlow -- an interactive 3D beamline viewer
183
+ --------------------------------------------
184
+
185
+ The beamline created in xrtQook can be interactively viewed in an OpenGL based
186
+ widget xrtGlow. It visualizes beams, footprints, surfaces, apertures and
187
+ screens. The brightness represents intensity and the color represents an
188
+ auxiliary user-selected distribution, typically energy. A virtual screen can be
189
+ put at any position and dragged by mouse with simultaneous observation of the
190
+ beam distribution on it.
191
+
192
+ The primary purpose of xrtGlow is to demonstrate the alignment correctness
193
+ given the fact that xrtQook can automatically calculate several positional and
194
+ angular parameters.
195
+
196
+ Installation
197
+ ------------
198
+
199
+ Install it by pip or conda or get xrt from `GitHub` and use it with or without
200
+ installation.
201
+
202
+ The distribution archive also includes tests and examples. The complete
203
+ documentation is available online on `Read the Docs` and offline as zip file on
204
+ GitHub`.
205
+
206
+ Get help
207
+ --------
208
+
209
+ For getting help and/or reporting a bug please use `GitHub xrt Issues`.
210
+
xrt-2.0.0b0/README.txt ADDED
@@ -0,0 +1,15 @@
1
+ Installation
2
+ ------------
3
+
4
+ Unzip the .zip file into a suitable directory and use
5
+ sys.path.append(path-to-xrt)
6
+ in your script. You can also install xrt to the standard location by running
7
+ python setup.py install from the directory where you have unzipped the archive,
8
+ which is less convenient if you try different versions of xrt and/or different
9
+ versions of python.
10
+
11
+ To run xrtQook, simply start xrtQookStart.pyw from xrt/gui or, if you have
12
+ installed xrt by running setup.py, type `xrtQookStart.pyw` from any location.
13
+
14
+ Note that python-64-bit is by ~20% faster than the 32-bit version (tested with
15
+ WinPython).
xrt-2.0.0b0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
xrt-2.0.0b0/setup.py ADDED
@@ -0,0 +1,214 @@
1
+ # -*- coding: utf-8 -*-
2
+ from setuptools import setup
3
+
4
+ # import importLongDescription
5
+ # long_description = importLongDescription.output()
6
+ long_description = u"""
7
+ Package xrt is a python software library for ray tracing and wave propagation
8
+ in x-ray regime. It is primarily meant for modeling synchrotron sources,
9
+ beamlines and beamline elements. Includes a GUI for creating a beamline and
10
+ interactively viewing it in 3D.
11
+
12
+ Features of xrt
13
+ ---------------
14
+
15
+ * *Rays and waves*. Classical ray tracing and wave propagation via Kirchhoff
16
+ integrals, also freely intermixed. No further approximations, such as thin
17
+ lens or paraxial. The optical surfaces may have figure errors, analytical or
18
+ measured. In wave propagation, partially coherent radiation is treated by
19
+ incoherent addition of coherently diffracted fields generated per electron.
20
+ Propagation of _individual_ coherent source modes is possible as waves,
21
+ hybrid waves (i.e. partially as rays and then as waves) and only rays.
22
+
23
+ * *Publication quality graphics*. 1D and 2D position histograms are
24
+ *simultaneously* coded by hue and brightness. Typically, colors represent
25
+ energy and brightness represents beam intensity. The user may select other
26
+ quantities to be encoded by colors: angular and positional distributions,
27
+ various polarization properties, beam categories, number of reflections,
28
+ incidence angle etc. Brightness can also encode partial flux for a selected
29
+ polarization and incident or absorbed power. Publication quality plots are
30
+ provided by matplotlib with image formats PNG, PostScript, PDF and SVG.
31
+
32
+ * *Unlimited number of rays*. The colored histograms are *cumulative*. The
33
+ accumulation can be stopped and resumed.
34
+
35
+ * *Parallel execution*. xrt can be run in parallel in several threads or
36
+ processes (can be opted), which accelerates the execution on multi-core
37
+ computers. Alternatively, xrt can use the power of GPUs via OpenCL for
38
+ running special tasks such as the calculation of an undulator source or
39
+ performing wave propagation.
40
+
41
+ * *Scripting in Python*. xrt can be run within Python scripts to generate a
42
+ series of images under changing geometrical or physical parameters. The image
43
+ brightness and 1D histograms can be normalized to the global maximum
44
+ throughout the series.
45
+
46
+ * *Synchrotron sources*. Bending magnet, wiggler, undulator and elliptic
47
+ undulator are calculated internally within xrt. Please look the section
48
+ "Comparison of synchrotron source codes" for the comparison other popular
49
+ codes. If the photon source is one of the synchrotron sources, the total flux
50
+ in the beam is reported not just in number of rays but in physical units of
51
+ ph/s. The total power or absorbed power can be opted instead of flux and is
52
+ reported in W. The power density can be visualized by isolines. The magnetic
53
+ gap of undulators can be tapered. Undulators can be calculated in near field.
54
+ Custom magnetic field is also possible. Undulators can be calculated on GPU,
55
+ with a high gain in computation speed, which is important for tapering and
56
+ near field calculations.
57
+
58
+ * *Shapes*. There are several predefined shapes of optical elements implemented
59
+ as python classes. The python inheritance mechanism simplifies creation of
60
+ other shapes: the user specifies methods for surface height and surface
61
+ normal. The surface and the normal are defined either in local Cartesian
62
+ coordinates or in user-defined parametric coordinates. Parametric
63
+ representation enables closed shapes such as capillaries or wave guides. It
64
+ also enables exact solutions for complex shapes (e.g. a logarithmic spiral or
65
+ an ellipsoid) without any expansion. The methods of finding the intersections
66
+ of rays with the surface are very robust and can cope with pathological cases
67
+ such as sharp surface kinks. Notice that the search for intersection points
68
+ does not involve any approximation and has only numerical inaccuracy which is
69
+ set by default as 1 fm. Any surface can be combined with a (differently and
70
+ variably oriented) crystal structure and/or (variable) grating vector.
71
+ Surfaces can be faceted.
72
+
73
+ * *Energy dispersive elements*. Implemented are crystals in dynamical
74
+ diffraction, gratings (also with efficiency calculations), Fresnel zone
75
+ plates, Bragg-Fresnel optics and multilayers in dynamical diffraction.
76
+ Crystals can work in Bragg or Laue cases, in reflection or in transmission.
77
+ The two-field polarization phenomena are fully preserved, also within the
78
+ Darwin diffraction plateau, thus enabling the ray tracing of crystal-based
79
+ phase retarders.
80
+
81
+ * *Materials*. The material properties are incorporated using three different
82
+ tabulations of the scattering factors, with differently wide and differently
83
+ dense energy meshes. Refractive index and absorption coefficient are
84
+ calculated from the scattering factors. Two-surface bodies, such as plates or
85
+ refractive lenses, are treated with both refraction and absorption.
86
+
87
+ * *Multiple reflections*. xrt can trace multiple reflections in a single
88
+ optical element. This is useful, for example in 'whispering gallery' optics
89
+ or in Montel or Wolter mirrors.
90
+
91
+ * *Non-sequential optics*. xrt can trace non-sequential optics where different
92
+ parts of the incoming beam meet different surfaces. Examples of such optics
93
+ are poly-capillaries and Wolter mirrors.
94
+
95
+ * *Singular optics*. xrt correctly propagates vortex beams, which can be used
96
+ for studying the creation of vortex beams by transmissive or reflective
97
+ optics.
98
+
99
+ * *Global coordinate system*. The optical elements are positioned in a global
100
+ coordinate system. This is convenient for modeling a real synchrotron
101
+ beamline. The coordinates in this system can be directly taken from a CAD
102
+ library. The optical surfaces are defined in their local systems for the
103
+ user's convenience.
104
+
105
+ * *Beam categories*. xrt discriminates rays by several categories: `good`,
106
+ `out`, `over` and `dead`. This distinction simplifies the adjustment of
107
+ entrance and exit slits. An alarm is triggered if the fraction of dead rays
108
+ exceeds a specified level.
109
+
110
+ * *Portability*. xrt runs on Windows and Unix-like platforms, wherever you can
111
+ run python.
112
+
113
+ * *Examples*. xrt comes with many examples; see the galleries, the links are at
114
+ the top bar.
115
+
116
+ xrtQook -- a GUI for creating scripts
117
+ -------------------------------------
118
+
119
+ The main interface to xrt is through a python script. Many examples of such
120
+ scripts can be found in the supplied folders 'examples' and 'tests'. The script
121
+ imports the modules of xrt, instantiates beamline parts, such as synchrotron or
122
+ geometric sources, various optical elements, apertures and screens, specifies
123
+ required materials for reflection, refraction or diffraction, defines plots and
124
+ sets job parameters.
125
+
126
+ The Qt tool xrtQook takes these ingredients as GUI elements and prepares a
127
+ ready to use script that can be run within the tool itself or in an external
128
+ Python context. xrtQook has a parallelly updated help panel that provides a
129
+ complete list of parameters for the used objects. xrtQook writes/reads the
130
+ recipes of beamlines into/from xml files.
131
+
132
+ xrtGlow -- an interactive 3D beamline viewer
133
+ --------------------------------------------
134
+
135
+ The beamline created in xrtQook can be interactively viewed in an OpenGL based
136
+ widget xrtGlow. It visualizes beams, footprints, surfaces, apertures and
137
+ screens. The brightness represents intensity and the color represents an
138
+ auxiliary user-selected distribution, typically energy. A virtual screen can be
139
+ put at any position and dragged by mouse with simultaneous observation of the
140
+ beam distribution on it.
141
+
142
+ The primary purpose of xrtGlow is to demonstrate the alignment correctness
143
+ given the fact that xrtQook can automatically calculate several positional and
144
+ angular parameters.
145
+
146
+ Installation
147
+ ------------
148
+
149
+ Install it by pip or conda or get xrt from `GitHub` and use it with or without
150
+ installation.
151
+
152
+ The distribution archive also includes tests and examples. The complete
153
+ documentation is available online on `Read the Docs` and offline as zip file on
154
+ GitHub`.
155
+
156
+ Get help
157
+ --------
158
+
159
+ For getting help and/or reporting a bug please use `GitHub xrt Issues`.
160
+
161
+ """
162
+
163
+ setup(
164
+ name='xrt',
165
+ version='2.0.0b0',
166
+ description='Ray tracing and wave propagation in x-ray regime, primarily '
167
+ 'meant for modeling synchrotron sources, beamlines and '
168
+ 'beamline elements. Includes a GUI for creating a beamline '
169
+ 'and viewing it in 3D.',
170
+ long_description=long_description,
171
+ long_description_content_type='text/x-rst',
172
+ author='Konstantin Klementiev, Roman Chernikov',
173
+ author_email='konstantin.klementiev@gmail.com, rchernikov@gmail.com',
174
+ url='http://xrt.readthedocs.io',
175
+ platforms='OS Independent',
176
+ license='MIT License',
177
+ keywords='',
178
+ python_requires=">=3.9",
179
+ zip_safe=False, # True: build zipped egg, False: unzipped
180
+ packages=[
181
+ 'xrt',
182
+ 'xrt.backends', 'xrt.backends.raycing', 'xrt.backends.raycing.pyTTE_x',
183
+ 'xrt.gui', 'xrt.gui.commons', 'xrt.gui.xrtGlow', 'xrt.gui.xrtQook'],
184
+ package_data={
185
+ 'xrt.backends.raycing': ['data/*.npz', 'data/*.dat', '*.cl'],
186
+ 'xrt': ['*.cl, *.ico'],
187
+ 'xrt.gui': ['*.pyw'],
188
+ 'xrt.gui.commons': ['_images/*.*',
189
+ '_themes/qook/*.*', '_themes/qook/static/*.*'],
190
+ 'xrt.gui.xrtQook': ['_icons/*.*'],
191
+ 'xrt.gui.xrtGlow': ['_icons/*.*']},
192
+ scripts=['xrt/gui/xrtQookStart.pyw', 'xrt/gui/xrtQookStart.py'],
193
+ install_requires=['numpy>=1.8.0', 'scipy>=0.17.0', 'matplotlib>=2.0.0',
194
+ 'sphinx>=1.6.2', 'sphinxcontrib-jquery', 'distro',
195
+ 'colorama',
196
+ # GPU support
197
+ 'pyopencl',
198
+ # glow support
199
+ 'pyopengl', 'siphash24', 'freetype-py'
200
+ # 'openpyxl',
201
+ ],
202
+ extras_require={
203
+ 'pyqt5': ['PyQt5', 'PyQtWebEngine'],
204
+ 'epics': ['softioc'],
205
+ 'all': ['PyQt5', 'PyQtWebEngine', 'softioc']
206
+ },
207
+ classifiers=['Development Status :: 4 - Beta',
208
+ 'Intended Audience :: Science/Research',
209
+ 'Natural Language :: English',
210
+ 'Operating System :: OS Independent',
211
+ 'Programming Language :: Python :: 3',
212
+ 'License :: OSI Approved :: MIT License',
213
+ 'Topic :: Scientific/Engineering :: Physics',
214
+ 'Topic :: Scientific/Engineering :: Visualization'])