orGUI 1.0.1__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 (88) hide show
  1. orgui-1.0.1/LICENSE +21 -0
  2. orgui-1.0.1/PKG-INFO +147 -0
  3. orgui-1.0.1/README.rst +107 -0
  4. orgui-1.0.1/orGUI.egg-info/PKG-INFO +147 -0
  5. orgui-1.0.1/orGUI.egg-info/SOURCES.txt +86 -0
  6. orgui-1.0.1/orGUI.egg-info/dependency_links.txt +1 -0
  7. orgui-1.0.1/orGUI.egg-info/entry_points.txt +2 -0
  8. orgui-1.0.1/orGUI.egg-info/requires.txt +15 -0
  9. orgui-1.0.1/orGUI.egg-info/top_level.txt +1 -0
  10. orgui-1.0.1/orgui/__init__.py +36 -0
  11. orgui-1.0.1/orgui/app/ArrayTableDialog.py +433 -0
  12. orgui-1.0.1/orgui/app/QReflectionSelector.py +538 -0
  13. orgui-1.0.1/orgui/app/QScanSelector.py +692 -0
  14. orgui-1.0.1/orgui/app/QUBCalculator.py +1210 -0
  15. orgui-1.0.1/orgui/app/__init__.py +36 -0
  16. orgui-1.0.1/orgui/app/database.py +487 -0
  17. orgui-1.0.1/orgui/app/orGUI.py +2613 -0
  18. orgui-1.0.1/orgui/app/qutils.py +51 -0
  19. orgui-1.0.1/orgui/backend/__init__.py +32 -0
  20. orgui-1.0.1/orgui/backend/backends.py +157 -0
  21. orgui-1.0.1/orgui/backend/beamline/ID31DiffractLinTilt.py +77 -0
  22. orgui-1.0.1/orgui/backend/beamline/P212_tools.py +577 -0
  23. orgui-1.0.1/orgui/backend/beamline/__init__.py +36 -0
  24. orgui-1.0.1/orgui/backend/beamline/fio_reader.py +110 -0
  25. orgui-1.0.1/orgui/backend/beamline/id31_tools.py +651 -0
  26. orgui-1.0.1/orgui/backend/scans.py +95 -0
  27. orgui-1.0.1/orgui/backend/udefaults.py +163 -0
  28. orgui-1.0.1/orgui/backend/universalScanLoader.py +105 -0
  29. orgui-1.0.1/orgui/datautils/__init__.py +32 -0
  30. orgui-1.0.1/orgui/datautils/util.py +705 -0
  31. orgui-1.0.1/orgui/datautils/xrayutils/CTRcalc.py +3022 -0
  32. orgui-1.0.1/orgui/datautils/xrayutils/CTRopt.py +623 -0
  33. orgui-1.0.1/orgui/datautils/xrayutils/CTRplotutil.py +904 -0
  34. orgui-1.0.1/orgui/datautils/xrayutils/DetectorCalibration.py +685 -0
  35. orgui-1.0.1/orgui/datautils/xrayutils/HKLVlieg.py +1360 -0
  36. orgui-1.0.1/orgui/datautils/xrayutils/ReciprocalNavigation.py +401 -0
  37. orgui-1.0.1/orgui/datautils/xrayutils/_CTRcalc_accel.py +181 -0
  38. orgui-1.0.1/orgui/datautils/xrayutils/__init__.py +46 -0
  39. orgui-1.0.1/orgui/datautils/xrayutils/element_data.py +213 -0
  40. orgui-1.0.1/orgui/datautils/xrayutils/test/__init__.py +57 -0
  41. orgui-1.0.1/orgui/datautils/xrayutils/test/test_CTRcalc.py +152 -0
  42. orgui-1.0.1/orgui/datautils/xrayutils/test/test_DetectorCalibration.py +336 -0
  43. orgui-1.0.1/orgui/datautils/xrayutils/test/test_HKLcalc.py +88 -0
  44. orgui-1.0.1/orgui/datautils/xrayutils/unitcells/Fe3O4(100).bul +59 -0
  45. orgui-1.0.1/orgui/datautils/xrayutils/unitcells/Pt100.bul +7 -0
  46. orgui-1.0.1/orgui/datautils/xrayutils/unitcells/Pt100_small.bul +5 -0
  47. orgui-1.0.1/orgui/datautils/xrayutils/unitcells/Pt110.bul +5 -0
  48. orgui-1.0.1/orgui/datautils/xrayutils/unitcells/Pt111.bul +6 -0
  49. orgui-1.0.1/orgui/datautils/xrayutils/unitcells/Pt310.bul +13 -0
  50. orgui-1.0.1/orgui/datautils/xrayutils/unitcells/Pt3O4(100).bul +19 -0
  51. orgui-1.0.1/orgui/datautils/xrayutils/unitcells/PtO(001).bul +9 -0
  52. orgui-1.0.1/orgui/datautils/xrayutils/unitcells/PtO(010).bul +9 -0
  53. orgui-1.0.1/orgui/datautils/xrayutils/unitcells/PtO(100).bul +9 -0
  54. orgui-1.0.1/orgui/datautils/xrayutils/unitcells/__init__.py +67 -0
  55. orgui-1.0.1/orgui/datautils/xrayutils/unitcells/a-PtO2(0001).bul +6 -0
  56. orgui-1.0.1/orgui/main.py +101 -0
  57. orgui-1.0.1/orgui/resources/__init__.py +40 -0
  58. orgui-1.0.1/orgui/resources/icons/alpha.png +0 -0
  59. orgui-1.0.1/orgui/resources/icons/alpha.svg +67 -0
  60. orgui-1.0.1/orgui/resources/icons/diffractometer_v3.png +0 -0
  61. orgui-1.0.1/orgui/resources/icons/disable-image.png +0 -0
  62. orgui-1.0.1/orgui/resources/icons/disable-image.svg +68 -0
  63. orgui-1.0.1/orgui/resources/icons/document-nx-open.png +0 -0
  64. orgui-1.0.1/orgui/resources/icons/document-nx-open.svg +152 -0
  65. orgui-1.0.1/orgui/resources/icons/document-nx-save.png +0 -0
  66. orgui-1.0.1/orgui/resources/icons/document-nx-save.svg +73 -0
  67. orgui-1.0.1/orgui/resources/icons/logo.png +0 -0
  68. orgui-1.0.1/orgui/resources/icons/logo.svg +808 -0
  69. orgui-1.0.1/orgui/resources/icons/max_image.png +0 -0
  70. orgui-1.0.1/orgui/resources/icons/max_image.svg +77 -0
  71. orgui-1.0.1/orgui/resources/icons/max_image2.png +0 -0
  72. orgui-1.0.1/orgui/resources/icons/max_image2.svg +83 -0
  73. orgui-1.0.1/orgui/resources/icons/search-image.png +0 -0
  74. orgui-1.0.1/orgui/resources/icons/search-image.svg +94 -0
  75. orgui-1.0.1/orgui/resources/icons/search-reflection.png +0 -0
  76. orgui-1.0.1/orgui/resources/icons/search-reflection.svg +126 -0
  77. orgui-1.0.1/orgui/resources/icons/search.png +0 -0
  78. orgui-1.0.1/orgui/resources/icons/search.svg +91 -0
  79. orgui-1.0.1/orgui/resources/icons/select-image.png +0 -0
  80. orgui-1.0.1/orgui/resources/icons/select-image.svg +60 -0
  81. orgui-1.0.1/orgui/resources/icons/set-reflection.png +0 -0
  82. orgui-1.0.1/orgui/resources/icons/set-reflection.svg +91 -0
  83. orgui-1.0.1/orgui/resources/icons/sum_image.png +0 -0
  84. orgui-1.0.1/orgui/resources/icons/sum_image.svg +63 -0
  85. orgui-1.0.1/orgui/resources/icons/sum_image2.png +0 -0
  86. orgui-1.0.1/orgui/resources/icons/sum_image2.svg +75 -0
  87. orgui-1.0.1/pyproject.toml +69 -0
  88. orgui-1.0.1/setup.cfg +4 -0
orgui-1.0.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020-2024 Timo Fuchs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
orgui-1.0.1/PKG-INFO ADDED
@@ -0,0 +1,147 @@
1
+ Metadata-Version: 2.1
2
+ Name: orGUI
3
+ Version: 1.0.1
4
+ Summary: orGUI: Orientation and Integration with 2D detectors
5
+ Author-email: Timo Fuchs <fuchs@physik.uni-kiel.de>
6
+ License: MIT License
7
+ Classifier: Development Status :: 5 - Production/Stable
8
+ Classifier: Environment :: Win32 (MS Windows)
9
+ Classifier: Environment :: X11 Applications :: Qt
10
+ Classifier: Intended Audience :: End Users/Desktop
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Operating System :: MacOS :: MacOS X
15
+ Classifier: Operating System :: Microsoft :: Windows
16
+ Classifier: Operating System :: POSIX
17
+ Classifier: Programming Language :: Python
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: Implementation :: CPython
20
+ Classifier: Topic :: Scientific/Engineering :: Chemistry
21
+ Classifier: Topic :: Scientific/Engineering :: Physics
22
+ Classifier: Topic :: Scientific/Engineering :: Visualization
23
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
+ Requires-Python: >=3.7
25
+ Description-Content-Type: text/x-rst
26
+ License-File: LICENSE
27
+ Requires-Dist: numpy>=1.12
28
+ Requires-Dist: scipy>=1.0
29
+ Requires-Dist: matplotlib>=1.2
30
+ Requires-Dist: fabio>=0.7
31
+ Requires-Dist: silx>=1.1
32
+ Requires-Dist: pyFAI>=0.19
33
+ Requires-Dist: pymca>=5.3
34
+ Requires-Dist: xraydb>=4.0
35
+ Requires-Dist: pytz>=2022
36
+ Provides-Extra: console
37
+ Requires-Dist: qtconsole; extra == "console"
38
+ Provides-Extra: speedup
39
+ Requires-Dist: numba; extra == "speedup"
40
+
41
+
42
+ orGUI: Orientation and Integration with 2D detectors
43
+ ====================================================
44
+
45
+ .. |logo| image:: ./orgui/resources/icons/logo.svg
46
+ :height: 320px
47
+
48
+ |logo|
49
+
50
+ orGUI is a software that can be used to determine the orientation of single crystal samples in X-ray diffraction experiments
51
+ from the observation of few reflections on a large, statinary 2D detector.
52
+ The settings of a 4-circle sample positioning stage as used for surface X-ray diffraction can be calculated. 
53
+
54
+ Its primary usecase is High Energy Surface X-ray Diffraction (`HESXRD <https://doi.org/10.1126/science.1246834>`_) or Transmission Surface Diffraction (`TSD <https://doi.org/10.1021/acs.jpclett.7b00332>`_).
55
+
56
+ Intensity integration is possible along arbitrary directions in reciprocal space (in reciprocal lattice coordinates (*h k l*)). Stationary and rocking scans can be integrated.
57
+ In addition, the crystal orientation obtained by *orGUI* can be used for further processing with other software such as `binoculars <https://github.com/id03/binoculars>`_, which is described `here <https://doi.org/10.1107/S1600576715009607>`_.
58
+ Examples for the application of orGUI and binoculars for CTR data analysis is described in the Supporting Information of `this <https://doi.org/10.1002/anie.202304293>`__ paper or the Methods section of `this <https://doi.org/10.1038/s41929-020-0497-y>`__ paper.
59
+
60
+
61
+ Installation
62
+ ------------
63
+
64
+ To install orGUI (and all its dependencies), run:
65
+
66
+ .. code-block:: bash
67
+
68
+ pip install orGUI[full]
69
+
70
+ To install orGUI with a minimal set of dependencies, run:
71
+
72
+ .. code-block:: bash
73
+
74
+ pip install orGUI
75
+
76
+ Getting started
77
+ ---------------
78
+
79
+ *orGUI* can be started by the shell command `orGUI`. *orGUI* can also be started preconfigured with a configuration file `<configfile>` by typing
80
+
81
+ .. code-block:: bash
82
+
83
+ orGUI <configfile>
84
+
85
+ All configuration is accessible in the user interface in the menu `Config->Machine parameters` and `Config->Crystal parameters`.
86
+ Examples of configuration files are provided with the `source code <https://doi.org/10.5281/zenodo.12592485>`_.
87
+
88
+ *orGUI* is designed to handle data, which is saved in a `NEXUS <https://doi.org/10.1107/S1600576714027575>`_ format or a combination of `SPEC <https://certif.com/spec.html>`_ files and separately saved image files.
89
+ The file browser on the left side of orGUI shows the contents of the NEXUS or SPEC file, which typically contain multiple scans. Double clicking a scan in the file browser will open the specified scan.
90
+
91
+ Data is typically saved differently (i.e. counter names, image locations, etc.) at different beamlines. Backends for loading scan data currently only exists for ID31 at the ESRF and P21.2 at DESY.
92
+ Loading data from other beamlines requires writing a new backend, which handles the loading of the scan data. The backends are located in `orgui/backend` of the source directory.
93
+ Documentation about writing new backends will follow in a future release. Please create an issue on Github or write an Email for help on writing a new backend.
94
+
95
+ A simplistic backend for loading of bare image data without meta data information is available under `file->Generate scan from images`.
96
+
97
+
98
+ Documentation
99
+ -------------
100
+
101
+ A detailed documentation is not yet available, but will be provided in a future release.
102
+
103
+ .. |diffractometer| image:: ./orgui/resources/icons/diffractometer_v3.png
104
+ :height: 360px
105
+
106
+ |diffractometer|
107
+
108
+ orGUI uses the diffractometer convention by `Lohmeier & Vlieg 1993 <https://doi.org/10.1107/S0021889893004868>`_. However, the phi-circle rotates around the x-axis instead of the z-axis!. The azimuth angle in "machine parameters" rotates the whole diffractometer around the primary beam direction. Also :math:`$\theta = - \omega$`. (Since at ID31 the :math:`$\theta$` rotation is right-handed).
109
+ xyz in lab frame is: y along beam direction, z along direction defined by azimuth (when azimuth = 90°, z points upwards), x perpendicular to both. 
110
+ The detector geometry of orGUI is adapted from the commonly used python package `pyFAI <https://pyfai.readthedocs.io/en/stable/>`_, which enables comprehensive detector geometry calibration.
111
+ It is recommended to determine the position of the X-ray detector from the Debye-Scherrer rings of a X-ray diffraction calibration standard such as CeO2 with the `geometry calibration tools <https://pyfai.readthedocs.io/en/stable/usage/cookbook/calib-gui/index.html>`_ of pyFAI.
112
+ The resulting `poni` file can currently only be loaded in orGUI by setting the `poni` parameter in the `Machine` section of the orGUI config file to the poni file location. The orGUI config file must then be loaded.
113
+
114
+ Here is a simplistic description of the usual workflow for crystal truncation rod integration (a more complete manual will follow): 
115
+
116
+ For setting the orientation matrix, there are 2 methods available:
117
+
118
+ 1. Expert mode: This is in the menu Reciprocal Space -> Edit orientation matrix. This is more intended to be used if symmetries can be directly observed at specific angle settings and applies more to Transmission Diffraction (e.g. if you see that two Bragg reflections have identical intensities, a reference position can be obtained from that). This is not really extremely useful for Grazing incidence geometry since you have to think about what you are doing.
119
+
120
+ 2. Conventional setting of matrix using reference reflections (`Busing & Levy <https://doi.org/10.1107/S0365110X67000970>`_): The images and the window "Reciprocal space navigation" is used for that. Double clicking at any position in the image will set a red reference reflection at this specific image. The position of the marker on the image defines the scattering angles and the image number gives the sample rotation angle (i.e. theta) of the reference reflection. You can drag+drop the marker around in the image and the image number can be changed with the two buttons in the top right corner of the "Reciprocal space navigation" window (one button selects the current image for the chosen refllection; with the other you can jump to the image which was previously selected for the reflection). Usually the HKL values are wrong when you add a reflection. This can be overridden in the table in the Reciprocal space navigation window. To calculate the matrix click "calculate U". This function also works with only one reference reflection by assuming that the L axis is pointing towards the z/azimuth-direction (Enable View->machine parameters to display a marker at the z-direction). For other geometries you need at least 2 reference reflections. So what I ususally do is to search for a nicely visible reflection close to L = 0 (Either a Bragg reflection or a CTR at L = 0 usually work fine.)
121
+
122
+ When the matrix is set correctly, the calculated CTR reflections (Enable View->CTR reflections) should match up with the ones in the data when you change the active image.
123
+ To integrate a stationary scan (i.e. for each image, find the intersection of the CTR with the image and integrate a ROI around it), use hklscan in the ROI integration tab on the left side. To visualize the ROI on the image, enable View-> show ROI. Lorentz correction is not yet automatically applied here! Setting a pixel mask works by using the mask tool at the top of the image view (it is the mask icon).
124
+
125
+
126
+ There is now a also a rocking scan integration feature, which usually gives better integrated CTR, but is not yet optimized for computation time currently takes a long time to compute. 
127
+
128
+
129
+ Examples
130
+ --------
131
+
132
+ Some examples of configuration files are provided with the
133
+ `source code <https://doi.org/10.5281/zenodo.12592485>`_.
134
+
135
+
136
+ License
137
+ -------
138
+
139
+ The source code of *orGUI* is licensed under the MIT license.
140
+
141
+ Citation
142
+ --------
143
+
144
+ *orGUI* releases can be cited via their DOI on Zenodo: |zenodo DOI|
145
+
146
+ .. |zenodo DOI| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.12592485.svg
147
+ :target: https://doi.org/10.5281/zenodo.12592485
orgui-1.0.1/README.rst ADDED
@@ -0,0 +1,107 @@
1
+
2
+ orGUI: Orientation and Integration with 2D detectors
3
+ ====================================================
4
+
5
+ .. |logo| image:: ./orgui/resources/icons/logo.svg
6
+ :height: 320px
7
+
8
+ |logo|
9
+
10
+ orGUI is a software that can be used to determine the orientation of single crystal samples in X-ray diffraction experiments
11
+ from the observation of few reflections on a large, statinary 2D detector.
12
+ The settings of a 4-circle sample positioning stage as used for surface X-ray diffraction can be calculated. 
13
+
14
+ Its primary usecase is High Energy Surface X-ray Diffraction (`HESXRD <https://doi.org/10.1126/science.1246834>`_) or Transmission Surface Diffraction (`TSD <https://doi.org/10.1021/acs.jpclett.7b00332>`_).
15
+
16
+ Intensity integration is possible along arbitrary directions in reciprocal space (in reciprocal lattice coordinates (*h k l*)). Stationary and rocking scans can be integrated.
17
+ In addition, the crystal orientation obtained by *orGUI* can be used for further processing with other software such as `binoculars <https://github.com/id03/binoculars>`_, which is described `here <https://doi.org/10.1107/S1600576715009607>`_.
18
+ Examples for the application of orGUI and binoculars for CTR data analysis is described in the Supporting Information of `this <https://doi.org/10.1002/anie.202304293>`__ paper or the Methods section of `this <https://doi.org/10.1038/s41929-020-0497-y>`__ paper.
19
+
20
+
21
+ Installation
22
+ ------------
23
+
24
+ To install orGUI (and all its dependencies), run:
25
+
26
+ .. code-block:: bash
27
+
28
+ pip install orGUI[full]
29
+
30
+ To install orGUI with a minimal set of dependencies, run:
31
+
32
+ .. code-block:: bash
33
+
34
+ pip install orGUI
35
+
36
+ Getting started
37
+ ---------------
38
+
39
+ *orGUI* can be started by the shell command `orGUI`. *orGUI* can also be started preconfigured with a configuration file `<configfile>` by typing
40
+
41
+ .. code-block:: bash
42
+
43
+ orGUI <configfile>
44
+
45
+ All configuration is accessible in the user interface in the menu `Config->Machine parameters` and `Config->Crystal parameters`.
46
+ Examples of configuration files are provided with the `source code <https://doi.org/10.5281/zenodo.12592485>`_.
47
+
48
+ *orGUI* is designed to handle data, which is saved in a `NEXUS <https://doi.org/10.1107/S1600576714027575>`_ format or a combination of `SPEC <https://certif.com/spec.html>`_ files and separately saved image files.
49
+ The file browser on the left side of orGUI shows the contents of the NEXUS or SPEC file, which typically contain multiple scans. Double clicking a scan in the file browser will open the specified scan.
50
+
51
+ Data is typically saved differently (i.e. counter names, image locations, etc.) at different beamlines. Backends for loading scan data currently only exists for ID31 at the ESRF and P21.2 at DESY.
52
+ Loading data from other beamlines requires writing a new backend, which handles the loading of the scan data. The backends are located in `orgui/backend` of the source directory.
53
+ Documentation about writing new backends will follow in a future release. Please create an issue on Github or write an Email for help on writing a new backend.
54
+
55
+ A simplistic backend for loading of bare image data without meta data information is available under `file->Generate scan from images`.
56
+
57
+
58
+ Documentation
59
+ -------------
60
+
61
+ A detailed documentation is not yet available, but will be provided in a future release.
62
+
63
+ .. |diffractometer| image:: ./orgui/resources/icons/diffractometer_v3.png
64
+ :height: 360px
65
+
66
+ |diffractometer|
67
+
68
+ orGUI uses the diffractometer convention by `Lohmeier & Vlieg 1993 <https://doi.org/10.1107/S0021889893004868>`_. However, the phi-circle rotates around the x-axis instead of the z-axis!. The azimuth angle in "machine parameters" rotates the whole diffractometer around the primary beam direction. Also :math:`$\theta = - \omega$`. (Since at ID31 the :math:`$\theta$` rotation is right-handed).
69
+ xyz in lab frame is: y along beam direction, z along direction defined by azimuth (when azimuth = 90°, z points upwards), x perpendicular to both. 
70
+ The detector geometry of orGUI is adapted from the commonly used python package `pyFAI <https://pyfai.readthedocs.io/en/stable/>`_, which enables comprehensive detector geometry calibration.
71
+ It is recommended to determine the position of the X-ray detector from the Debye-Scherrer rings of a X-ray diffraction calibration standard such as CeO2 with the `geometry calibration tools <https://pyfai.readthedocs.io/en/stable/usage/cookbook/calib-gui/index.html>`_ of pyFAI.
72
+ The resulting `poni` file can currently only be loaded in orGUI by setting the `poni` parameter in the `Machine` section of the orGUI config file to the poni file location. The orGUI config file must then be loaded.
73
+
74
+ Here is a simplistic description of the usual workflow for crystal truncation rod integration (a more complete manual will follow): 
75
+
76
+ For setting the orientation matrix, there are 2 methods available:
77
+
78
+ 1. Expert mode: This is in the menu Reciprocal Space -> Edit orientation matrix. This is more intended to be used if symmetries can be directly observed at specific angle settings and applies more to Transmission Diffraction (e.g. if you see that two Bragg reflections have identical intensities, a reference position can be obtained from that). This is not really extremely useful for Grazing incidence geometry since you have to think about what you are doing.
79
+
80
+ 2. Conventional setting of matrix using reference reflections (`Busing & Levy <https://doi.org/10.1107/S0365110X67000970>`_): The images and the window "Reciprocal space navigation" is used for that. Double clicking at any position in the image will set a red reference reflection at this specific image. The position of the marker on the image defines the scattering angles and the image number gives the sample rotation angle (i.e. theta) of the reference reflection. You can drag+drop the marker around in the image and the image number can be changed with the two buttons in the top right corner of the "Reciprocal space navigation" window (one button selects the current image for the chosen refllection; with the other you can jump to the image which was previously selected for the reflection). Usually the HKL values are wrong when you add a reflection. This can be overridden in the table in the Reciprocal space navigation window. To calculate the matrix click "calculate U". This function also works with only one reference reflection by assuming that the L axis is pointing towards the z/azimuth-direction (Enable View->machine parameters to display a marker at the z-direction). For other geometries you need at least 2 reference reflections. So what I ususally do is to search for a nicely visible reflection close to L = 0 (Either a Bragg reflection or a CTR at L = 0 usually work fine.)
81
+
82
+ When the matrix is set correctly, the calculated CTR reflections (Enable View->CTR reflections) should match up with the ones in the data when you change the active image.
83
+ To integrate a stationary scan (i.e. for each image, find the intersection of the CTR with the image and integrate a ROI around it), use hklscan in the ROI integration tab on the left side. To visualize the ROI on the image, enable View-> show ROI. Lorentz correction is not yet automatically applied here! Setting a pixel mask works by using the mask tool at the top of the image view (it is the mask icon).
84
+
85
+
86
+ There is now a also a rocking scan integration feature, which usually gives better integrated CTR, but is not yet optimized for computation time currently takes a long time to compute. 
87
+
88
+
89
+ Examples
90
+ --------
91
+
92
+ Some examples of configuration files are provided with the
93
+ `source code <https://doi.org/10.5281/zenodo.12592485>`_.
94
+
95
+
96
+ License
97
+ -------
98
+
99
+ The source code of *orGUI* is licensed under the MIT license.
100
+
101
+ Citation
102
+ --------
103
+
104
+ *orGUI* releases can be cited via their DOI on Zenodo: |zenodo DOI|
105
+
106
+ .. |zenodo DOI| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.12592485.svg
107
+ :target: https://doi.org/10.5281/zenodo.12592485
@@ -0,0 +1,147 @@
1
+ Metadata-Version: 2.1
2
+ Name: orGUI
3
+ Version: 1.0.1
4
+ Summary: orGUI: Orientation and Integration with 2D detectors
5
+ Author-email: Timo Fuchs <fuchs@physik.uni-kiel.de>
6
+ License: MIT License
7
+ Classifier: Development Status :: 5 - Production/Stable
8
+ Classifier: Environment :: Win32 (MS Windows)
9
+ Classifier: Environment :: X11 Applications :: Qt
10
+ Classifier: Intended Audience :: End Users/Desktop
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Operating System :: MacOS :: MacOS X
15
+ Classifier: Operating System :: Microsoft :: Windows
16
+ Classifier: Operating System :: POSIX
17
+ Classifier: Programming Language :: Python
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: Implementation :: CPython
20
+ Classifier: Topic :: Scientific/Engineering :: Chemistry
21
+ Classifier: Topic :: Scientific/Engineering :: Physics
22
+ Classifier: Topic :: Scientific/Engineering :: Visualization
23
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
+ Requires-Python: >=3.7
25
+ Description-Content-Type: text/x-rst
26
+ License-File: LICENSE
27
+ Requires-Dist: numpy>=1.12
28
+ Requires-Dist: scipy>=1.0
29
+ Requires-Dist: matplotlib>=1.2
30
+ Requires-Dist: fabio>=0.7
31
+ Requires-Dist: silx>=1.1
32
+ Requires-Dist: pyFAI>=0.19
33
+ Requires-Dist: pymca>=5.3
34
+ Requires-Dist: xraydb>=4.0
35
+ Requires-Dist: pytz>=2022
36
+ Provides-Extra: console
37
+ Requires-Dist: qtconsole; extra == "console"
38
+ Provides-Extra: speedup
39
+ Requires-Dist: numba; extra == "speedup"
40
+
41
+
42
+ orGUI: Orientation and Integration with 2D detectors
43
+ ====================================================
44
+
45
+ .. |logo| image:: ./orgui/resources/icons/logo.svg
46
+ :height: 320px
47
+
48
+ |logo|
49
+
50
+ orGUI is a software that can be used to determine the orientation of single crystal samples in X-ray diffraction experiments
51
+ from the observation of few reflections on a large, statinary 2D detector.
52
+ The settings of a 4-circle sample positioning stage as used for surface X-ray diffraction can be calculated. 
53
+
54
+ Its primary usecase is High Energy Surface X-ray Diffraction (`HESXRD <https://doi.org/10.1126/science.1246834>`_) or Transmission Surface Diffraction (`TSD <https://doi.org/10.1021/acs.jpclett.7b00332>`_).
55
+
56
+ Intensity integration is possible along arbitrary directions in reciprocal space (in reciprocal lattice coordinates (*h k l*)). Stationary and rocking scans can be integrated.
57
+ In addition, the crystal orientation obtained by *orGUI* can be used for further processing with other software such as `binoculars <https://github.com/id03/binoculars>`_, which is described `here <https://doi.org/10.1107/S1600576715009607>`_.
58
+ Examples for the application of orGUI and binoculars for CTR data analysis is described in the Supporting Information of `this <https://doi.org/10.1002/anie.202304293>`__ paper or the Methods section of `this <https://doi.org/10.1038/s41929-020-0497-y>`__ paper.
59
+
60
+
61
+ Installation
62
+ ------------
63
+
64
+ To install orGUI (and all its dependencies), run:
65
+
66
+ .. code-block:: bash
67
+
68
+ pip install orGUI[full]
69
+
70
+ To install orGUI with a minimal set of dependencies, run:
71
+
72
+ .. code-block:: bash
73
+
74
+ pip install orGUI
75
+
76
+ Getting started
77
+ ---------------
78
+
79
+ *orGUI* can be started by the shell command `orGUI`. *orGUI* can also be started preconfigured with a configuration file `<configfile>` by typing
80
+
81
+ .. code-block:: bash
82
+
83
+ orGUI <configfile>
84
+
85
+ All configuration is accessible in the user interface in the menu `Config->Machine parameters` and `Config->Crystal parameters`.
86
+ Examples of configuration files are provided with the `source code <https://doi.org/10.5281/zenodo.12592485>`_.
87
+
88
+ *orGUI* is designed to handle data, which is saved in a `NEXUS <https://doi.org/10.1107/S1600576714027575>`_ format or a combination of `SPEC <https://certif.com/spec.html>`_ files and separately saved image files.
89
+ The file browser on the left side of orGUI shows the contents of the NEXUS or SPEC file, which typically contain multiple scans. Double clicking a scan in the file browser will open the specified scan.
90
+
91
+ Data is typically saved differently (i.e. counter names, image locations, etc.) at different beamlines. Backends for loading scan data currently only exists for ID31 at the ESRF and P21.2 at DESY.
92
+ Loading data from other beamlines requires writing a new backend, which handles the loading of the scan data. The backends are located in `orgui/backend` of the source directory.
93
+ Documentation about writing new backends will follow in a future release. Please create an issue on Github or write an Email for help on writing a new backend.
94
+
95
+ A simplistic backend for loading of bare image data without meta data information is available under `file->Generate scan from images`.
96
+
97
+
98
+ Documentation
99
+ -------------
100
+
101
+ A detailed documentation is not yet available, but will be provided in a future release.
102
+
103
+ .. |diffractometer| image:: ./orgui/resources/icons/diffractometer_v3.png
104
+ :height: 360px
105
+
106
+ |diffractometer|
107
+
108
+ orGUI uses the diffractometer convention by `Lohmeier & Vlieg 1993 <https://doi.org/10.1107/S0021889893004868>`_. However, the phi-circle rotates around the x-axis instead of the z-axis!. The azimuth angle in "machine parameters" rotates the whole diffractometer around the primary beam direction. Also :math:`$\theta = - \omega$`. (Since at ID31 the :math:`$\theta$` rotation is right-handed).
109
+ xyz in lab frame is: y along beam direction, z along direction defined by azimuth (when azimuth = 90°, z points upwards), x perpendicular to both. 
110
+ The detector geometry of orGUI is adapted from the commonly used python package `pyFAI <https://pyfai.readthedocs.io/en/stable/>`_, which enables comprehensive detector geometry calibration.
111
+ It is recommended to determine the position of the X-ray detector from the Debye-Scherrer rings of a X-ray diffraction calibration standard such as CeO2 with the `geometry calibration tools <https://pyfai.readthedocs.io/en/stable/usage/cookbook/calib-gui/index.html>`_ of pyFAI.
112
+ The resulting `poni` file can currently only be loaded in orGUI by setting the `poni` parameter in the `Machine` section of the orGUI config file to the poni file location. The orGUI config file must then be loaded.
113
+
114
+ Here is a simplistic description of the usual workflow for crystal truncation rod integration (a more complete manual will follow): 
115
+
116
+ For setting the orientation matrix, there are 2 methods available:
117
+
118
+ 1. Expert mode: This is in the menu Reciprocal Space -> Edit orientation matrix. This is more intended to be used if symmetries can be directly observed at specific angle settings and applies more to Transmission Diffraction (e.g. if you see that two Bragg reflections have identical intensities, a reference position can be obtained from that). This is not really extremely useful for Grazing incidence geometry since you have to think about what you are doing.
119
+
120
+ 2. Conventional setting of matrix using reference reflections (`Busing & Levy <https://doi.org/10.1107/S0365110X67000970>`_): The images and the window "Reciprocal space navigation" is used for that. Double clicking at any position in the image will set a red reference reflection at this specific image. The position of the marker on the image defines the scattering angles and the image number gives the sample rotation angle (i.e. theta) of the reference reflection. You can drag+drop the marker around in the image and the image number can be changed with the two buttons in the top right corner of the "Reciprocal space navigation" window (one button selects the current image for the chosen refllection; with the other you can jump to the image which was previously selected for the reflection). Usually the HKL values are wrong when you add a reflection. This can be overridden in the table in the Reciprocal space navigation window. To calculate the matrix click "calculate U". This function also works with only one reference reflection by assuming that the L axis is pointing towards the z/azimuth-direction (Enable View->machine parameters to display a marker at the z-direction). For other geometries you need at least 2 reference reflections. So what I ususally do is to search for a nicely visible reflection close to L = 0 (Either a Bragg reflection or a CTR at L = 0 usually work fine.)
121
+
122
+ When the matrix is set correctly, the calculated CTR reflections (Enable View->CTR reflections) should match up with the ones in the data when you change the active image.
123
+ To integrate a stationary scan (i.e. for each image, find the intersection of the CTR with the image and integrate a ROI around it), use hklscan in the ROI integration tab on the left side. To visualize the ROI on the image, enable View-> show ROI. Lorentz correction is not yet automatically applied here! Setting a pixel mask works by using the mask tool at the top of the image view (it is the mask icon).
124
+
125
+
126
+ There is now a also a rocking scan integration feature, which usually gives better integrated CTR, but is not yet optimized for computation time currently takes a long time to compute. 
127
+
128
+
129
+ Examples
130
+ --------
131
+
132
+ Some examples of configuration files are provided with the
133
+ `source code <https://doi.org/10.5281/zenodo.12592485>`_.
134
+
135
+
136
+ License
137
+ -------
138
+
139
+ The source code of *orGUI* is licensed under the MIT license.
140
+
141
+ Citation
142
+ --------
143
+
144
+ *orGUI* releases can be cited via their DOI on Zenodo: |zenodo DOI|
145
+
146
+ .. |zenodo DOI| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.12592485.svg
147
+ :target: https://doi.org/10.5281/zenodo.12592485
@@ -0,0 +1,86 @@
1
+ LICENSE
2
+ README.rst
3
+ pyproject.toml
4
+ orGUI.egg-info/PKG-INFO
5
+ orGUI.egg-info/SOURCES.txt
6
+ orGUI.egg-info/dependency_links.txt
7
+ orGUI.egg-info/entry_points.txt
8
+ orGUI.egg-info/requires.txt
9
+ orGUI.egg-info/top_level.txt
10
+ orgui/__init__.py
11
+ orgui/main.py
12
+ orgui/app/ArrayTableDialog.py
13
+ orgui/app/QReflectionSelector.py
14
+ orgui/app/QScanSelector.py
15
+ orgui/app/QUBCalculator.py
16
+ orgui/app/__init__.py
17
+ orgui/app/database.py
18
+ orgui/app/orGUI.py
19
+ orgui/app/qutils.py
20
+ orgui/backend/__init__.py
21
+ orgui/backend/backends.py
22
+ orgui/backend/scans.py
23
+ orgui/backend/udefaults.py
24
+ orgui/backend/universalScanLoader.py
25
+ orgui/backend/beamline/ID31DiffractLinTilt.py
26
+ orgui/backend/beamline/P212_tools.py
27
+ orgui/backend/beamline/__init__.py
28
+ orgui/backend/beamline/fio_reader.py
29
+ orgui/backend/beamline/id31_tools.py
30
+ orgui/datautils/__init__.py
31
+ orgui/datautils/util.py
32
+ orgui/datautils/xrayutils/CTRcalc.py
33
+ orgui/datautils/xrayutils/CTRopt.py
34
+ orgui/datautils/xrayutils/CTRplotutil.py
35
+ orgui/datautils/xrayutils/DetectorCalibration.py
36
+ orgui/datautils/xrayutils/HKLVlieg.py
37
+ orgui/datautils/xrayutils/ReciprocalNavigation.py
38
+ orgui/datautils/xrayutils/_CTRcalc_accel.py
39
+ orgui/datautils/xrayutils/__init__.py
40
+ orgui/datautils/xrayutils/element_data.py
41
+ orgui/datautils/xrayutils/test/__init__.py
42
+ orgui/datautils/xrayutils/test/test_CTRcalc.py
43
+ orgui/datautils/xrayutils/test/test_DetectorCalibration.py
44
+ orgui/datautils/xrayutils/test/test_HKLcalc.py
45
+ orgui/datautils/xrayutils/unitcells/Fe3O4(100).bul
46
+ orgui/datautils/xrayutils/unitcells/Pt100.bul
47
+ orgui/datautils/xrayutils/unitcells/Pt100_small.bul
48
+ orgui/datautils/xrayutils/unitcells/Pt110.bul
49
+ orgui/datautils/xrayutils/unitcells/Pt111.bul
50
+ orgui/datautils/xrayutils/unitcells/Pt310.bul
51
+ orgui/datautils/xrayutils/unitcells/Pt3O4(100).bul
52
+ orgui/datautils/xrayutils/unitcells/PtO(001).bul
53
+ orgui/datautils/xrayutils/unitcells/PtO(010).bul
54
+ orgui/datautils/xrayutils/unitcells/PtO(100).bul
55
+ orgui/datautils/xrayutils/unitcells/__init__.py
56
+ orgui/datautils/xrayutils/unitcells/a-PtO2(0001).bul
57
+ orgui/resources/__init__.py
58
+ orgui/resources/icons/alpha.png
59
+ orgui/resources/icons/alpha.svg
60
+ orgui/resources/icons/diffractometer_v3.png
61
+ orgui/resources/icons/disable-image.png
62
+ orgui/resources/icons/disable-image.svg
63
+ orgui/resources/icons/document-nx-open.png
64
+ orgui/resources/icons/document-nx-open.svg
65
+ orgui/resources/icons/document-nx-save.png
66
+ orgui/resources/icons/document-nx-save.svg
67
+ orgui/resources/icons/logo.png
68
+ orgui/resources/icons/logo.svg
69
+ orgui/resources/icons/max_image.png
70
+ orgui/resources/icons/max_image.svg
71
+ orgui/resources/icons/max_image2.png
72
+ orgui/resources/icons/max_image2.svg
73
+ orgui/resources/icons/search-image.png
74
+ orgui/resources/icons/search-image.svg
75
+ orgui/resources/icons/search-reflection.png
76
+ orgui/resources/icons/search-reflection.svg
77
+ orgui/resources/icons/search.png
78
+ orgui/resources/icons/search.svg
79
+ orgui/resources/icons/select-image.png
80
+ orgui/resources/icons/select-image.svg
81
+ orgui/resources/icons/set-reflection.png
82
+ orgui/resources/icons/set-reflection.svg
83
+ orgui/resources/icons/sum_image.png
84
+ orgui/resources/icons/sum_image.svg
85
+ orgui/resources/icons/sum_image2.png
86
+ orgui/resources/icons/sum_image2.svg
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ orGUI = orgui.main:main
@@ -0,0 +1,15 @@
1
+ numpy>=1.12
2
+ scipy>=1.0
3
+ matplotlib>=1.2
4
+ fabio>=0.7
5
+ silx>=1.1
6
+ pyFAI>=0.19
7
+ pymca>=5.3
8
+ xraydb>=4.0
9
+ pytz>=2022
10
+
11
+ [console]
12
+ qtconsole
13
+
14
+ [speedup]
15
+ numba
@@ -0,0 +1 @@
1
+ orgui
@@ -0,0 +1,36 @@
1
+ # -*- coding: utf-8 -*-
2
+ # /*##########################################################################
3
+ #
4
+ # Copyright (c) 2020-2024 Timo Fuchs
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.
23
+ #
24
+ # ###########################################################################*/
25
+ """Module descripiton
26
+
27
+ """
28
+ __author__ = "Timo Fuchs"
29
+ __copyright__ = "Copyright 2020-2024 Timo Fuchs"
30
+ __credits__ = []
31
+ __license__ = "MIT License"
32
+ __version__ = "1.0.1"
33
+ __maintainer__ = "Timo Fuchs"
34
+ __email__ = "fuchs@physik.uni-kiel.de"
35
+
36
+ __all__ = ['main']