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.

Files changed (59) hide show
  1. pyTEMlib/__init__.py +11 -11
  2. pyTEMlib/animation.py +631 -0
  3. pyTEMlib/atom_tools.py +240 -222
  4. pyTEMlib/config_dir.py +57 -29
  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 -486
  11. pyTEMlib/{interactive_eels.py → eels_dialog_utilities.py} +1199 -1524
  12. pyTEMlib/eels_tools.py +2031 -1731
  13. pyTEMlib/file_tools.py +1276 -491
  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 -0
  19. pyTEMlib/image_tools.py +1399 -956
  20. pyTEMlib/info_widget.py +933 -0
  21. pyTEMlib/interactive_image.py +1 -0
  22. pyTEMlib/kinematic_scattering.py +1196 -0
  23. pyTEMlib/low_loss_widget.py +176 -0
  24. pyTEMlib/microscope.py +61 -78
  25. pyTEMlib/peak_dialog.py +1047 -350
  26. pyTEMlib/peak_dlg.py +286 -248
  27. pyTEMlib/probe_tools.py +653 -202
  28. pyTEMlib/sidpy_tools.py +153 -129
  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.0.dist-info → pyTEMlib-0.2024.8.4.dist-info}/LICENSE +21 -21
  33. pyTEMlib-0.2024.8.4.dist-info/METADATA +93 -0
  34. pyTEMlib-0.2024.8.4.dist-info/RECORD +37 -0
  35. {pyTEMlib-0.2020.11.0.dist-info → pyTEMlib-0.2024.8.4.dist-info}/WHEEL +6 -5
  36. {pyTEMlib-0.2020.11.0.dist-info → pyTEMlib-0.2024.8.4.dist-info}/entry_points.txt +0 -1
  37. pyTEMlib/KinsCat.py +0 -2685
  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 -86
  47. pyTEMlib/dm3_reader.py +0 -609
  48. pyTEMlib/edges_db.py +0 -76
  49. pyTEMlib/eels_dlg.py +0 -240
  50. pyTEMlib/hdf_utils.py +0 -481
  51. pyTEMlib/image_tools1.py +0 -2194
  52. pyTEMlib/info_dialog.py +0 -227
  53. pyTEMlib/info_dlg.py +0 -205
  54. pyTEMlib/nion_reader.py +0 -293
  55. pyTEMlib/nsi_reader.py +0 -165
  56. pyTEMlib/structure_tools.py +0 -316
  57. pyTEMlib-0.2020.11.0.dist-info/METADATA +0 -20
  58. pyTEMlib-0.2020.11.0.dist-info/RECORD +0 -42
  59. {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)