pyTEMlib 0.2020.11.1__py3-none-any.whl → 0.2024.9.0__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 -245
- pyTEMlib/config_dir.py +57 -33
- 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 -491
- pyTEMlib/{interactive_eels.py → eels_dialog_utilities.py} +1199 -1177
- pyTEMlib/eels_tools.py +2031 -1698
- pyTEMlib/file_tools.py +1276 -560
- 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 -232
- pyTEMlib/image_tools.py +1399 -1028
- pyTEMlib/info_widget.py +933 -0
- pyTEMlib/interactive_image.py +1 -226
- pyTEMlib/kinematic_scattering.py +1196 -0
- pyTEMlib/low_loss_widget.py +176 -0
- pyTEMlib/microscope.py +61 -81
- pyTEMlib/peak_dialog.py +1047 -410
- pyTEMlib/peak_dlg.py +286 -242
- pyTEMlib/probe_tools.py +653 -207
- pyTEMlib/sidpy_tools.py +153 -136
- pyTEMlib/simulation_tools.py +104 -87
- pyTEMlib/version.py +6 -3
- pyTEMlib/xrpa_x_sections.py +20972 -0
- {pyTEMlib-0.2020.11.1.dist-info → pyTEMlib-0.2024.9.0.dist-info}/LICENSE +21 -21
- pyTEMlib-0.2024.9.0.dist-info/METADATA +92 -0
- pyTEMlib-0.2024.9.0.dist-info/RECORD +37 -0
- {pyTEMlib-0.2020.11.1.dist-info → pyTEMlib-0.2024.9.0.dist-info}/WHEEL +5 -5
- {pyTEMlib-0.2020.11.1.dist-info → pyTEMlib-0.2024.9.0.dist-info}/entry_points.txt +0 -1
- pyTEMlib/KinsCat.py +0 -2758
- 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 -90
- pyTEMlib/dm3_reader.py +0 -613
- pyTEMlib/edges_db.py +0 -76
- pyTEMlib/eels_dlg.py +0 -224
- pyTEMlib/hdf_utils.py +0 -483
- pyTEMlib/image_tools1.py +0 -2194
- pyTEMlib/info_dialog.py +0 -237
- pyTEMlib/info_dlg.py +0 -202
- pyTEMlib/nion_reader.py +0 -297
- pyTEMlib/nsi_reader.py +0 -170
- pyTEMlib/structure_tools.py +0 -316
- pyTEMlib/test.py +0 -2072
- pyTEMlib-0.2020.11.1.dist-info/METADATA +0 -20
- pyTEMlib-0.2020.11.1.dist-info/RECORD +0 -45
- {pyTEMlib-0.2020.11.1.dist-info → pyTEMlib-0.2024.9.0.dist-info}/top_level.txt +0 -0
pyTEMlib/image_dlg.py
CHANGED
|
@@ -1,232 +1,146 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
self
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
self.E0Edit.setValidator(valid_float)
|
|
148
|
-
self.E0Unit = QtWidgets.QLabel("kV")
|
|
149
|
-
self.layout.addWidget(self.E0Label, row, 0)
|
|
150
|
-
self.layout.addWidget(self.E0Edit, row, 1)
|
|
151
|
-
self.layout.addWidget(self.E0Unit, row, 2)
|
|
152
|
-
|
|
153
|
-
row += 1
|
|
154
|
-
self.fluxLabel = QtWidgets.QLabel("Flux")
|
|
155
|
-
self.fluxEdit = QtWidgets.QLineEdit("0.0")
|
|
156
|
-
self.fluxEdit.setValidator(valid_float)
|
|
157
|
-
self.fluxUnit = QtWidgets.QLabel("e<sup>-</sup>/s")
|
|
158
|
-
self.layout.addWidget(self.fluxLabel, row, 0)
|
|
159
|
-
self.layout.addWidget(self.fluxEdit, row, 1)
|
|
160
|
-
self.layout.addWidget(self.fluxUnit, row, 2)
|
|
161
|
-
|
|
162
|
-
self.separator3 = QtWidgets.QLabel(dialog)
|
|
163
|
-
self.separator3.setAutoFillBackground(True)
|
|
164
|
-
self.separator3.setAlignment(QtCore.Qt.AlignCenter)
|
|
165
|
-
self.separator3.setMaximumHeight(50)
|
|
166
|
-
self.separator3.setPalette(palette)
|
|
167
|
-
row += 1
|
|
168
|
-
######################################################################
|
|
169
|
-
self.separator3.setText("Histogram")
|
|
170
|
-
self.layout.addWidget(self.separator3, row, 0, 1, 4)
|
|
171
|
-
|
|
172
|
-
row += 1
|
|
173
|
-
self.layout.addWidget(histogram_plot, row, 0, 1, 3)
|
|
174
|
-
|
|
175
|
-
row += 1
|
|
176
|
-
self.logCheck = QtWidgets.QCheckBox("log")
|
|
177
|
-
self.gammaEdit = QtWidgets.QLineEdit(" 1.0")
|
|
178
|
-
self.gammaEdit.setValidator(valid_float)
|
|
179
|
-
self.gammaCheck = QtWidgets.QCheckBox("gamma")
|
|
180
|
-
self.layout.addWidget(self.logCheck, row, 0)
|
|
181
|
-
self.layout.addWidget(self.gammaCheck, row, 1)
|
|
182
|
-
self.layout.addWidget(self.gammaEdit, row, 2)
|
|
183
|
-
dialog.setLayout(self.layout)
|
|
184
|
-
|
|
185
|
-
dialog.setWindowTitle("Image Info")
|
|
186
|
-
|
|
187
|
-
QtCore.QMetaObject.connectSlotsByName(dialog)
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
"""
|
|
191
|
-
class UiDialog2(object):
|
|
192
|
-
def __init__(self, dialog):
|
|
193
|
-
|
|
194
|
-
self.separator4 = QtWidgets.QLabel(dialog)
|
|
195
|
-
self.separator4.setAutoFillBackground(True)
|
|
196
|
-
self.separator4.setAlignment(QtCore.Qt.AlignCenter)
|
|
197
|
-
self.separator4.setMaximumHeight(50)
|
|
198
|
-
self.separator4.setPalette(palette)
|
|
199
|
-
######################################################################
|
|
200
|
-
self.separator4.setText("Spectrum Stack")
|
|
201
|
-
|
|
202
|
-
row += 2
|
|
203
|
-
self.layout.addWidget(self.separator4, row, 0, 1, 4)
|
|
204
|
-
######################################################################
|
|
205
|
-
|
|
206
|
-
self.binXLabel = QtWidgets.QLabel('Bin X:')
|
|
207
|
-
self.binXEdit = QtWidgets.QLineEdit('1')
|
|
208
|
-
self.binXEdit.setValidator(valid_int)
|
|
209
|
-
self.binXUnit = QtWidgets.QLabel('pixel')
|
|
210
|
-
|
|
211
|
-
row += 1
|
|
212
|
-
self.layout.addWidget(self.binXLabel, row, 0)
|
|
213
|
-
self.layout.addWidget(self.binXEdit, row, 1)
|
|
214
|
-
self.layout.addWidget(self.binXUnit, row, 2)
|
|
215
|
-
|
|
216
|
-
self.binYLabel = QtWidgets.QLabel('Bin Y:')
|
|
217
|
-
self.binYEdit = QtWidgets.QLineEdit('1')
|
|
218
|
-
self.binYEdit.setValidator(valid_int)
|
|
219
|
-
self.binYUnit = QtWidgets.QLabel('pixel')
|
|
220
|
-
|
|
221
|
-
row += 1
|
|
222
|
-
self.layout.addWidget(self.binYLabel, row, 0)
|
|
223
|
-
self.layout.addWidget(self.binYEdit, row, 1)
|
|
224
|
-
self.layout.addWidget(self.binYUnit, row, 2)
|
|
225
|
-
|
|
226
|
-
dialog.setLayout(self.layout)
|
|
227
|
-
|
|
228
|
-
dialog.setWindowTitle("Spectrum Info")
|
|
229
|
-
|
|
230
|
-
QtCore.QMetaObject.connectSlotsByName(dialog)
|
|
231
|
-
|
|
232
|
-
"""
|
|
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)
|