xrdPlanner 2.4.2__tar.gz → 2.5.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xrdPlanner
3
- Version: 2.4.2
3
+ Version: 2.5.3
4
4
  Summary: A tool to project X-ray diffraction cones on a detector screen at different geometries (tilt, rotation, offset) and X-ray energies
5
5
  Author-email: Lennard Krause <lkrause@chem.au.dk>
6
6
  Project-URL: Homepage, https://github.com/LennardKrause/xrdPlanner
@@ -18,11 +18,11 @@ Requires-Dist: numpy>=1.24
18
18
  Requires-Dist: pyqtgraph>=0.13
19
19
  Requires-Dist: Dans_Diffraction>=2.2.3
20
20
  Requires-Dist: PyQt6>=6.5
21
- Requires-Dist: pyFAI>=2023.5
21
+ Requires-Dist: xraydb>=4.5.8
22
22
  Dynamic: license-file
23
23
 
24
24
  # xrdPlanner
25
- ## Version 2.4.1 (released 05.03.2025)
25
+ ## Version 2.5.3 (released 15.10.2026)
26
26
  #### A tool to project X-ray diffraction cones on a detector screen at different geometries (tilt, rotation, offset) and X-ray energies
27
27
  - Article published in [_J. Synchrotron Rad._ (2024). **31**](https://doi.org/10.1107/S1600577523011086).
28
28
  - Main application is to visualize the maximum achievable resolution at a given geometry.
@@ -34,7 +34,7 @@ Dynamic: license-file
34
34
  - The math used is not meant to bring people to the moon but to provide a quick and simple preview.
35
35
  - This is not meant to accurately simulate a diffraction experiment, the step sizes are integer values in mm or degrees.
36
36
  - The module building code is designed for [Dectris](https://www.dectris.com) [PILATUS3](https://www.dectris.com/detectors/x-ray-detectors/pilatus3/) / [EIGER2](https://www.dectris.com/detectors/x-ray-detectors/eiger2/) or [SACLA](https://sacla.xfel.jp/?lang=en) MPCCD Detectors (central hole geometry) but one-module systems like the [Bruker](https://www.bruker.com/en.html) [Photon II](https://www.bruker.com/en/products-and-solutions/diffractometers-and-scattering-systems/single-crystal-x-ray-diffractometers/sc-xrd-components/detectors.html) and [Rayonix](https://www.rayonix.com/) [MX-HS](https://www.rayonix.com/rayonix-mx-hs-series/) are possible as well.
37
- - It uses [python3](https://www.python.org), [numpy](https://numpy.org), [pyqt6](https://www.riverbankcomputing.com/software/pyqt/), [pyqtgraph](https://pyqtgraph.readthedocs.io/en/latest/), [pyFAI](https://pyfai.readthedocs.io/en/v2023.1/) and [Dans_Diffraction](https://github.com/DanPorter/Dans_Diffraction).
37
+ - It uses [python3](https://www.python.org), [numpy](https://numpy.org), [pyqt6](https://www.riverbankcomputing.com/software/pyqt/), [pyqtgraph](https://pyqtgraph.readthedocs.io/en/latest/), [xraydb](https://github.com/xraypy/XrayDB), [Dans_Diffraction](https://github.com/DanPorter/Dans_Diffraction) and [pyFAI](https://pyfai.readthedocs.io/en/v2023.1/) (optional).
38
38
 
39
39
  >[!TIP]
40
40
  >## Short how-to:
@@ -42,13 +42,15 @@ Dynamic: license-file
42
42
  > - Type _xrdPlanner_ in a terminal and hit enter.
43
43
  > - Choose a detector and a model from the _Detector_ menu.
44
44
  > - Plot diffraction cone contours:
45
- > - Pick a reference from the _Reference_ menu ([pyFAI](https://pyfai.readthedocs.io/en/v2023.1/)), no hkl tooltip available.
45
+ > - Pick a reference from the _Reference_ menu ([pyFAI](https://pyfai.readthedocs.io/en/v2023.1/)), if available.
46
46
  > - Drop a .cif file onto the window ([Dans_Diffraction](https://github.com/DanPorter/Dans_Diffraction)), click a contour to get a hkl tooltip.
47
47
  > - Enter custom unit cell dimensions, click a contour to get a hkl tooltip.
48
48
  > - Use the units from the _Units_ menu you are the most comfortable with.
49
49
  > - Hover over the grey line at the top to show the sliders. Click it to make it stay open.
50
50
  > - Drag the sliders to change energy and geometry.
51
51
  > - Use [hotkeys](#hotkeys) to streamline your experience.
52
+ > - Check out the [PXRD plot window](#pxrd-pattern-plot) and set the [intrumental peak broadening](#instrumental-broadening).
53
+ > - Have a look at the [absorption](#absorption-transmission-and-fluorescence) spectrum of the sample and check the fluorescence.
52
54
  >
53
55
  >## Customisation:
54
56
  > - Use the [export window](#export-window) from the settings menu.
@@ -66,6 +68,9 @@ Dynamic: license-file
66
68
  > - Download a settings file from here (e.g. settings/DanMAX.json).
67
69
  > - Use the import settings function from the GUI to import.
68
70
 
71
+ >[!NOTE]
72
+ > - Set the environmental variable 'XRDPLANNER' to specify the settings file directory.
73
+
69
74
  ## Conventions
70
75
  The geometry is defined with the center of rotation at the sample position, such that the radius of the rotation circle is equal to the sample to detector distance (SDD). That is, the rotation moves the detector along the goniometer circle, keeping the point of normal incidence (PONI) at the same position relative to the detector surface. At 0° the detector is vertical and at 90° the detector is horizontal with the detector normal pointing down.
71
76
  The tilt angle is defined relative to the detector face and such that the PONI shifts along the detector face, keeping the SDD fixed. The detector face is thus always tangential to the goniometer circle. The $tilt$ can intuitively be described as a rolling motion along the goniometer circle and is considered a convenience function as it is equivalent to a combination of $rotation$ and $y_{offset}$. Consequently, the vertical shift of the PONI position ($\Delta y_{PONI}$) on the detector face is equal to the arclength of a section on the goniometer circle with an angular span equal to the tilt angle.
@@ -111,17 +116,19 @@ S_{ij} = \left(\frac{|\vec{v}_{ij}|}{SDD}\right)^{-3}
111
116
  ```
112
117
  where $SDD$ is the sample to detector distance.
113
118
 
114
- >[!NOTE]
115
- >## Update to Version 2.0.0 and later (released 23.09.2024)
116
- > - The definition of detector modules was changed from mm to px to be more accurate and consistent.
117
- > - Consequently, custom detectors added to the detector_db file pre 2.0.0 are no longer working.
118
- > - A new [detector db editor](#detector-db-editor) was added (_Settings_ > _Detector db editor_) to make the addition of custom detectors more feasible.
119
- > - Define and add whatever detector you collect your data with, now more easily.
120
- > - If something goes wrong use _Settings_ > _Reset detector db_.
121
- > - There is a backup of your _custom_ detector_db (detector_db.json.bak) in the xrdPlanner folder (_Help_ > _xrdPlanner_).
122
- > - A new parameter was added to allow for detector screen padding (plo.plot_padding), default is 0.
123
-
124
119
  ## Latest updates:
120
+ - 2026-10-15 Bugfix: Fixed a bug on windows to get the username.
121
+ - 2026-10-15 Update: Change the way references are handled internally.
122
+ - 2026-10-13 Update: Added a new limit variable to determine the detector energy threshold settings (PILATUS, EIGER, ...).
123
+ - 2026-10-13 Bugfix: Fixed a bug in the variable range startup check.
124
+ - 2026-10-12 Update: Added a correction factor to calculate the instrumental FWHM (effective sample diameter).
125
+ - 2026-10-12 Update: Added the environmental variable 'XRDPLANNER' to specify the settings file directory.
126
+ - 2026-10-12 Update: Added the effective sample to detector distance (D) to the hover overlay.
127
+ - 2026-10-12 Update: Added a new window to show the [absorption](#absorption-transmission-and-fluorescence) spectrum of the cif file (requires xraydb).
128
+ - 2026-10-12 Update: pyFAI is now optional (calibrants are only available if pyFAI is installed).
129
+ - 2025-04-01 Update: Settings files (.json) can now be dropped on the window.
130
+ - 2025-04-01 Update: The pxrd ghosts stay a little longer now.
131
+ - 2025-04-01 Update: Added the option to set the environmental variable 'XRDPLANNER' to specify the xrdPlanner home path.
125
132
  - 2025-03-05 Update: The slider values now accept input (thanks Clemens and Guðrún).
126
133
  - 2025-03-05 Bugfix: Windows that allow typing will now disregard hotkeys.
127
134
  - 2025-03-04 Update: Allowed smaller pixels in the detector-db editor (thanks tjalb).
@@ -241,12 +248,17 @@ where $SDD$ is the sample to detector distance.
241
248
  - Estimated beam divergence
242
249
  - Expected bandwidth of the incident X-ray beam
243
250
  - Intersection of the sample size and the beam size as the diameter
251
+ - Added a correction factor of 2/3 to the sample diameter to reflect the average distance from any point on a disc to the center of the disc.
244
252
 
245
253
  > **The interested user is referred to the article:<br>**
246
254
  > <i>On the resolution function for powder diffraction with area detectors</i><br>
247
255
  > [D. Chernyshov <i> et al., Acta Cryst.</i> (2021). <b>A77</b>, 497-505](https://doi.org/10.1107/S2053273321007506)
248
256
  <img src="https://github.com/LennardKrause/xrdPlanner/blob/main/examples/Figure_6_FWHM.png" width="50%">
249
257
 
258
+ #### Absorption, transmission and fluorescence
259
+ ##### Display the X-ray absorption spectra and analyse the sample transmission and fluorescence emission bands of the current cif file.
260
+ <img src="https://github.com/LennardKrause/xrdPlanner/blob/main/examples/Figure_7_Abs.png" width="50%">
261
+
250
262
  ## Hotkeys
251
263
 
252
264
  | Key | Action |
@@ -255,6 +267,7 @@ where $SDD$ is the sample to detector distance.
255
267
  | F2 | Show Geometry conventions |
256
268
  | F3 | Show Hotkeys |
257
269
  | x | Show PXRD pattern |
270
+ | b | Show Absorption window |
258
271
  | f | Show FWHM window |
259
272
  | # | *Display units* |
260
273
  | t | 2-Theta |
@@ -453,6 +466,8 @@ where $SDD$ is the sample to detector distance.
453
466
  bsdx_min = 5 # [int] Beamstop distance minimum [mm]
454
467
  bsdx_max = 1000 # [int] Beamstop distance maximum [mm]
455
468
  bsdx_stp = 1 # [int] Beamstop distance step size [mm]
469
+
470
+ det_thrs = 0.5 # [float] Detector threshold [frac]
456
471
 
457
472
  </details>
458
473
 
@@ -1,5 +1,5 @@
1
1
  # xrdPlanner
2
- ## Version 2.4.1 (released 05.03.2025)
2
+ ## Version 2.5.3 (released 15.10.2026)
3
3
  #### A tool to project X-ray diffraction cones on a detector screen at different geometries (tilt, rotation, offset) and X-ray energies
4
4
  - Article published in [_J. Synchrotron Rad._ (2024). **31**](https://doi.org/10.1107/S1600577523011086).
5
5
  - Main application is to visualize the maximum achievable resolution at a given geometry.
@@ -11,7 +11,7 @@
11
11
  - The math used is not meant to bring people to the moon but to provide a quick and simple preview.
12
12
  - This is not meant to accurately simulate a diffraction experiment, the step sizes are integer values in mm or degrees.
13
13
  - The module building code is designed for [Dectris](https://www.dectris.com) [PILATUS3](https://www.dectris.com/detectors/x-ray-detectors/pilatus3/) / [EIGER2](https://www.dectris.com/detectors/x-ray-detectors/eiger2/) or [SACLA](https://sacla.xfel.jp/?lang=en) MPCCD Detectors (central hole geometry) but one-module systems like the [Bruker](https://www.bruker.com/en.html) [Photon II](https://www.bruker.com/en/products-and-solutions/diffractometers-and-scattering-systems/single-crystal-x-ray-diffractometers/sc-xrd-components/detectors.html) and [Rayonix](https://www.rayonix.com/) [MX-HS](https://www.rayonix.com/rayonix-mx-hs-series/) are possible as well.
14
- - It uses [python3](https://www.python.org), [numpy](https://numpy.org), [pyqt6](https://www.riverbankcomputing.com/software/pyqt/), [pyqtgraph](https://pyqtgraph.readthedocs.io/en/latest/), [pyFAI](https://pyfai.readthedocs.io/en/v2023.1/) and [Dans_Diffraction](https://github.com/DanPorter/Dans_Diffraction).
14
+ - It uses [python3](https://www.python.org), [numpy](https://numpy.org), [pyqt6](https://www.riverbankcomputing.com/software/pyqt/), [pyqtgraph](https://pyqtgraph.readthedocs.io/en/latest/), [xraydb](https://github.com/xraypy/XrayDB), [Dans_Diffraction](https://github.com/DanPorter/Dans_Diffraction) and [pyFAI](https://pyfai.readthedocs.io/en/v2023.1/) (optional).
15
15
 
16
16
  >[!TIP]
17
17
  >## Short how-to:
@@ -19,13 +19,15 @@
19
19
  > - Type _xrdPlanner_ in a terminal and hit enter.
20
20
  > - Choose a detector and a model from the _Detector_ menu.
21
21
  > - Plot diffraction cone contours:
22
- > - Pick a reference from the _Reference_ menu ([pyFAI](https://pyfai.readthedocs.io/en/v2023.1/)), no hkl tooltip available.
22
+ > - Pick a reference from the _Reference_ menu ([pyFAI](https://pyfai.readthedocs.io/en/v2023.1/)), if available.
23
23
  > - Drop a .cif file onto the window ([Dans_Diffraction](https://github.com/DanPorter/Dans_Diffraction)), click a contour to get a hkl tooltip.
24
24
  > - Enter custom unit cell dimensions, click a contour to get a hkl tooltip.
25
25
  > - Use the units from the _Units_ menu you are the most comfortable with.
26
26
  > - Hover over the grey line at the top to show the sliders. Click it to make it stay open.
27
27
  > - Drag the sliders to change energy and geometry.
28
28
  > - Use [hotkeys](#hotkeys) to streamline your experience.
29
+ > - Check out the [PXRD plot window](#pxrd-pattern-plot) and set the [intrumental peak broadening](#instrumental-broadening).
30
+ > - Have a look at the [absorption](#absorption-transmission-and-fluorescence) spectrum of the sample and check the fluorescence.
29
31
  >
30
32
  >## Customisation:
31
33
  > - Use the [export window](#export-window) from the settings menu.
@@ -43,6 +45,9 @@
43
45
  > - Download a settings file from here (e.g. settings/DanMAX.json).
44
46
  > - Use the import settings function from the GUI to import.
45
47
 
48
+ >[!NOTE]
49
+ > - Set the environmental variable 'XRDPLANNER' to specify the settings file directory.
50
+
46
51
  ## Conventions
47
52
  The geometry is defined with the center of rotation at the sample position, such that the radius of the rotation circle is equal to the sample to detector distance (SDD). That is, the rotation moves the detector along the goniometer circle, keeping the point of normal incidence (PONI) at the same position relative to the detector surface. At 0° the detector is vertical and at 90° the detector is horizontal with the detector normal pointing down.
48
53
  The tilt angle is defined relative to the detector face and such that the PONI shifts along the detector face, keeping the SDD fixed. The detector face is thus always tangential to the goniometer circle. The $tilt$ can intuitively be described as a rolling motion along the goniometer circle and is considered a convenience function as it is equivalent to a combination of $rotation$ and $y_{offset}$. Consequently, the vertical shift of the PONI position ($\Delta y_{PONI}$) on the detector face is equal to the arclength of a section on the goniometer circle with an angular span equal to the tilt angle.
@@ -88,17 +93,19 @@ S_{ij} = \left(\frac{|\vec{v}_{ij}|}{SDD}\right)^{-3}
88
93
  ```
89
94
  where $SDD$ is the sample to detector distance.
90
95
 
91
- >[!NOTE]
92
- >## Update to Version 2.0.0 and later (released 23.09.2024)
93
- > - The definition of detector modules was changed from mm to px to be more accurate and consistent.
94
- > - Consequently, custom detectors added to the detector_db file pre 2.0.0 are no longer working.
95
- > - A new [detector db editor](#detector-db-editor) was added (_Settings_ > _Detector db editor_) to make the addition of custom detectors more feasible.
96
- > - Define and add whatever detector you collect your data with, now more easily.
97
- > - If something goes wrong use _Settings_ > _Reset detector db_.
98
- > - There is a backup of your _custom_ detector_db (detector_db.json.bak) in the xrdPlanner folder (_Help_ > _xrdPlanner_).
99
- > - A new parameter was added to allow for detector screen padding (plo.plot_padding), default is 0.
100
-
101
96
  ## Latest updates:
97
+ - 2026-10-15 Bugfix: Fixed a bug on windows to get the username.
98
+ - 2026-10-15 Update: Change the way references are handled internally.
99
+ - 2026-10-13 Update: Added a new limit variable to determine the detector energy threshold settings (PILATUS, EIGER, ...).
100
+ - 2026-10-13 Bugfix: Fixed a bug in the variable range startup check.
101
+ - 2026-10-12 Update: Added a correction factor to calculate the instrumental FWHM (effective sample diameter).
102
+ - 2026-10-12 Update: Added the environmental variable 'XRDPLANNER' to specify the settings file directory.
103
+ - 2026-10-12 Update: Added the effective sample to detector distance (D) to the hover overlay.
104
+ - 2026-10-12 Update: Added a new window to show the [absorption](#absorption-transmission-and-fluorescence) spectrum of the cif file (requires xraydb).
105
+ - 2026-10-12 Update: pyFAI is now optional (calibrants are only available if pyFAI is installed).
106
+ - 2025-04-01 Update: Settings files (.json) can now be dropped on the window.
107
+ - 2025-04-01 Update: The pxrd ghosts stay a little longer now.
108
+ - 2025-04-01 Update: Added the option to set the environmental variable 'XRDPLANNER' to specify the xrdPlanner home path.
102
109
  - 2025-03-05 Update: The slider values now accept input (thanks Clemens and Guðrún).
103
110
  - 2025-03-05 Bugfix: Windows that allow typing will now disregard hotkeys.
104
111
  - 2025-03-04 Update: Allowed smaller pixels in the detector-db editor (thanks tjalb).
@@ -218,12 +225,17 @@ where $SDD$ is the sample to detector distance.
218
225
  - Estimated beam divergence
219
226
  - Expected bandwidth of the incident X-ray beam
220
227
  - Intersection of the sample size and the beam size as the diameter
228
+ - Added a correction factor of 2/3 to the sample diameter to reflect the average distance from any point on a disc to the center of the disc.
221
229
 
222
230
  > **The interested user is referred to the article:<br>**
223
231
  > <i>On the resolution function for powder diffraction with area detectors</i><br>
224
232
  > [D. Chernyshov <i> et al., Acta Cryst.</i> (2021). <b>A77</b>, 497-505](https://doi.org/10.1107/S2053273321007506)
225
233
  <img src="https://github.com/LennardKrause/xrdPlanner/blob/main/examples/Figure_6_FWHM.png" width="50%">
226
234
 
235
+ #### Absorption, transmission and fluorescence
236
+ ##### Display the X-ray absorption spectra and analyse the sample transmission and fluorescence emission bands of the current cif file.
237
+ <img src="https://github.com/LennardKrause/xrdPlanner/blob/main/examples/Figure_7_Abs.png" width="50%">
238
+
227
239
  ## Hotkeys
228
240
 
229
241
  | Key | Action |
@@ -232,6 +244,7 @@ where $SDD$ is the sample to detector distance.
232
244
  | F2 | Show Geometry conventions |
233
245
  | F3 | Show Hotkeys |
234
246
  | x | Show PXRD pattern |
247
+ | b | Show Absorption window |
235
248
  | f | Show FWHM window |
236
249
  | # | *Display units* |
237
250
  | t | 2-Theta |
@@ -430,6 +443,8 @@ where $SDD$ is the sample to detector distance.
430
443
  bsdx_min = 5 # [int] Beamstop distance minimum [mm]
431
444
  bsdx_max = 1000 # [int] Beamstop distance maximum [mm]
432
445
  bsdx_stp = 1 # [int] Beamstop distance step size [mm]
446
+
447
+ det_thrs = 0.5 # [float] Detector threshold [frac]
433
448
 
434
449
  </details>
435
450
 
@@ -11,7 +11,7 @@ dependencies = ["numpy >= 1.24",
11
11
  "pyqtgraph >= 0.13",
12
12
  "Dans_Diffraction >= 2.2.3",
13
13
  "PyQt6 >= 6.5",
14
- "pyFAI >= 2023.5",
14
+ "xraydb >= 4.5.8",
15
15
  ]
16
16
  classifiers = [
17
17
  "Programming Language :: Python :: 3",
@@ -1,6 +1,6 @@
1
- __version__ = '2.4.2'
1
+ __version__ = '2.5.3'
2
2
  __author__ = 'Lennard Krause'
3
3
  __authors__ = ['Lennard Krause', 'Frederik H. Gjørup', 'Mads R. V. Jørgensen']
4
4
  __email__ = 'lkrause@chem.au.dk'
5
- __date__ = '01.04.2025'
6
- __year__ = '2025'
5
+ __date__ = '15.10.2026'
6
+ __year__ = '2026'