advisor-scattering 0.5.2__py3-none-any.whl → 0.5.3__py3-none-any.whl
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.
- advisor/features/scattering_geometry/domain/brillouin_calculator.py +121 -63
- advisor/features/scattering_geometry/domain/core.py +187 -134
- advisor/features/scattering_geometry/ui/components/hk_angles_components.py +175 -79
- advisor/features/scattering_geometry/ui/components/hkl_scan_components.py +42 -17
- advisor/features/scattering_geometry/ui/components/hkl_to_angles_components.py +175 -79
- advisor/features/scattering_geometry/ui/scattering_geometry_tab.py +57 -48
- {advisor_scattering-0.5.2.dist-info → advisor_scattering-0.5.3.dist-info}/METADATA +4 -12
- {advisor_scattering-0.5.2.dist-info → advisor_scattering-0.5.3.dist-info}/RECORD +11 -11
- {advisor_scattering-0.5.2.dist-info → advisor_scattering-0.5.3.dist-info}/WHEEL +1 -1
- {advisor_scattering-0.5.2.dist-info → advisor_scattering-0.5.3.dist-info}/entry_points.txt +0 -0
- {advisor_scattering-0.5.2.dist-info → advisor_scattering-0.5.3.dist-info}/top_level.txt +0 -0
|
@@ -15,9 +15,12 @@ from PyQt5.QtWidgets import (
|
|
|
15
15
|
QHeaderView,
|
|
16
16
|
QRadioButton,
|
|
17
17
|
QButtonGroup,
|
|
18
|
+
QDialog,
|
|
19
|
+
QScrollArea,
|
|
20
|
+
QFrame,
|
|
18
21
|
)
|
|
19
22
|
from PyQt5.QtCore import Qt, pyqtSignal
|
|
20
|
-
from PyQt5.QtGui import QColor, QBrush
|
|
23
|
+
from PyQt5.QtGui import QColor, QBrush, QFont
|
|
21
24
|
class HKLToAnglesControls(QWidget):
|
|
22
25
|
"""Widget for HKL to Angles calculation controls."""
|
|
23
26
|
|
|
@@ -208,83 +211,102 @@ class HKLToAnglesControls(QWidget):
|
|
|
208
211
|
self.L_input.setValue(L)
|
|
209
212
|
|
|
210
213
|
|
|
211
|
-
class
|
|
212
|
-
"""
|
|
214
|
+
class HistoryDialog(QDialog):
|
|
215
|
+
"""Dialog to display history of all calculation results."""
|
|
213
216
|
|
|
214
|
-
|
|
215
|
-
solutionSelected = pyqtSignal(dict)
|
|
216
|
-
|
|
217
|
-
def __init__(self, parent=None):
|
|
217
|
+
def __init__(self, history, parent=None):
|
|
218
218
|
super().__init__(parent)
|
|
219
|
-
|
|
220
|
-
self.
|
|
221
|
-
|
|
222
|
-
self
|
|
223
|
-
|
|
224
|
-
#
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
219
|
+
self.setWindowTitle("Calculation History")
|
|
220
|
+
self.setMinimumSize(600, 400)
|
|
221
|
+
|
|
222
|
+
layout = QVBoxLayout(self)
|
|
223
|
+
|
|
224
|
+
# Create scroll area
|
|
225
|
+
scroll = QScrollArea()
|
|
226
|
+
scroll.setWidgetResizable(True)
|
|
227
|
+
scroll_content = QWidget()
|
|
228
|
+
scroll_layout = QVBoxLayout(scroll_content)
|
|
229
|
+
|
|
230
|
+
if not history:
|
|
231
|
+
no_history_label = QLabel("No history available.")
|
|
232
|
+
no_history_label.setAlignment(Qt.AlignCenter)
|
|
233
|
+
scroll_layout.addWidget(no_history_label)
|
|
234
|
+
else:
|
|
235
|
+
# Display history in reverse order (newest first)
|
|
236
|
+
for run_idx, entry in enumerate(reversed(history)):
|
|
237
|
+
run_num = len(history) - run_idx
|
|
238
|
+
run_frame = QFrame()
|
|
239
|
+
run_frame.setFrameStyle(QFrame.StyledPanel | QFrame.Raised)
|
|
240
|
+
run_layout = QVBoxLayout(run_frame)
|
|
241
|
+
|
|
242
|
+
# Header with HKL values
|
|
243
|
+
header_label = QLabel(f"Run #{run_num}: H={entry['H']:.4f}, K={entry['K']:.4f}, L={entry['L']:.4f}")
|
|
244
|
+
header_font = QFont()
|
|
245
|
+
header_font.setBold(True)
|
|
246
|
+
header_label.setFont(header_font)
|
|
247
|
+
run_layout.addWidget(header_label)
|
|
248
|
+
|
|
249
|
+
# Number of solutions
|
|
250
|
+
num_solutions = entry.get('number_of_solutions', 1)
|
|
251
|
+
solutions_label = QLabel(f"Solutions found: {num_solutions}")
|
|
252
|
+
run_layout.addWidget(solutions_label)
|
|
253
|
+
|
|
254
|
+
# Create table for solutions
|
|
255
|
+
table = QTableWidget()
|
|
256
|
+
table.setColumnCount(5)
|
|
257
|
+
table.setHorizontalHeaderLabels(["#", "tth (°)", "θ (°)", "φ (°)", "χ (°)"])
|
|
258
|
+
table.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch)
|
|
259
|
+
table.verticalHeader().setVisible(False)
|
|
260
|
+
table.setMaximumHeight(100)
|
|
261
|
+
|
|
262
|
+
# Add rows for each solution
|
|
263
|
+
tth_list = entry.get('tth', [])
|
|
264
|
+
theta_list = entry.get('theta', [])
|
|
265
|
+
phi_list = entry.get('phi', [])
|
|
266
|
+
chi_list = entry.get('chi', [])
|
|
267
|
+
feasible_list = entry.get('feasible', [])
|
|
268
|
+
|
|
269
|
+
for i in range(len(tth_list)):
|
|
270
|
+
table.insertRow(i)
|
|
271
|
+
table.setItem(i, 0, QTableWidgetItem(f"{i + 1}"))
|
|
272
|
+
table.setItem(i, 1, QTableWidgetItem(f"{tth_list[i]:.2f}"))
|
|
273
|
+
table.setItem(i, 2, QTableWidgetItem(f"{theta_list[i]:.2f}"))
|
|
274
|
+
table.setItem(i, 3, QTableWidgetItem(f"{phi_list[i]:.2f}"))
|
|
275
|
+
table.setItem(i, 4, QTableWidgetItem(f"{chi_list[i]:.2f}"))
|
|
276
|
+
|
|
277
|
+
# Color based on feasibility
|
|
278
|
+
feasible = feasible_list[i] if i < len(feasible_list) else True
|
|
279
|
+
color = QColor(198, 239, 206) if feasible else QColor(255, 199, 206)
|
|
280
|
+
for col in range(5):
|
|
281
|
+
item = table.item(i, col)
|
|
282
|
+
if item:
|
|
283
|
+
item.setBackground(QBrush(color))
|
|
284
|
+
|
|
285
|
+
run_layout.addWidget(table)
|
|
286
|
+
scroll_layout.addWidget(run_frame)
|
|
287
|
+
|
|
288
|
+
scroll_layout.addStretch()
|
|
289
|
+
scroll.setWidget(scroll_content)
|
|
290
|
+
layout.addWidget(scroll)
|
|
291
|
+
|
|
292
|
+
# Close button
|
|
293
|
+
close_btn = QPushButton("Close")
|
|
294
|
+
close_btn.clicked.connect(self.accept)
|
|
295
|
+
layout.addWidget(close_btn)
|
|
278
296
|
|
|
279
297
|
|
|
280
298
|
class HKLToAnglesResultsWidget(QWidget):
|
|
281
|
-
"""
|
|
299
|
+
"""Results widget showing current solutions and history button."""
|
|
282
300
|
|
|
283
301
|
# Signal emitted when a solution is selected
|
|
284
302
|
solutionSelected = pyqtSignal(dict)
|
|
285
303
|
|
|
286
304
|
def __init__(self, parent=None):
|
|
287
305
|
super().__init__(parent)
|
|
306
|
+
|
|
307
|
+
# Store history of all results
|
|
308
|
+
self.history = []
|
|
309
|
+
self.current_result = None
|
|
288
310
|
|
|
289
311
|
# Main layout
|
|
290
312
|
layout = QVBoxLayout(self)
|
|
@@ -293,23 +315,97 @@ class HKLToAnglesResultsWidget(QWidget):
|
|
|
293
315
|
results_group = QGroupBox("Results")
|
|
294
316
|
results_layout = QVBoxLayout(results_group)
|
|
295
317
|
|
|
296
|
-
#
|
|
297
|
-
self.
|
|
298
|
-
self.
|
|
318
|
+
# Number of solutions label
|
|
319
|
+
self.solutions_label = QLabel("No results yet")
|
|
320
|
+
self.solutions_label.setAlignment(Qt.AlignCenter)
|
|
321
|
+
results_layout.addWidget(self.solutions_label)
|
|
322
|
+
|
|
323
|
+
# Current solutions display (table for up to 2 solutions)
|
|
324
|
+
self.results_table = QTableWidget()
|
|
325
|
+
self.results_table.setColumnCount(4)
|
|
326
|
+
self.results_table.setHorizontalHeaderLabels(["tth (°)", "θ (°)", "φ (°)", "χ (°)"])
|
|
327
|
+
self.results_table.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch)
|
|
328
|
+
self.results_table.verticalHeader().setVisible(False)
|
|
329
|
+
self.results_table.setMaximumHeight(90)
|
|
330
|
+
self.results_table.itemSelectionChanged.connect(self._on_selection_changed)
|
|
299
331
|
results_layout.addWidget(self.results_table)
|
|
300
332
|
|
|
301
|
-
#
|
|
302
|
-
self.
|
|
303
|
-
self.
|
|
304
|
-
self.
|
|
305
|
-
results_layout.addWidget(self.
|
|
333
|
+
# Show history button
|
|
334
|
+
self.history_button = QPushButton("Show History")
|
|
335
|
+
self.history_button.clicked.connect(self._show_history)
|
|
336
|
+
self.history_button.setObjectName("historyButton")
|
|
337
|
+
results_layout.addWidget(self.history_button)
|
|
306
338
|
|
|
307
339
|
layout.addWidget(results_group)
|
|
308
340
|
|
|
309
341
|
def display_results(self, results):
|
|
310
|
-
"""Display calculation results."""
|
|
311
|
-
|
|
342
|
+
"""Display current calculation results and add to history."""
|
|
343
|
+
if not results or not results.get("success", False):
|
|
344
|
+
return
|
|
345
|
+
|
|
346
|
+
self.current_result = results
|
|
347
|
+
|
|
348
|
+
# Add to history
|
|
349
|
+
self.history.append(results)
|
|
350
|
+
|
|
351
|
+
# Update solutions label
|
|
352
|
+
num_solutions = results.get('number_of_solutions', 1)
|
|
353
|
+
self.solutions_label.setText(f"Found {num_solutions} solution(s)")
|
|
354
|
+
|
|
355
|
+
# Clear and populate table
|
|
356
|
+
self.results_table.setRowCount(0)
|
|
357
|
+
|
|
358
|
+
tth_list = results.get('tth', [])
|
|
359
|
+
theta_list = results.get('theta', [])
|
|
360
|
+
phi_list = results.get('phi', [])
|
|
361
|
+
chi_list = results.get('chi', [])
|
|
362
|
+
feasible_list = results.get('feasible', [])
|
|
363
|
+
|
|
364
|
+
for i in range(len(tth_list)):
|
|
365
|
+
row = self.results_table.rowCount()
|
|
366
|
+
self.results_table.insertRow(row)
|
|
367
|
+
|
|
368
|
+
self.results_table.setItem(row, 0, QTableWidgetItem(f"{tth_list[i]:.2f}"))
|
|
369
|
+
self.results_table.setItem(row, 1, QTableWidgetItem(f"{theta_list[i]:.2f}"))
|
|
370
|
+
self.results_table.setItem(row, 2, QTableWidgetItem(f"{phi_list[i]:.2f}"))
|
|
371
|
+
self.results_table.setItem(row, 3, QTableWidgetItem(f"{chi_list[i]:.2f}"))
|
|
372
|
+
|
|
373
|
+
# Color based on feasibility
|
|
374
|
+
feasible = feasible_list[i] if i < len(feasible_list) else True
|
|
375
|
+
color = QColor(198, 239, 206) if feasible else QColor(255, 199, 206)
|
|
376
|
+
for col in range(4):
|
|
377
|
+
item = self.results_table.item(row, col)
|
|
378
|
+
if item:
|
|
379
|
+
item.setBackground(QBrush(color))
|
|
380
|
+
|
|
381
|
+
def _on_selection_changed(self):
|
|
382
|
+
"""Handle selection change in the table."""
|
|
383
|
+
current_row = self.results_table.currentRow()
|
|
384
|
+
if current_row >= 0 and self.current_result:
|
|
385
|
+
tth_list = self.current_result.get('tth', [])
|
|
386
|
+
theta_list = self.current_result.get('theta', [])
|
|
387
|
+
phi_list = self.current_result.get('phi', [])
|
|
388
|
+
chi_list = self.current_result.get('chi', [])
|
|
389
|
+
|
|
390
|
+
if current_row < len(tth_list):
|
|
391
|
+
selected_solution = {
|
|
392
|
+
'tth': tth_list[current_row],
|
|
393
|
+
'theta': theta_list[current_row],
|
|
394
|
+
'phi': phi_list[current_row],
|
|
395
|
+
'chi': chi_list[current_row],
|
|
396
|
+
'H': self.current_result.get('H'),
|
|
397
|
+
'K': self.current_result.get('K'),
|
|
398
|
+
'L': self.current_result.get('L'),
|
|
399
|
+
}
|
|
400
|
+
self.solutionSelected.emit(selected_solution)
|
|
401
|
+
|
|
402
|
+
def _show_history(self):
|
|
403
|
+
"""Show history dialog."""
|
|
404
|
+
dialog = HistoryDialog(self.history, self)
|
|
405
|
+
dialog.exec_()
|
|
312
406
|
|
|
313
407
|
def clear_results(self):
|
|
314
|
-
"""Clear
|
|
315
|
-
self.results_table.
|
|
408
|
+
"""Clear current results (but keep history)."""
|
|
409
|
+
self.results_table.setRowCount(0)
|
|
410
|
+
self.solutions_label.setText("No results yet")
|
|
411
|
+
self.current_result = None
|
|
@@ -2,52 +2,30 @@
|
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
# pylint: disable=no-name-in-module, import-error
|
|
4
4
|
import matplotlib
|
|
5
|
-
from PyQt5.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
QDoubleSpinBox,
|
|
14
|
-
QGroupBox,
|
|
15
|
-
QRadioButton,
|
|
16
|
-
QButtonGroup,
|
|
17
|
-
QFileDialog,
|
|
18
|
-
QMessageBox,
|
|
19
|
-
QComboBox,
|
|
20
|
-
QVBoxLayout,
|
|
21
|
-
QHBoxLayout,
|
|
22
|
-
QTableWidget,
|
|
23
|
-
QTableWidgetItem,
|
|
24
|
-
QHeaderView,
|
|
25
|
-
QFrame,
|
|
26
|
-
)
|
|
27
|
-
from PyQt5.QtCore import Qt, pyqtSlot, QMimeData
|
|
28
|
-
from PyQt5.QtGui import QDragEnterEvent, QDropEvent, QFont, QColor, QBrush
|
|
5
|
+
from PyQt5.QtCore import QMimeData, Qt, pyqtSlot
|
|
6
|
+
from PyQt5.QtGui import QBrush, QColor, QDragEnterEvent, QDropEvent, QFont
|
|
7
|
+
from PyQt5.QtWidgets import (QButtonGroup, QComboBox, QDoubleSpinBox,
|
|
8
|
+
QFileDialog, QFormLayout, QFrame, QGridLayout,
|
|
9
|
+
QGroupBox, QHBoxLayout, QHeaderView, QLabel,
|
|
10
|
+
QLineEdit, QMessageBox, QPushButton, QRadioButton,
|
|
11
|
+
QTableWidget, QTableWidgetItem, QTabWidget,
|
|
12
|
+
QVBoxLayout, QWidget)
|
|
29
13
|
|
|
30
14
|
# Tell matplotlib to render plots using the Qt5 framework with the Agg backend for drawing
|
|
31
15
|
matplotlib.use("Qt5Agg")
|
|
32
16
|
|
|
33
17
|
from advisor.features.scattering_geometry.domain import BrillouinCalculator
|
|
34
18
|
from advisor.ui.tab_interface import TabInterface
|
|
35
|
-
from advisor.ui.visualizers import (
|
|
36
|
-
ScatteringVisualizer,
|
|
37
|
-
UnitcellVisualizer,
|
|
38
|
-
HKLScan2DVisualizer,
|
|
39
|
-
)
|
|
40
19
|
from advisor.ui.tips import Tips, set_tip
|
|
41
|
-
from .
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
)
|
|
20
|
+
from advisor.ui.visualizers import (HKLScan2DVisualizer, ScatteringVisualizer,
|
|
21
|
+
UnitcellVisualizer)
|
|
22
|
+
|
|
23
|
+
from .components import (AnglesToHKLControls, AnglesToHKLResults,
|
|
24
|
+
HKAnglesControls, HKAnglesResultsWidget,
|
|
25
|
+
HKLScanControls, HKLScanResultsTable,
|
|
26
|
+
HKLToAnglesControls, HKLToAnglesResultsWidget)
|
|
27
|
+
|
|
28
|
+
|
|
51
29
|
class DragDropLineEdit(QLineEdit):
|
|
52
30
|
"""Custom QLineEdit that accepts drag and drop events."""
|
|
53
31
|
|
|
@@ -288,8 +266,8 @@ class ScatteringGeometryTab(TabInterface):
|
|
|
288
266
|
right_layout.addWidget(self.angles_to_hkl_unitcell_viz)
|
|
289
267
|
|
|
290
268
|
# Add columns to main layout
|
|
291
|
-
angles_layout.addWidget(left_column,
|
|
292
|
-
angles_layout.addWidget(right_column,
|
|
269
|
+
angles_layout.addWidget(left_column, 2) # Left column takes 1 part
|
|
270
|
+
angles_layout.addWidget(right_column, 3) # Right column takes 1.5 parts
|
|
293
271
|
|
|
294
272
|
# Add to tab widget
|
|
295
273
|
self.tab_widget.addTab(angles_tab, "Angles → HKL")
|
|
@@ -391,6 +369,17 @@ class ScatteringGeometryTab(TabInterface):
|
|
|
391
369
|
self.hkl_scan_results_table = HKLScanResultsTable(parent=self)
|
|
392
370
|
results_layout.addWidget(self.hkl_scan_results_table, 1)
|
|
393
371
|
|
|
372
|
+
# Reminder notes below results table
|
|
373
|
+
notes_layout = QVBoxLayout()
|
|
374
|
+
notes_layout.setSpacing(2)
|
|
375
|
+
note1 = QLabel("Note: Each HKL point may have up to two solutions.")
|
|
376
|
+
note1.setStyleSheet("color: gray; font-size: 11px; font-style: italic;")
|
|
377
|
+
note2 = QLabel("Some HKL points may be unreachable due to the momentum transfer limit at current energy.")
|
|
378
|
+
note2.setStyleSheet("color: gray; font-size: 11px; font-style: italic;")
|
|
379
|
+
notes_layout.addWidget(note1)
|
|
380
|
+
notes_layout.addWidget(note2)
|
|
381
|
+
results_layout.addLayout(notes_layout)
|
|
382
|
+
|
|
394
383
|
# 2D visualizer section
|
|
395
384
|
self.hkl_scan_visualizer = HKLScan2DVisualizer(parent=self)
|
|
396
385
|
results_layout.addWidget(self.hkl_scan_visualizer, 1)
|
|
@@ -567,16 +556,27 @@ class ScatteringGeometryTab(TabInterface):
|
|
|
567
556
|
)
|
|
568
557
|
return
|
|
569
558
|
self.hkl_to_angles_results.display_results(result)
|
|
559
|
+
|
|
570
560
|
# Update visualization with the first solution
|
|
561
|
+
# Extract first solution for visualization
|
|
562
|
+
first_solution = {
|
|
563
|
+
"tth": result["tth"][0],
|
|
564
|
+
"theta": result["theta"][0],
|
|
565
|
+
"phi": result["phi"][0],
|
|
566
|
+
"chi": result["chi"][0],
|
|
567
|
+
"H": result["H"],
|
|
568
|
+
"K": result["K"],
|
|
569
|
+
"L": result["L"],
|
|
570
|
+
}
|
|
571
571
|
self.hkl_to_angles_visualizer.visualize_lab_system(
|
|
572
|
-
is_clear=True, chi=
|
|
572
|
+
is_clear=True, chi=first_solution["chi"], phi=first_solution["phi"], plot_basis=False, plot_k_basis=True
|
|
573
573
|
)
|
|
574
574
|
self.hkl_to_angles_visualizer.visualize_scattering_geometry(
|
|
575
|
-
scattering_angles=
|
|
575
|
+
scattering_angles=first_solution, is_clear=False
|
|
576
576
|
)
|
|
577
577
|
self.hkl_to_angles_unitcell_viz.visualize_unitcell()
|
|
578
578
|
self.hkl_to_angles_unitcell_viz.visualize_scattering_geometry(
|
|
579
|
-
scattering_angles=
|
|
579
|
+
scattering_angles=first_solution
|
|
580
580
|
)
|
|
581
581
|
@pyqtSlot()
|
|
582
582
|
def calculate_angles_tth_fixed(self):
|
|
@@ -610,7 +610,6 @@ class ScatteringGeometryTab(TabInterface):
|
|
|
610
610
|
fixed_angle_name=fixed_angle_name,
|
|
611
611
|
fixed_angle=fixed_angle_value,
|
|
612
612
|
)
|
|
613
|
-
print("result", result)
|
|
614
613
|
if not result["success"]:
|
|
615
614
|
QMessageBox.warning(
|
|
616
615
|
self, "Warning", result.get("error", "No solution found")
|
|
@@ -619,15 +618,25 @@ class ScatteringGeometryTab(TabInterface):
|
|
|
619
618
|
self.hk_angles_results.display_results(result)
|
|
620
619
|
|
|
621
620
|
# Update visualization with the first solution
|
|
621
|
+
# Extract first solution for visualization
|
|
622
|
+
first_solution = {
|
|
623
|
+
"tth": result["tth"][0],
|
|
624
|
+
"theta": result["theta"][0],
|
|
625
|
+
"phi": result["phi"][0],
|
|
626
|
+
"chi": result["chi"][0],
|
|
627
|
+
"H": result["H"],
|
|
628
|
+
"K": result["K"],
|
|
629
|
+
"L": result["L"],
|
|
630
|
+
}
|
|
622
631
|
self.hk_fixed_tth_visualizer.visualize_lab_system(
|
|
623
|
-
is_clear=True, chi=
|
|
632
|
+
is_clear=True, chi=first_solution["chi"], phi=first_solution["phi"], plot_basis=False, plot_k_basis=True
|
|
624
633
|
)
|
|
625
634
|
self.hk_fixed_tth_visualizer.visualize_scattering_geometry(
|
|
626
|
-
scattering_angles=
|
|
635
|
+
scattering_angles=first_solution, is_clear=False
|
|
627
636
|
)
|
|
628
637
|
self.hk_fixed_tth_unitcell_viz.visualize_unitcell()
|
|
629
638
|
self.hk_fixed_tth_unitcell_viz.visualize_scattering_geometry(
|
|
630
|
-
scattering_angles=
|
|
639
|
+
scattering_angles=first_solution
|
|
631
640
|
)
|
|
632
641
|
@pyqtSlot()
|
|
633
642
|
def on_angle_solution_selected(self, solution):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: advisor-scattering
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.3
|
|
4
4
|
Summary: Advisor-Scattering: Advanced Visual X-ray Scattering Toolkit for Reciprocal-space visualization and calculation
|
|
5
5
|
Author: Xunyang Hong
|
|
6
6
|
License: MIT
|
|
@@ -42,25 +42,17 @@ or use the link below to view the demo video.
|
|
|
42
42
|
## Install
|
|
43
43
|
- Python 3.8+ with PyQt5, numpy, scipy, matplotlib, Dans_Diffraction (see `requirements.txt`).
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
It is recommened to install from PyPI:
|
|
46
46
|
```bash
|
|
47
47
|
pip install advisor-scattering
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
From source:
|
|
51
|
-
```bash
|
|
52
|
-
python -m venv .venv
|
|
53
|
-
source .venv/bin/activate # .venv\Scripts\activate on Windows
|
|
54
|
-
pip install -r requirements.txt
|
|
55
|
-
pip install .
|
|
56
|
-
```
|
|
57
|
-
|
|
58
50
|
## Run
|
|
59
51
|
```bash
|
|
60
|
-
advisor-scattering
|
|
61
|
-
# or
|
|
62
52
|
advisor
|
|
63
53
|
# or
|
|
54
|
+
advisor-scattering
|
|
55
|
+
# or
|
|
64
56
|
python -m advisor
|
|
65
57
|
```
|
|
66
58
|
|
|
@@ -15,15 +15,15 @@ advisor/features/__init__.py,sha256=wQYN67pLXVgxmsoG70WJ51BnE9ACUgbpx-G740KHsEA,
|
|
|
15
15
|
advisor/features/scattering_geometry/controllers/__init__.py,sha256=2V9KZMlxjHpsBIdkphveylQgL9z6BV09DaufqQcLX_Y,169
|
|
16
16
|
advisor/features/scattering_geometry/controllers/scattering_geometry_controller.py,sha256=QGcm5_y8EPNYUF_FM9xViVzPJs6qh1dB_OA3fjoKAEg,1076
|
|
17
17
|
advisor/features/scattering_geometry/domain/__init__.py,sha256=BsK0j9-RJiK0-g0qB3DH8qoSqlEZNAPBQb7eXYrg0oU,142
|
|
18
|
-
advisor/features/scattering_geometry/domain/brillouin_calculator.py,sha256=
|
|
19
|
-
advisor/features/scattering_geometry/domain/core.py,sha256=
|
|
18
|
+
advisor/features/scattering_geometry/domain/brillouin_calculator.py,sha256=_vpR8T1j1h-agZOlxk4xfpBq1XmbrZsssgookIqYwr0,15620
|
|
19
|
+
advisor/features/scattering_geometry/domain/core.py,sha256=OQ7gZ19XwZPtC3mXukkzlmOiDmgjvKBrVzRNJRi1OuU,20149
|
|
20
20
|
advisor/features/scattering_geometry/ui/__init__.py,sha256=9Lm-sc1Q3KeQ-0kKJneD10MWuqyDgh29QDAVdHghh1Q,154
|
|
21
|
-
advisor/features/scattering_geometry/ui/scattering_geometry_tab.py,sha256=
|
|
21
|
+
advisor/features/scattering_geometry/ui/scattering_geometry_tab.py,sha256=GHczdi74GxCxo3svF7oBdXrbTilLZ4ODkTuatJrfTkE,29448
|
|
22
22
|
advisor/features/scattering_geometry/ui/components/__init__.py,sha256=OsX27CeUv5gznYXmkZWqeXwcskf4DmxOH6xJ0-cUwDg,358
|
|
23
23
|
advisor/features/scattering_geometry/ui/components/angles_to_hkl_components.py,sha256=l6kPM7b95nvNsp1Eg0kmWIfFPTtmuGQyDol_mnx7lOs,4889
|
|
24
|
-
advisor/features/scattering_geometry/ui/components/hk_angles_components.py,sha256=
|
|
25
|
-
advisor/features/scattering_geometry/ui/components/hkl_scan_components.py,sha256=
|
|
26
|
-
advisor/features/scattering_geometry/ui/components/hkl_to_angles_components.py,sha256=
|
|
24
|
+
advisor/features/scattering_geometry/ui/components/hk_angles_components.py,sha256=ZkzRASVeII5dF5_WfwmVBrRwYWTCDNvE05VNa6idxGo,20538
|
|
25
|
+
advisor/features/scattering_geometry/ui/components/hkl_scan_components.py,sha256=JLzbkK1zM8CZm2WZvDyRg-Twwmt46KNKGr1DG7MPfXs,20522
|
|
26
|
+
advisor/features/scattering_geometry/ui/components/hkl_to_angles_components.py,sha256=0J-CXiBCTOoLjFK5-PgY0PjZSG1aU7sYrE-MilJSAEA,15834
|
|
27
27
|
advisor/features/structure_factor/controllers/__init__.py,sha256=aGyA8cXJ64HfULWo6_6D4azt4Hs8qJ6wH_OW6BClv9Y,158
|
|
28
28
|
advisor/features/structure_factor/controllers/structure_factor_controller.py,sha256=4PBHg8lPXcQA7Tpocu3A3GzGQP2IZP8CNPH6PILHyWw,975
|
|
29
29
|
advisor/features/structure_factor/domain/__init__.py,sha256=lNxY4RcTYCSboXpAWJfib29WqYg6o4jesbNk-Z279rU,159
|
|
@@ -62,8 +62,8 @@ advisor/ui/visualizers/scattering_visualizer.py,sha256=iyjTgy1WbqI7G0BpiJ59CKFCI
|
|
|
62
62
|
advisor/ui/visualizers/structure_factor_visualizer.py,sha256=Rt9ui7Qv4vvDCWiuIngoYzHJlFVef8M_h3BBRcmuFTc,15866
|
|
63
63
|
advisor/ui/visualizers/structure_factor_visualizer_2d.py,sha256=xA1hrp7pKIfgD1G_Pt-uemHggmKf-7QC94dS-GasZI4,8119
|
|
64
64
|
advisor/ui/visualizers/unitcell_visualizer.py,sha256=gwpMkU1YIu-8zkKVu5bHpyu_iLbzYEYTbVArchNMLOI,21384
|
|
65
|
-
advisor_scattering-0.5.
|
|
66
|
-
advisor_scattering-0.5.
|
|
67
|
-
advisor_scattering-0.5.
|
|
68
|
-
advisor_scattering-0.5.
|
|
69
|
-
advisor_scattering-0.5.
|
|
65
|
+
advisor_scattering-0.5.3.dist-info/METADATA,sha256=flwNil7WdTQXXr4pfw32egU2fBC6B7ewfvzcwMLH1Fg,4658
|
|
66
|
+
advisor_scattering-0.5.3.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
67
|
+
advisor_scattering-0.5.3.dist-info/entry_points.txt,sha256=b__0W6TTAPUTc0UIUyHdxvxtsVz025Y-QNrMKzt8b9o,83
|
|
68
|
+
advisor_scattering-0.5.3.dist-info/top_level.txt,sha256=4YoJT7oclQ2yU-4KY0AB36cfAZG9yAI1tJNHrxEioMA,8
|
|
69
|
+
advisor_scattering-0.5.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|