pyTEMlib 0.2023.8.0__py2.py3-none-any.whl → 0.2024.2.0__py2.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/config_dir.py +0 -1
- pyTEMlib/crystal_tools.py +22 -26
- pyTEMlib/eds_tools.py +499 -46
- pyTEMlib/eels_dialog.py +284 -899
- pyTEMlib/eels_dialog_utilities.py +218 -341
- pyTEMlib/eels_tools.py +1526 -1583
- pyTEMlib/file_tools.py +52 -48
- pyTEMlib/graph_tools.py +3 -4
- pyTEMlib/image_tools.py +171 -41
- pyTEMlib/info_widget.py +618 -276
- pyTEMlib/kinematic_scattering.py +77 -512
- pyTEMlib/peak_dialog.py +162 -288
- pyTEMlib/version.py +2 -2
- pyTEMlib/xrpa_x_sections.py +173 -97
- {pyTEMlib-0.2023.8.0.dist-info → pyTEMlib-0.2024.2.0.dist-info}/LICENSE +1 -1
- {pyTEMlib-0.2023.8.0.dist-info → pyTEMlib-0.2024.2.0.dist-info}/METADATA +2 -2
- pyTEMlib-0.2024.2.0.dist-info/RECORD +35 -0
- {pyTEMlib-0.2023.8.0.dist-info → pyTEMlib-0.2024.2.0.dist-info}/WHEEL +1 -1
- pyTEMlib/eels_dlg.py +0 -252
- pyTEMlib/info_dialog.py +0 -665
- pyTEMlib/info_dlg.py +0 -239
- pyTEMlib/interactive_eels.py +0 -35
- pyTEMlib/viz.py +0 -481
- pyTEMlib-0.2023.8.0.dist-info/RECORD +0 -40
- {pyTEMlib-0.2023.8.0.dist-info → pyTEMlib-0.2024.2.0.dist-info}/entry_points.txt +0 -0
- {pyTEMlib-0.2023.8.0.dist-info → pyTEMlib-0.2024.2.0.dist-info}/top_level.txt +0 -0
pyTEMlib/config_dir.py
CHANGED
pyTEMlib/crystal_tools.py
CHANGED
|
@@ -27,6 +27,7 @@ import ase.data.colors
|
|
|
27
27
|
|
|
28
28
|
import matplotlib.pylab as plt # basic plotting
|
|
29
29
|
from scipy.spatial import cKDTree
|
|
30
|
+
import scipy
|
|
30
31
|
_spglib_present = True
|
|
31
32
|
try:
|
|
32
33
|
import spglib
|
|
@@ -137,26 +138,26 @@ def get_projection(crystal, layers=1):
|
|
|
137
138
|
for pro in projected:
|
|
138
139
|
atomic_numbers.append(projected_crystal.get_atomic_numbers()[pro].sum())
|
|
139
140
|
|
|
140
|
-
projected_crystal.rotate(np.degrees(angle)%360, 'z', rotate_cell=True)
|
|
141
|
+
projected_crystal.rotate(np.degrees(angle) % 360, 'z', rotate_cell=True)
|
|
141
142
|
|
|
142
|
-
near_base = np.array([projected_crystal.cell[0
|
|
143
|
-
projected_crystal.cell[1
|
|
144
|
-
projected_crystal.cell[0
|
|
145
|
-
-(projected_crystal.cell[0
|
|
146
|
-
lines = np.array(
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
143
|
+
near_base = np.array([projected_crystal.cell[0, :2], -projected_crystal.cell[0, :2],
|
|
144
|
+
projected_crystal.cell[1, :2], -projected_crystal.cell[1, :2],
|
|
145
|
+
projected_crystal.cell[0, :2] + projected_crystal.cell[1, :2],
|
|
146
|
+
-(projected_crystal.cell[0, :2] + projected_crystal.cell[1, :2])])
|
|
147
|
+
lines = np.array([[[0, near_base[0, 0]], [0, near_base[0, 1]]],
|
|
148
|
+
[[0, near_base[2, 0]], [0, near_base[2, 1]]],
|
|
149
|
+
[[near_base[0, 0], near_base[4, 0]], [near_base[0, 1], near_base[4, 1]]],
|
|
150
|
+
[[near_base[2, 0], near_base[4, 0]], [near_base[2, 1], near_base[4, 1]]]])
|
|
150
151
|
projected_atoms = []
|
|
151
152
|
for index in projected:
|
|
152
|
-
|
|
153
|
+
projected_atoms.append(index[0])
|
|
153
154
|
|
|
154
|
-
projected_crystal.info['projection']={'indices': projected,
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
155
|
+
projected_crystal.info['projection'] = {'indices': projected,
|
|
156
|
+
'projected': projected_atoms,
|
|
157
|
+
'projected_Z': atomic_numbers,
|
|
158
|
+
'angle': np.degrees(angle)+180 % 360,
|
|
159
|
+
'near_base': near_base,
|
|
160
|
+
'lines': lines}
|
|
160
161
|
return projected_crystal
|
|
161
162
|
|
|
162
163
|
|
|
@@ -283,13 +284,8 @@ def ball_and_stick(atoms, extend=1, max_bond_length=0.):
|
|
|
283
284
|
neighbor_list.update(super_cell)
|
|
284
285
|
bond_matrix = neighbor_list.get_connectivity_matrix()
|
|
285
286
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
if k > s:
|
|
289
|
-
del_double.append((k, s))
|
|
290
|
-
for key in del_double:
|
|
291
|
-
bond_matrix.pop(key)
|
|
292
|
-
|
|
287
|
+
bond_matrix = np.triu(bond_matrix.toarray())
|
|
288
|
+
bond_matrix = scipy.sparse.dok_array(bond_matrix)
|
|
293
289
|
if super_cell.info is None:
|
|
294
290
|
super_cell.info = {}
|
|
295
291
|
super_cell.info['plot_cell'] = {'bond_matrix': bond_matrix, 'corner_vectors': corner_vectors,
|
|
@@ -298,7 +294,7 @@ def ball_and_stick(atoms, extend=1, max_bond_length=0.):
|
|
|
298
294
|
return super_cell
|
|
299
295
|
|
|
300
296
|
|
|
301
|
-
def plot_unit_cell(atoms, extend=1, max_bond_length=1.0, ax
|
|
297
|
+
def plot_unit_cell(atoms, extend=1, max_bond_length=1.0, ax=None):
|
|
302
298
|
"""
|
|
303
299
|
Simple plot of unit cell
|
|
304
300
|
"""
|
|
@@ -309,8 +305,8 @@ def plot_unit_cell(atoms, extend=1, max_bond_length=1.0, ax = None):
|
|
|
309
305
|
positions = super_cell.positions - super_cell.cell.lengths()/2
|
|
310
306
|
|
|
311
307
|
if ax is None:
|
|
312
|
-
|
|
313
|
-
|
|
308
|
+
fig = plt.figure()
|
|
309
|
+
ax = fig.add_subplot(111, projection='3d')
|
|
314
310
|
# draw unit_cell
|
|
315
311
|
|
|
316
312
|
for line in super_cell.info['plot_cell']['corner_matrix'].keys():
|