pyTEMlib 0.2020.11.0__py3-none-any.whl → 0.2024.8.4__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.
Potentially problematic release.
This version of pyTEMlib might be problematic. Click here for more details.
- pyTEMlib/__init__.py +11 -11
- pyTEMlib/animation.py +631 -0
- pyTEMlib/atom_tools.py +240 -222
- pyTEMlib/config_dir.py +57 -29
- pyTEMlib/core_loss_widget.py +658 -0
- pyTEMlib/crystal_tools.py +1255 -0
- pyTEMlib/diffraction_plot.py +756 -0
- pyTEMlib/dynamic_scattering.py +293 -0
- pyTEMlib/eds_tools.py +609 -0
- pyTEMlib/eels_dialog.py +749 -486
- pyTEMlib/{interactive_eels.py → eels_dialog_utilities.py} +1199 -1524
- pyTEMlib/eels_tools.py +2031 -1731
- pyTEMlib/file_tools.py +1276 -491
- pyTEMlib/file_tools_qt.py +193 -0
- pyTEMlib/graph_tools.py +1166 -450
- pyTEMlib/graph_viz.py +449 -0
- pyTEMlib/image_dialog.py +158 -0
- pyTEMlib/image_dlg.py +146 -0
- pyTEMlib/image_tools.py +1399 -956
- pyTEMlib/info_widget.py +933 -0
- pyTEMlib/interactive_image.py +1 -0
- pyTEMlib/kinematic_scattering.py +1196 -0
- pyTEMlib/low_loss_widget.py +176 -0
- pyTEMlib/microscope.py +61 -78
- pyTEMlib/peak_dialog.py +1047 -350
- pyTEMlib/peak_dlg.py +286 -248
- pyTEMlib/probe_tools.py +653 -202
- pyTEMlib/sidpy_tools.py +153 -129
- pyTEMlib/simulation_tools.py +104 -87
- pyTEMlib/version.py +6 -3
- pyTEMlib/xrpa_x_sections.py +20972 -0
- {pyTEMlib-0.2020.11.0.dist-info → pyTEMlib-0.2024.8.4.dist-info}/LICENSE +21 -21
- pyTEMlib-0.2024.8.4.dist-info/METADATA +93 -0
- pyTEMlib-0.2024.8.4.dist-info/RECORD +37 -0
- {pyTEMlib-0.2020.11.0.dist-info → pyTEMlib-0.2024.8.4.dist-info}/WHEEL +6 -5
- {pyTEMlib-0.2020.11.0.dist-info → pyTEMlib-0.2024.8.4.dist-info}/entry_points.txt +0 -1
- pyTEMlib/KinsCat.py +0 -2685
- pyTEMlib/__version__.py +0 -2
- pyTEMlib/data/TEMlibrc +0 -68
- pyTEMlib/data/edges_db.csv +0 -189
- pyTEMlib/data/edges_db.pkl +0 -0
- pyTEMlib/data/fparam.txt +0 -103
- pyTEMlib/data/microscopes.csv +0 -7
- pyTEMlib/data/microscopes.xml +0 -167
- pyTEMlib/data/path.txt +0 -1
- pyTEMlib/defaults_parser.py +0 -86
- pyTEMlib/dm3_reader.py +0 -609
- pyTEMlib/edges_db.py +0 -76
- pyTEMlib/eels_dlg.py +0 -240
- pyTEMlib/hdf_utils.py +0 -481
- pyTEMlib/image_tools1.py +0 -2194
- pyTEMlib/info_dialog.py +0 -227
- pyTEMlib/info_dlg.py +0 -205
- pyTEMlib/nion_reader.py +0 -293
- pyTEMlib/nsi_reader.py +0 -165
- pyTEMlib/structure_tools.py +0 -316
- pyTEMlib-0.2020.11.0.dist-info/METADATA +0 -20
- pyTEMlib-0.2020.11.0.dist-info/RECORD +0 -42
- {pyTEMlib-0.2020.11.0.dist-info → pyTEMlib-0.2024.8.4.dist-info}/top_level.txt +0 -0
pyTEMlib/image_dlg.py
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Gui for image_dialog
|
|
3
|
+
|
|
4
|
+
Author: Gerd Duscher
|
|
5
|
+
|
|
6
|
+
"""
|
|
7
|
+
# -*- coding: utf-8 -*-
|
|
8
|
+
Qt_available = True
|
|
9
|
+
try:
|
|
10
|
+
from PyQt5 import QtCore, QtGui, QtWidgets
|
|
11
|
+
except:
|
|
12
|
+
Qt_available = False
|
|
13
|
+
# print('Qt dialogs are not available')
|
|
14
|
+
|
|
15
|
+
from matplotlib.figure import Figure
|
|
16
|
+
|
|
17
|
+
from pyTEMlib.microscope import microscope
|
|
18
|
+
|
|
19
|
+
if Qt_available:
|
|
20
|
+
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as Canvas
|
|
21
|
+
|
|
22
|
+
class MySICanvas(Canvas):
|
|
23
|
+
def __init__(self, parent, width=10, height=10, dpi=100):
|
|
24
|
+
self.figure = Figure(figsize=(width, height), dpi=dpi)
|
|
25
|
+
self.figure.subplots_adjust(bottom=.2)
|
|
26
|
+
Canvas.__init__(self, self.figure)
|
|
27
|
+
self.setParent(parent)
|
|
28
|
+
|
|
29
|
+
Canvas.setSizePolicy(self, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
|
|
30
|
+
|
|
31
|
+
Canvas.updateGeometry(self)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class UiDialog(object):
|
|
35
|
+
def __init__(self, dialog, parent=None):
|
|
36
|
+
dialog.setObjectName('Image Info')
|
|
37
|
+
dialog.resize(371, 184)
|
|
38
|
+
|
|
39
|
+
valid_float = QtGui.QDoubleValidator()
|
|
40
|
+
# valid_int = QtGui.QIntValidator()
|
|
41
|
+
self.histogram = MySICanvas(parent, width=10, height=10, dpi=70)
|
|
42
|
+
|
|
43
|
+
# Defining a plot instance (axes) and assigning a variable to it
|
|
44
|
+
self.histogram.axes = self.histogram.figure.add_subplot(1, 1, 1)
|
|
45
|
+
|
|
46
|
+
self.TEM = []
|
|
47
|
+
self.TEM = microscope.get_available_microscope_names()
|
|
48
|
+
|
|
49
|
+
plot_layout = QtWidgets.QGridLayout()
|
|
50
|
+
|
|
51
|
+
# Adding histogram
|
|
52
|
+
plot_layout.addWidget(self.histogram, 0, 0)
|
|
53
|
+
|
|
54
|
+
# making a single widget out of histogram
|
|
55
|
+
histogram_plot = QtWidgets.QWidget()
|
|
56
|
+
histogram_plot.setLayout(plot_layout)
|
|
57
|
+
|
|
58
|
+
layout = self.layout = QtWidgets.QGridLayout()
|
|
59
|
+
self.layout.setVerticalSpacing(2)
|
|
60
|
+
|
|
61
|
+
self.separator1 = QtWidgets.QLabel()
|
|
62
|
+
self.separator1.setAutoFillBackground(True)
|
|
63
|
+
palette = self.separator1.palette()
|
|
64
|
+
palette.setColor(self.separator1.backgroundRole(), QtCore.Qt.blue)
|
|
65
|
+
palette.setColor(self.separator1.foregroundRole(), QtCore.Qt.white)
|
|
66
|
+
self.separator1.setAlignment(QtCore.Qt.AlignCenter)
|
|
67
|
+
self.separator1.setMaximumHeight(50)
|
|
68
|
+
|
|
69
|
+
self.separator1.setPalette(palette)
|
|
70
|
+
######################################################################
|
|
71
|
+
self.separator1.setText("Microscope")
|
|
72
|
+
layout.addWidget(self.separator1, 0, 0, 1, 3)
|
|
73
|
+
row = 0
|
|
74
|
+
layout.addWidget(self.separator1, row, 0, 1, 4)
|
|
75
|
+
|
|
76
|
+
row += 1
|
|
77
|
+
self.TEMList = QtWidgets.QComboBox()
|
|
78
|
+
self.TEMList.setEditable(False)
|
|
79
|
+
self.TEMList.addItems(self.TEM)
|
|
80
|
+
|
|
81
|
+
self.layout.addWidget(self.TEMList, row, 1)
|
|
82
|
+
|
|
83
|
+
row += 1
|
|
84
|
+
self.convLabel = QtWidgets.QLabel("Conv. Angle")
|
|
85
|
+
self.convEdit = QtWidgets.QLineEdit(" 100.0")
|
|
86
|
+
self.convEdit.setValidator(valid_float)
|
|
87
|
+
self.convUnit = QtWidgets.QLabel("mrad")
|
|
88
|
+
self.layout.addWidget(self.convLabel, row, 0)
|
|
89
|
+
self.layout.addWidget(self.convEdit, row, 1)
|
|
90
|
+
self.layout.addWidget(self.convUnit, row, 2)
|
|
91
|
+
|
|
92
|
+
row += 1
|
|
93
|
+
self.E0Label = QtWidgets.QLabel("Acc. Voltage")
|
|
94
|
+
self.E0Edit = QtWidgets.QLineEdit(" 100.0")
|
|
95
|
+
self.E0Edit.setValidator(valid_float)
|
|
96
|
+
self.E0Unit = QtWidgets.QLabel("kV")
|
|
97
|
+
self.layout.addWidget(self.E0Label, row, 0)
|
|
98
|
+
self.layout.addWidget(self.E0Edit, row, 1)
|
|
99
|
+
self.layout.addWidget(self.E0Unit, row, 2)
|
|
100
|
+
|
|
101
|
+
self.separator2 = QtWidgets.QLabel()
|
|
102
|
+
self.separator2.setAutoFillBackground(True)
|
|
103
|
+
self.separator2.setAlignment(QtCore.Qt.AlignCenter)
|
|
104
|
+
self.separator2.setMaximumHeight(50)
|
|
105
|
+
self.separator2.setPalette(palette)
|
|
106
|
+
|
|
107
|
+
row += 1
|
|
108
|
+
######################################################################
|
|
109
|
+
self.separator2.setText("Image")
|
|
110
|
+
layout.addWidget(self.separator2, row, 0, 1, 4)
|
|
111
|
+
######################################################################
|
|
112
|
+
row += 1
|
|
113
|
+
self.sizeLabel = QtWidgets.QLabel("Size")
|
|
114
|
+
self.sizeEdit = QtWidgets.QLineEdit(" 1 x 1")
|
|
115
|
+
self.sizeEdit.setValidator(valid_float)
|
|
116
|
+
self.sizeUnit = QtWidgets.QLabel("px")
|
|
117
|
+
|
|
118
|
+
self.layout.addWidget(self.sizeLabel, row, 0)
|
|
119
|
+
self.layout.addWidget(self.sizeEdit, row, 1)
|
|
120
|
+
self.layout.addWidget(self.sizeUnit, row, 2)
|
|
121
|
+
|
|
122
|
+
row += 1
|
|
123
|
+
self.timeLabel = QtWidgets.QLabel("Exp. Time")
|
|
124
|
+
self.timeEdit = QtWidgets.QLineEdit(" 100.0")
|
|
125
|
+
self.timeEdit.setValidator(valid_float)
|
|
126
|
+
self.timeUnit = QtWidgets.QLabel("s")
|
|
127
|
+
|
|
128
|
+
self.layout.addWidget(self.timeLabel, row, 0)
|
|
129
|
+
self.layout.addWidget(self.timeEdit, row, 1)
|
|
130
|
+
self.layout.addWidget(self.timeUnit, row, 2)
|
|
131
|
+
|
|
132
|
+
self.separator3 = QtWidgets.QLabel(dialog)
|
|
133
|
+
self.separator3.setAutoFillBackground(True)
|
|
134
|
+
self.separator3.setAlignment(QtCore.Qt.AlignCenter)
|
|
135
|
+
self.separator3.setMaximumHeight(50)
|
|
136
|
+
self.separator3.setPalette(palette)
|
|
137
|
+
|
|
138
|
+
row += 1
|
|
139
|
+
######################################################################
|
|
140
|
+
self.separator3.setText("Histogram")
|
|
141
|
+
self.layout.addWidget(self.separator3, row, 0, 1, 4)
|
|
142
|
+
######################################################################
|
|
143
|
+
|
|
144
|
+
row += 1
|
|
145
|
+
layout.addWidget(histogram_plot, row, 0, 1, 3)
|
|
146
|
+
dialog.setLayout(layout)
|