xrdPlanner 2.4.0__tar.gz → 2.4.2__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.
- {xrdplanner-2.4.0 → xrdplanner-2.4.2}/PKG-INFO +8 -4
- {xrdplanner-2.4.0 → xrdplanner-2.4.2}/README.md +5 -2
- {xrdplanner-2.4.0 → xrdplanner-2.4.2}/xrdPlanner/__init__.py +2 -2
- {xrdplanner-2.4.0 → xrdplanner-2.4.2}/xrdPlanner/classes.py +50 -33
- {xrdplanner-2.4.0 → xrdplanner-2.4.2}/xrdPlanner.egg-info/PKG-INFO +8 -4
- {xrdplanner-2.4.0 → xrdplanner-2.4.2}/LICENSE +0 -0
- {xrdplanner-2.4.0 → xrdplanner-2.4.2}/pyproject.toml +0 -0
- {xrdplanner-2.4.0 → xrdplanner-2.4.2}/setup.cfg +0 -0
- {xrdplanner-2.4.0 → xrdplanner-2.4.2}/xrdPlanner/resources.py +0 -0
- {xrdplanner-2.4.0 → xrdplanner-2.4.2}/xrdPlanner/run_xrdPlanner.py +0 -0
- {xrdplanner-2.4.0 → xrdplanner-2.4.2}/xrdPlanner.egg-info/SOURCES.txt +0 -0
- {xrdplanner-2.4.0 → xrdplanner-2.4.2}/xrdPlanner.egg-info/dependency_links.txt +0 -0
- {xrdplanner-2.4.0 → xrdplanner-2.4.2}/xrdPlanner.egg-info/entry_points.txt +0 -0
- {xrdplanner-2.4.0 → xrdplanner-2.4.2}/xrdPlanner.egg-info/requires.txt +0 -0
- {xrdplanner-2.4.0 → xrdplanner-2.4.2}/xrdPlanner.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: xrdPlanner
|
|
3
|
-
Version: 2.4.
|
|
3
|
+
Version: 2.4.2
|
|
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
|
|
@@ -19,9 +19,10 @@ Requires-Dist: pyqtgraph>=0.13
|
|
|
19
19
|
Requires-Dist: Dans_Diffraction>=2.2.3
|
|
20
20
|
Requires-Dist: PyQt6>=6.5
|
|
21
21
|
Requires-Dist: pyFAI>=2023.5
|
|
22
|
+
Dynamic: license-file
|
|
22
23
|
|
|
23
24
|
# xrdPlanner
|
|
24
|
-
## Version 2.4.
|
|
25
|
+
## Version 2.4.1 (released 05.03.2025)
|
|
25
26
|
#### A tool to project X-ray diffraction cones on a detector screen at different geometries (tilt, rotation, offset) and X-ray energies
|
|
26
27
|
- Article published in [_J. Synchrotron Rad._ (2024). **31**](https://doi.org/10.1107/S1600577523011086).
|
|
27
28
|
- Main application is to visualize the maximum achievable resolution at a given geometry.
|
|
@@ -121,7 +122,10 @@ where $SDD$ is the sample to detector distance.
|
|
|
121
122
|
> - A new parameter was added to allow for detector screen padding (plo.plot_padding), default is 0.
|
|
122
123
|
|
|
123
124
|
## Latest updates:
|
|
124
|
-
- 2025-03-
|
|
125
|
+
- 2025-03-05 Update: The slider values now accept input (thanks Clemens and Guðrún).
|
|
126
|
+
- 2025-03-05 Bugfix: Windows that allow typing will now disregard hotkeys.
|
|
127
|
+
- 2025-03-04 Update: Allowed smaller pixels in the detector-db editor (thanks tjalb).
|
|
128
|
+
- 2025-03-04 Update: Added pxrd ghost lines to play with and compare the scattering using different parameters (they are not perfect, don't scare them away!).
|
|
125
129
|
- 2025-03-04 Update: Made some improvements to the highlighting.
|
|
126
130
|
- 2025-03-04 Update: Trained most sub-windows to remember their place.
|
|
127
131
|
- 2025-03-04 Update: Started to declutter the code.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# xrdPlanner
|
|
2
|
-
## Version 2.4.
|
|
2
|
+
## Version 2.4.1 (released 05.03.2025)
|
|
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.
|
|
@@ -99,7 +99,10 @@ where $SDD$ is the sample to detector distance.
|
|
|
99
99
|
> - A new parameter was added to allow for detector screen padding (plo.plot_padding), default is 0.
|
|
100
100
|
|
|
101
101
|
## Latest updates:
|
|
102
|
-
- 2025-03-
|
|
102
|
+
- 2025-03-05 Update: The slider values now accept input (thanks Clemens and Guðrún).
|
|
103
|
+
- 2025-03-05 Bugfix: Windows that allow typing will now disregard hotkeys.
|
|
104
|
+
- 2025-03-04 Update: Allowed smaller pixels in the detector-db editor (thanks tjalb).
|
|
105
|
+
- 2025-03-04 Update: Added pxrd ghost lines to play with and compare the scattering using different parameters (they are not perfect, don't scare them away!).
|
|
103
106
|
- 2025-03-04 Update: Made some improvements to the highlighting.
|
|
104
107
|
- 2025-03-04 Update: Trained most sub-windows to remember their place.
|
|
105
108
|
- 2025-03-04 Update: Started to declutter the code.
|
|
@@ -15,8 +15,7 @@ import xrdPlanner.resources
|
|
|
15
15
|
# change pxrd scatterplot highlight to use dedicated highlighter (scatterplot)
|
|
16
16
|
# check what windows need update on theme change
|
|
17
17
|
# out-class pxrd window
|
|
18
|
-
|
|
19
|
-
# work out how to update fwhm window only in visible
|
|
18
|
+
# pxrd viewer prevent using 'd'?
|
|
20
19
|
|
|
21
20
|
# debug fn to show who is calling what and when to find out why.
|
|
22
21
|
#import inspect
|
|
@@ -35,7 +34,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
|
35
34
|
super().__init__(*args, **kwargs)
|
|
36
35
|
|
|
37
36
|
# set path home
|
|
38
|
-
self.path_home = os.path.dirname(__file__)
|
|
37
|
+
self.path_home = os.getenv('XRDPLANNER', os.path.dirname(__file__))
|
|
39
38
|
#self.setMouseTracking(True)
|
|
40
39
|
|
|
41
40
|
# enable antialiasing
|
|
@@ -164,13 +163,13 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
|
164
163
|
# initialize hotkey window
|
|
165
164
|
self.hotkeys_win = HotkeysWindow(parent=self)
|
|
166
165
|
# initialize detdb window
|
|
167
|
-
self.detdb_win = DetdbWindow(parent=self)
|
|
166
|
+
self.detdb_win = DetdbWindow(parent=self, hotkeys=False)
|
|
168
167
|
# initialize export window
|
|
169
|
-
self.export_win = ExportWindow(parent=self)
|
|
168
|
+
self.export_win = ExportWindow(parent=self, hotkeys=False)
|
|
170
169
|
# initialize fwhm parameter window
|
|
171
170
|
self.fwhm_win = FwhmWindow(parent=self)
|
|
172
171
|
# initialize unit cell window
|
|
173
|
-
self.uc_win = UnitCellWindow(parent=self)
|
|
172
|
+
self.uc_win = UnitCellWindow(parent=self, hotkeys=False)
|
|
174
173
|
# initialize absorption window
|
|
175
174
|
#self.abs_win = AbsorptionWindow(parent=self)
|
|
176
175
|
|
|
@@ -2596,10 +2595,10 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
|
2596
2595
|
'dc':'Change to sin(\u03B8)/\u03BB'},
|
|
2597
2596
|
|
|
2598
2597
|
('Label position'):None,
|
|
2599
|
-
('Up',
|
|
2600
|
-
|
|
2601
|
-
('Down',
|
|
2602
|
-
|
|
2598
|
+
('Up', 'SHIFT'): {'fn':(self.label_set_position, 'top'),
|
|
2599
|
+
'dc':'Top left'},
|
|
2600
|
+
('Down', 'SHIFT'):{'fn':(self.label_set_position, 'bottom'),
|
|
2601
|
+
'dc':'Bottom left'},
|
|
2603
2602
|
|
|
2604
2603
|
('Toggles'):None,
|
|
2605
2604
|
('P', None): {'fn':(self.toggle_overlay_polarisation, None),
|
|
@@ -2768,7 +2767,6 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
|
2768
2767
|
self.pxrd_line = pg.InfiniteLine(pos=0, angle=0, pen=pg.mkPen(None))
|
|
2769
2768
|
self.pxrd_plot.addItem(self.pxrd_line)
|
|
2770
2769
|
|
|
2771
|
-
|
|
2772
2770
|
self.pxrd_ghost_curves = [] # list to store ghost lines
|
|
2773
2771
|
self.pxrd_ghost_bank = [('blinky', '#fb0009'), ('pinky', '#fc60ff'), ('inky', '#22ffff'),
|
|
2774
2772
|
('clyde', '#f27a10'), ('sue', '#9208ff'), ('dinky', '#e1e1e1'),
|
|
@@ -3033,18 +3031,22 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
|
3033
3031
|
pxrd_ghost_bank (list): List to store removed ghost curves with their
|
|
3034
3032
|
name and pen color.
|
|
3035
3033
|
"""
|
|
3034
|
+
# find all invisible ghosts
|
|
3036
3035
|
remove_later = []
|
|
3037
3036
|
for ghost in self.pxrd_ghost_curves:
|
|
3038
3037
|
if not ghost.isVisible():
|
|
3039
3038
|
remove_later.append(ghost)
|
|
3039
|
+
# remove them, append to ghost bank
|
|
3040
3040
|
for ghost in remove_later:
|
|
3041
3041
|
self.pxrd_plot.getPlotItem().removeItem(ghost)
|
|
3042
3042
|
self.pxrd_ghost_curves.remove(ghost)
|
|
3043
3043
|
self.pxrd_ghost_bank.insert(0, (ghost.name(), ghost.opts['pen'].color().name()))
|
|
3044
|
+
# if nothing was flagged, remove the last, append to ghost bank
|
|
3044
3045
|
if len(remove_later) == 0 and len(self.pxrd_ghost_curves) > 0:
|
|
3045
3046
|
ghost = self.pxrd_ghost_curves[-1]
|
|
3046
3047
|
self.pxrd_plot.getPlotItem().removeItem(ghost)
|
|
3047
3048
|
self.pxrd_ghost_curves.remove(ghost)
|
|
3049
|
+
self.pxrd_ghost_bank.insert(0, (ghost.name(), ghost.opts['pen'].color().name()))
|
|
3048
3050
|
|
|
3049
3051
|
#######
|
|
3050
3052
|
# CIF #
|
|
@@ -4241,7 +4243,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
|
4241
4243
|
self.path_settings_current = os.path.join(self.path_settings, name)
|
|
4242
4244
|
self.settings_reload()
|
|
4243
4245
|
|
|
4244
|
-
def settings_import_win(self):
|
|
4246
|
+
def settings_import_win(self, fname=None):
|
|
4245
4247
|
"""
|
|
4246
4248
|
Opens a file dialog to import a settings file in JSON format. If a file is selected,
|
|
4247
4249
|
it copies the file to the settings folder, adds it to the custom settings menu,
|
|
@@ -4256,7 +4258,9 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
|
4256
4258
|
Returns:
|
|
4257
4259
|
None
|
|
4258
4260
|
"""
|
|
4259
|
-
fname
|
|
4261
|
+
if fname is None:
|
|
4262
|
+
fname, filter = QtWidgets.QFileDialog.getOpenFileName(self, 'Import settings file', '', "Settings files (*.json)")
|
|
4263
|
+
|
|
4260
4264
|
if fname:
|
|
4261
4265
|
# copy to settings folder
|
|
4262
4266
|
shutil.copy(fname, self.path_settings)
|
|
@@ -4335,8 +4339,12 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
|
4335
4339
|
None
|
|
4336
4340
|
"""
|
|
4337
4341
|
fpath = event.mimeData().urls()[0].toLocalFile()
|
|
4342
|
+
|
|
4338
4343
|
if os.path.splitext(fpath)[1] == '.cif':
|
|
4339
4344
|
self.calc_ref_from_cif(fpath, open_pxrd=True)
|
|
4345
|
+
|
|
4346
|
+
if os.path.splitext(fpath)[1] == '.json':
|
|
4347
|
+
self.settings_import_win(fname=fpath)
|
|
4340
4348
|
|
|
4341
4349
|
def keyReleaseEvent(self, event):
|
|
4342
4350
|
"""
|
|
@@ -4360,12 +4368,14 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
|
4360
4368
|
# set m to None if no modifier or only keypad modifier is pressed
|
|
4361
4369
|
if m == QtCore.Qt.KeyboardModifier.NoModifier or m == QtCore.Qt.KeyboardModifier.KeypadModifier:
|
|
4362
4370
|
m = None
|
|
4363
|
-
elif
|
|
4371
|
+
elif QtCore.Qt.KeyboardModifier.AltModifier in m:
|
|
4364
4372
|
m = 'ALT'
|
|
4365
|
-
elif
|
|
4373
|
+
elif QtCore.Qt.KeyboardModifier.ShiftModifier in m:
|
|
4366
4374
|
m = 'SHIFT'
|
|
4367
|
-
elif
|
|
4375
|
+
elif QtCore.Qt.KeyboardModifier.ControlModifier in m:
|
|
4368
4376
|
m = 'CTRL'
|
|
4377
|
+
else:
|
|
4378
|
+
print('Unrecognized modifier', m)
|
|
4369
4379
|
|
|
4370
4380
|
# check if key and modifier combination exists in hotkey_dict
|
|
4371
4381
|
k = QtGui.QKeySequence(k).toString()
|
|
@@ -4781,7 +4791,7 @@ class SliderWidget(QtWidgets.QFrame):
|
|
|
4781
4791
|
"""
|
|
4782
4792
|
self.move(int((self.parent().size().width()-self.box_width_dynamic)/2), self.parent().offset_win32)
|
|
4783
4793
|
|
|
4784
|
-
def
|
|
4794
|
+
def update_slider_value(self, label, value):
|
|
4785
4795
|
"""
|
|
4786
4796
|
Updates the text of a given label to reflect the provided slider value.
|
|
4787
4797
|
|
|
@@ -4792,7 +4802,8 @@ class SliderWidget(QtWidgets.QFrame):
|
|
|
4792
4802
|
Returns:
|
|
4793
4803
|
None
|
|
4794
4804
|
"""
|
|
4795
|
-
label.
|
|
4805
|
+
label.setValue(int(value))
|
|
4806
|
+
self.box_toggle = True
|
|
4796
4807
|
|
|
4797
4808
|
def update_slider_limits(self, slider, lmin, lmax):
|
|
4798
4809
|
"""
|
|
@@ -4823,10 +4834,10 @@ class SliderWidget(QtWidgets.QFrame):
|
|
|
4823
4834
|
font = QtGui.QFont()
|
|
4824
4835
|
font.setPixelSize(self.parent().plo.slider_label_size)
|
|
4825
4836
|
|
|
4826
|
-
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
|
|
4837
|
+
slider_name = QtWidgets.QLabel(label)
|
|
4838
|
+
slider_name.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
|
|
4839
|
+
slider_name.setFont(font)
|
|
4840
|
+
slider_name.setStyleSheet(f'''
|
|
4830
4841
|
QLabel {{
|
|
4831
4842
|
color: {self.parent().slider_label_color.name(format=QtGui.QColor.NameFormat.HexArgb)};
|
|
4832
4843
|
border: 0px solid none;
|
|
@@ -4834,11 +4845,13 @@ class SliderWidget(QtWidgets.QFrame):
|
|
|
4834
4845
|
}}
|
|
4835
4846
|
''')
|
|
4836
4847
|
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4848
|
+
slider_value = QtWidgets.QSpinBox()
|
|
4849
|
+
slider_value.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
|
|
4850
|
+
slider_value.setRange(int(lmin), int(lmax))
|
|
4851
|
+
slider_value.setButtonSymbols(QtWidgets.QAbstractSpinBox.ButtonSymbols.NoButtons)
|
|
4852
|
+
slider_value.setFont(font)
|
|
4853
|
+
slider_value.setValue(int(lval))
|
|
4854
|
+
slider_value.setStyleSheet(f'''
|
|
4842
4855
|
QLabel {{
|
|
4843
4856
|
color: {self.parent().slider_label_color.name(format=QtGui.QColor.NameFormat.HexArgb)};
|
|
4844
4857
|
border: 0px solid transparent;
|
|
@@ -4851,14 +4864,16 @@ class SliderWidget(QtWidgets.QFrame):
|
|
|
4851
4864
|
slider.setSingleStep(int(lstp))
|
|
4852
4865
|
slider.setPageStep(int(lstp))
|
|
4853
4866
|
slider.setValue(int(lval))
|
|
4867
|
+
|
|
4854
4868
|
slider.valueChanged.connect(self.parent().update_screen)
|
|
4855
|
-
slider.valueChanged.connect(lambda value: self.
|
|
4869
|
+
slider.valueChanged.connect(lambda value: self.update_slider_value(slider_value, value))
|
|
4870
|
+
slider_value.valueChanged.connect(lambda value: self.update_slider_value(slider, value))
|
|
4856
4871
|
|
|
4857
|
-
layout.addWidget(
|
|
4872
|
+
layout.addWidget(slider_name, 0, idx, QtCore.Qt.AlignmentFlag.AlignCenter)
|
|
4858
4873
|
layout.addWidget(slider, 1, idx, QtCore.Qt.AlignmentFlag.AlignHCenter)
|
|
4859
|
-
layout.addWidget(
|
|
4874
|
+
layout.addWidget(slider_value, 2, idx, QtCore.Qt.AlignmentFlag.AlignCenter)
|
|
4860
4875
|
|
|
4861
|
-
return slider#(slider,
|
|
4876
|
+
return slider#(slider, slider_name, slider_value)
|
|
4862
4877
|
|
|
4863
4878
|
def toggle_panel(self, event):
|
|
4864
4879
|
"""
|
|
@@ -4989,7 +5004,7 @@ class HotkeyDialog(QtWidgets.QDialog):
|
|
|
4989
5004
|
**kwargs: Arbitrary keyword arguments.
|
|
4990
5005
|
"""
|
|
4991
5006
|
super().__init__(parent)
|
|
4992
|
-
|
|
5007
|
+
self.hotkeys = kwargs.get('hotkeys', True)
|
|
4993
5008
|
self.setWindowFlags(QtCore.Qt.WindowType.Dialog)
|
|
4994
5009
|
#self.setWindowFlags(QtCore.Qt.WindowType.Tool)
|
|
4995
5010
|
#self.setWindowModality(QtCore.Qt.WindowModality.NonModal)
|
|
@@ -5023,7 +5038,9 @@ class HotkeyDialog(QtWidgets.QDialog):
|
|
|
5023
5038
|
pressed key is the Escape key. If the Escape key is pressed, the widget
|
|
5024
5039
|
will be closed.
|
|
5025
5040
|
"""
|
|
5026
|
-
self.
|
|
5041
|
+
if self.hotkeys:
|
|
5042
|
+
self.parent().keyReleaseEvent(event)
|
|
5043
|
+
|
|
5027
5044
|
k = event.key()
|
|
5028
5045
|
if k == QtCore.Qt.Key.Key_Escape:
|
|
5029
5046
|
self.close()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: xrdPlanner
|
|
3
|
-
Version: 2.4.
|
|
3
|
+
Version: 2.4.2
|
|
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
|
|
@@ -19,9 +19,10 @@ Requires-Dist: pyqtgraph>=0.13
|
|
|
19
19
|
Requires-Dist: Dans_Diffraction>=2.2.3
|
|
20
20
|
Requires-Dist: PyQt6>=6.5
|
|
21
21
|
Requires-Dist: pyFAI>=2023.5
|
|
22
|
+
Dynamic: license-file
|
|
22
23
|
|
|
23
24
|
# xrdPlanner
|
|
24
|
-
## Version 2.4.
|
|
25
|
+
## Version 2.4.1 (released 05.03.2025)
|
|
25
26
|
#### A tool to project X-ray diffraction cones on a detector screen at different geometries (tilt, rotation, offset) and X-ray energies
|
|
26
27
|
- Article published in [_J. Synchrotron Rad._ (2024). **31**](https://doi.org/10.1107/S1600577523011086).
|
|
27
28
|
- Main application is to visualize the maximum achievable resolution at a given geometry.
|
|
@@ -121,7 +122,10 @@ where $SDD$ is the sample to detector distance.
|
|
|
121
122
|
> - A new parameter was added to allow for detector screen padding (plo.plot_padding), default is 0.
|
|
122
123
|
|
|
123
124
|
## Latest updates:
|
|
124
|
-
- 2025-03-
|
|
125
|
+
- 2025-03-05 Update: The slider values now accept input (thanks Clemens and Guðrún).
|
|
126
|
+
- 2025-03-05 Bugfix: Windows that allow typing will now disregard hotkeys.
|
|
127
|
+
- 2025-03-04 Update: Allowed smaller pixels in the detector-db editor (thanks tjalb).
|
|
128
|
+
- 2025-03-04 Update: Added pxrd ghost lines to play with and compare the scattering using different parameters (they are not perfect, don't scare them away!).
|
|
125
129
|
- 2025-03-04 Update: Made some improvements to the highlighting.
|
|
126
130
|
- 2025-03-04 Update: Trained most sub-windows to remember their place.
|
|
127
131
|
- 2025-03-04 Update: Started to declutter the code.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|