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.

Files changed (60) hide show
  1. pyTEMlib/__init__.py +11 -11
  2. pyTEMlib/animation.py +631 -0
  3. pyTEMlib/atom_tools.py +240 -245
  4. pyTEMlib/config_dir.py +57 -33
  5. pyTEMlib/core_loss_widget.py +658 -0
  6. pyTEMlib/crystal_tools.py +1255 -0
  7. pyTEMlib/diffraction_plot.py +756 -0
  8. pyTEMlib/dynamic_scattering.py +293 -0
  9. pyTEMlib/eds_tools.py +609 -0
  10. pyTEMlib/eels_dialog.py +749 -491
  11. pyTEMlib/{interactive_eels.py → eels_dialog_utilities.py} +1199 -1177
  12. pyTEMlib/eels_tools.py +2031 -1698
  13. pyTEMlib/file_tools.py +1276 -560
  14. pyTEMlib/file_tools_qt.py +193 -0
  15. pyTEMlib/graph_tools.py +1166 -450
  16. pyTEMlib/graph_viz.py +449 -0
  17. pyTEMlib/image_dialog.py +158 -0
  18. pyTEMlib/image_dlg.py +146 -232
  19. pyTEMlib/image_tools.py +1399 -1028
  20. pyTEMlib/info_widget.py +933 -0
  21. pyTEMlib/interactive_image.py +1 -226
  22. pyTEMlib/kinematic_scattering.py +1196 -0
  23. pyTEMlib/low_loss_widget.py +176 -0
  24. pyTEMlib/microscope.py +61 -81
  25. pyTEMlib/peak_dialog.py +1047 -410
  26. pyTEMlib/peak_dlg.py +286 -242
  27. pyTEMlib/probe_tools.py +653 -207
  28. pyTEMlib/sidpy_tools.py +153 -136
  29. pyTEMlib/simulation_tools.py +104 -87
  30. pyTEMlib/version.py +6 -3
  31. pyTEMlib/xrpa_x_sections.py +20972 -0
  32. {pyTEMlib-0.2020.11.1.dist-info → pyTEMlib-0.2024.9.0.dist-info}/LICENSE +21 -21
  33. pyTEMlib-0.2024.9.0.dist-info/METADATA +92 -0
  34. pyTEMlib-0.2024.9.0.dist-info/RECORD +37 -0
  35. {pyTEMlib-0.2020.11.1.dist-info → pyTEMlib-0.2024.9.0.dist-info}/WHEEL +5 -5
  36. {pyTEMlib-0.2020.11.1.dist-info → pyTEMlib-0.2024.9.0.dist-info}/entry_points.txt +0 -1
  37. pyTEMlib/KinsCat.py +0 -2758
  38. pyTEMlib/__version__.py +0 -2
  39. pyTEMlib/data/TEMlibrc +0 -68
  40. pyTEMlib/data/edges_db.csv +0 -189
  41. pyTEMlib/data/edges_db.pkl +0 -0
  42. pyTEMlib/data/fparam.txt +0 -103
  43. pyTEMlib/data/microscopes.csv +0 -7
  44. pyTEMlib/data/microscopes.xml +0 -167
  45. pyTEMlib/data/path.txt +0 -1
  46. pyTEMlib/defaults_parser.py +0 -90
  47. pyTEMlib/dm3_reader.py +0 -613
  48. pyTEMlib/edges_db.py +0 -76
  49. pyTEMlib/eels_dlg.py +0 -224
  50. pyTEMlib/hdf_utils.py +0 -483
  51. pyTEMlib/image_tools1.py +0 -2194
  52. pyTEMlib/info_dialog.py +0 -237
  53. pyTEMlib/info_dlg.py +0 -202
  54. pyTEMlib/nion_reader.py +0 -297
  55. pyTEMlib/nsi_reader.py +0 -170
  56. pyTEMlib/structure_tools.py +0 -316
  57. pyTEMlib/test.py +0 -2072
  58. pyTEMlib-0.2020.11.1.dist-info/METADATA +0 -20
  59. pyTEMlib-0.2020.11.1.dist-info/RECORD +0 -45
  60. {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
- # -*- coding: utf-8 -*-
2
- """
3
- InfoDialog user interface definitions
4
- """
5
-
6
- from PyQt5 import QtCore, QtGui, QtWidgets
7
- from pyTEMlib.microscope import microscope
8
- import matplotlib
9
- import matplotlib.figure
10
-
11
- from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as Canvas
12
-
13
-
14
- class HistogramCanvas(Canvas):
15
- def __init__(self, parent, width=10, height=10, dpi=100):
16
- self.figure = matplotlib.figure.Figure(figsize=(width, height), dpi=dpi)
17
- self.figure.subplots_adjust(bottom=.2)
18
-
19
- Canvas.__init__(self, self.figure)
20
- self.setParent(parent)
21
-
22
- Canvas.setSizePolicy(self, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
23
-
24
- Canvas.updateGeometry(self)
25
-
26
-
27
- class UiDialog(object):
28
- def __init__(self, dialog, parent=None):
29
- dialog.setObjectName('Spectrum Info')
30
- dialog.resize(371, 784)
31
-
32
- self.parent = parent
33
-
34
- self.TEM = []
35
- self.TEM = microscope.get_available_microscope_names()
36
-
37
- valid_float = QtGui.QDoubleValidator()
38
- # valid_int = QtGui.QIntValidator()
39
- self.histogram = HistogramCanvas(self.parent, width=10, height=10, dpi=70)
40
-
41
- # Defining a plot instance (axes) and assigning a variable to it
42
- self.histogram.axes = self.histogram.figure.add_subplot(1, 1, 1)
43
- # self.histogram.axes.set_axis_off()
44
-
45
- plot_layout = QtWidgets.QGridLayout()
46
-
47
- # Adding Histogram to the layout
48
- plot_layout.addWidget(self.histogram, 0, 0)
49
-
50
- # making a single widget out of image and slider
51
- histogram_plot = QtWidgets.QWidget()
52
- histogram_plot.setLayout(plot_layout)
53
-
54
- self.layout = QtWidgets.QGridLayout()
55
- self.layout.setVerticalSpacing(2)
56
-
57
- self.separator1 = QtWidgets.QLabel()
58
- self.separator1.setAutoFillBackground(True)
59
- palette = self.separator1.palette()
60
- palette.setColor(self.separator1.backgroundRole(), QtCore.Qt.blue)
61
- palette.setColor(self.separator1.foregroundRole(), QtCore.Qt.white)
62
- self.separator1.setAlignment(QtCore.Qt.AlignCenter)
63
- self.separator1.setMaximumHeight(50)
64
-
65
- self.separator1.setPalette(palette)
66
- ######################################################################
67
- self.separator1.setText("Experimental Parameters")
68
- self.layout.addWidget(self.separator1, 0, 0, 1, 3)
69
- row = 0
70
- self.layout.addWidget(self.separator1, row, 0, 1, 4)
71
- ######################################################################
72
-
73
- row += 1
74
- self.fovXLabel = QtWidgets.QLabel("FOV x")
75
- self.fovXEdit = QtWidgets.QLineEdit(" 1.00")
76
- self.fovXEdit.setValidator(valid_float)
77
- self.fovXUnit = QtWidgets.QLabel("nm")
78
-
79
- self.layout.addWidget(self.fovXLabel, row, 0)
80
- self.layout.addWidget(self.fovXEdit, row, 1)
81
- self.layout.addWidget(self.fovXUnit, row, 2)
82
-
83
- row += 1
84
- self.fovYLabel = QtWidgets.QLabel("FOV y")
85
- self.fovYEdit = QtWidgets.QLineEdit(" 1.00")
86
- self.fovYEdit.setValidator(valid_float)
87
- self.fovYUnit = QtWidgets.QLabel("nm")
88
-
89
- self.layout.addWidget(self.fovYLabel, row, 0)
90
- self.layout.addWidget(self.fovYEdit, row, 1)
91
- self.layout.addWidget(self.fovYUnit, row, 2)
92
-
93
- row += 1
94
- self.scale_button = QtWidgets.QPushButton('Set Spatial Scale', dialog)
95
- self.layout.addWidget(self.scale_button, row, 1)
96
-
97
- row += 1
98
- self.timeLabel = QtWidgets.QLabel("Exp. Time")
99
- self.timeEdit = QtWidgets.QLineEdit(" 100.0")
100
- self.timeEdit.setValidator(valid_float)
101
- self.timeUnit = QtWidgets.QLabel("s")
102
-
103
- self.layout.addWidget(self.timeLabel, row, 0)
104
- self.layout.addWidget(self.timeEdit, row, 1)
105
- self.layout.addWidget(self.timeUnit, row, 2)
106
-
107
- self.separator2 = QtWidgets.QLabel(dialog)
108
- self.separator2.setAutoFillBackground(True)
109
- self.separator2.setAlignment(QtCore.Qt.AlignCenter)
110
- self.separator2.setMaximumHeight(50)
111
- self.separator2.setPalette(palette)
112
-
113
- row += 1
114
- ######################################################################
115
- self.separator2.setText("Microscope")
116
- self.layout.addWidget(self.separator2, row, 0, 1, 4)
117
- ######################################################################
118
-
119
- row += 1
120
- self.TEMList = QtWidgets.QComboBox()
121
- self.TEMList.setEditable(False)
122
- self.TEMList.addItems(self.TEM)
123
-
124
- self.layout.addWidget(self.TEMList, row, 1)
125
-
126
- row += 1
127
- self.convLabel = QtWidgets.QLabel("Conv. Angle")
128
- self.convEdit = QtWidgets.QLineEdit(" 100.0")
129
- self.convEdit.setValidator(valid_float)
130
- self.convUnit = QtWidgets.QLabel("mrad")
131
- self.layout.addWidget(self.convLabel, row, 0)
132
- self.layout.addWidget(self.convEdit, row, 1)
133
- self.layout.addWidget(self.convUnit, row, 2)
134
-
135
- row += 1
136
- self.collLabel = QtWidgets.QLabel("Coll. Angle")
137
- self.collEdit = QtWidgets.QLineEdit(" 10.0")
138
- self.collEdit.setValidator(valid_float)
139
- self.collUnit = QtWidgets.QLabel("mrad")
140
- self.layout.addWidget(self.collLabel, row, 0)
141
- self.layout.addWidget(self.collEdit, row, 1)
142
- self.layout.addWidget(self.collUnit, row, 2)
143
-
144
- row += 1
145
- self.E0Label = QtWidgets.QLabel("Acc. Voltage")
146
- self.E0Edit = QtWidgets.QLineEdit(" 0.0")
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)