pyTEMlib 0.2023.4.0__tar.gz → 0.2023.8.0__tar.gz
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-0.2023.4.0/pyTEMlib.egg-info → pyTEMlib-0.2023.8.0}/PKG-INFO +1 -2
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib/crystal_tools.py +47 -5
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib/eels_dialog.py +656 -41
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib/eels_dialog_utilities.py +8 -4
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib/eels_dlg.py +4 -3
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib/eels_tools.py +93 -39
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib/file_tools.py +95 -13
- pyTEMlib-0.2023.8.0/pyTEMlib/graph_tools.py +1167 -0
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib/image_dialog.py +1 -1
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib/image_dlg.py +1 -1
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib/image_tools.py +82 -39
- pyTEMlib-0.2023.8.0/pyTEMlib/info_dialog.py +665 -0
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib/info_dlg.py +1 -1
- pyTEMlib-0.2023.8.0/pyTEMlib/info_widget.py +655 -0
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib/interactive_eels.py +12 -4
- pyTEMlib-0.2023.8.0/pyTEMlib/peak_dialog.py +1173 -0
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib/peak_dlg.py +1 -1
- pyTEMlib-0.2023.8.0/pyTEMlib/version.py +6 -0
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib/viz.py +217 -0
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0/pyTEMlib.egg-info}/PKG-INFO +1 -2
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib.egg-info/SOURCES.txt +1 -0
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib.egg-info/requires.txt +1 -0
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/setup.py +1 -2
- pyTEMlib-0.2023.4.0/pyTEMlib/graph_tools.py +0 -461
- pyTEMlib-0.2023.4.0/pyTEMlib/info_dialog.py +0 -324
- pyTEMlib-0.2023.4.0/pyTEMlib/peak_dialog.py +0 -574
- pyTEMlib-0.2023.4.0/pyTEMlib/version.py +0 -6
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/LICENSE +0 -0
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/MANIFEST.in +0 -0
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/README.rst +0 -0
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib/__init__.py +0 -0
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib/animation.py +0 -0
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib/atom_tools.py +0 -0
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib/config_dir.py +0 -0
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib/diffraction_plot.py +0 -0
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib/dynamic_scattering.py +0 -0
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib/eds_tools.py +0 -0
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib/file_tools_qt.py +0 -0
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib/graph_viz.py +0 -0
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib/interactive_image.py +0 -0
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib/kinematic_scattering.py +0 -0
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib/microscope.py +0 -0
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib/probe_tools.py +0 -0
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib/sidpy_tools.py +0 -0
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib/simulation_tools.py +0 -0
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib/xrpa_x_sections.py +0 -0
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib.egg-info/dependency_links.txt +0 -0
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib.egg-info/entry_points.txt +0 -0
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/pyTEMlib.egg-info/top_level.txt +0 -0
- {pyTEMlib-0.2023.4.0 → pyTEMlib-0.2023.8.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 1.1
|
|
2
2
|
Name: pyTEMlib
|
|
3
|
-
Version: 0.2023.
|
|
3
|
+
Version: 0.2023.8.0
|
|
4
4
|
Summary: pyTEM: TEM Data Quantification library through a model-based approach
|
|
5
5
|
Home-page: https://pycroscopy.github.io/pyTEMlib/about.html
|
|
6
6
|
Author: Gerd Duscher
|
|
@@ -67,7 +67,6 @@ Classifier: Natural Language :: English
|
|
|
67
67
|
Classifier: Operating System :: OS Independent
|
|
68
68
|
Classifier: Programming Language :: Cython
|
|
69
69
|
Classifier: Programming Language :: Python :: 3
|
|
70
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
71
70
|
Classifier: Programming Language :: Python :: 3.8
|
|
72
71
|
Classifier: Programming Language :: Python :: 3.9
|
|
73
72
|
Classifier: Programming Language :: Python :: 3.10
|
|
@@ -26,7 +26,7 @@ import ase.build
|
|
|
26
26
|
import ase.data.colors
|
|
27
27
|
|
|
28
28
|
import matplotlib.pylab as plt # basic plotting
|
|
29
|
-
|
|
29
|
+
from scipy.spatial import cKDTree
|
|
30
30
|
_spglib_present = True
|
|
31
31
|
try:
|
|
32
32
|
import spglib
|
|
@@ -119,6 +119,47 @@ def set_bond_radii(atoms):
|
|
|
119
119
|
atoms.info['bond_radii'] = bond_radii
|
|
120
120
|
|
|
121
121
|
|
|
122
|
+
def get_projection(crystal, layers=1):
|
|
123
|
+
zone_axis = crystal.info['experimental']['zone_axis']
|
|
124
|
+
angle = crystal.info['experimental']['angle']
|
|
125
|
+
projected_crystal = ase.build.surface(crystal, zone_axis, vacuum=.0, layers=layers)
|
|
126
|
+
|
|
127
|
+
element_tree = cKDTree(projected_crystal.positions[:, 0:2])
|
|
128
|
+
done = []
|
|
129
|
+
projected = []
|
|
130
|
+
for atom in projected_crystal:
|
|
131
|
+
if atom.index not in done:
|
|
132
|
+
near = element_tree.query_ball_point(atom.position[:2], 0.05)
|
|
133
|
+
projected.append(near)
|
|
134
|
+
done.extend(near)
|
|
135
|
+
print('projected atomic numbers')
|
|
136
|
+
atomic_numbers = []
|
|
137
|
+
for pro in projected:
|
|
138
|
+
atomic_numbers.append(projected_crystal.get_atomic_numbers()[pro].sum())
|
|
139
|
+
|
|
140
|
+
projected_crystal.rotate(np.degrees(angle)%360, 'z', rotate_cell=True)
|
|
141
|
+
|
|
142
|
+
near_base = np.array([projected_crystal.cell[0,:2], -projected_crystal.cell[0,:2],
|
|
143
|
+
projected_crystal.cell[1,:2], -projected_crystal.cell[1,:2],
|
|
144
|
+
projected_crystal.cell[0,:2] + projected_crystal.cell[1,:2],
|
|
145
|
+
-(projected_crystal.cell[0,:2] + projected_crystal.cell[1,:2])])
|
|
146
|
+
lines = np.array( [[[0, near_base[0,0]],[0, near_base[0,1]]],
|
|
147
|
+
[[0, near_base[2,0]],[0, near_base[2,1]]],
|
|
148
|
+
[[near_base[0,0], near_base[4,0]],[near_base[0,1], near_base[4,1]]],
|
|
149
|
+
[[near_base[2,0], near_base[4,0]],[near_base[2,1], near_base[4,1]]]])
|
|
150
|
+
projected_atoms = []
|
|
151
|
+
for index in projected:
|
|
152
|
+
projected_atoms.append(index[0])
|
|
153
|
+
|
|
154
|
+
projected_crystal.info['projection']={'indices': projected,
|
|
155
|
+
'projected': projected_atoms,
|
|
156
|
+
'projected_Z': atomic_numbers,
|
|
157
|
+
'angle': np.degrees(angle)+180%360,
|
|
158
|
+
'near_base': near_base,
|
|
159
|
+
'lines': lines}
|
|
160
|
+
return projected_crystal
|
|
161
|
+
|
|
162
|
+
|
|
122
163
|
def jmol_viewer(atoms, size=2):
|
|
123
164
|
"""
|
|
124
165
|
jmol viewer of ase .Atoms object
|
|
@@ -257,7 +298,7 @@ def ball_and_stick(atoms, extend=1, max_bond_length=0.):
|
|
|
257
298
|
return super_cell
|
|
258
299
|
|
|
259
300
|
|
|
260
|
-
def plot_unit_cell(atoms, extend=1, max_bond_length=1.0):
|
|
301
|
+
def plot_unit_cell(atoms, extend=1, max_bond_length=1.0, ax = None):
|
|
261
302
|
"""
|
|
262
303
|
Simple plot of unit cell
|
|
263
304
|
"""
|
|
@@ -267,8 +308,9 @@ def plot_unit_cell(atoms, extend=1, max_bond_length=1.0):
|
|
|
267
308
|
corners = super_cell.info['plot_cell']['corner_vectors']
|
|
268
309
|
positions = super_cell.positions - super_cell.cell.lengths()/2
|
|
269
310
|
|
|
270
|
-
|
|
271
|
-
|
|
311
|
+
if ax is None:
|
|
312
|
+
fig = plt.figure()
|
|
313
|
+
ax = fig.add_subplot(111, projection='3d')
|
|
272
314
|
# draw unit_cell
|
|
273
315
|
|
|
274
316
|
for line in super_cell.info['plot_cell']['corner_matrix'].keys():
|
|
@@ -296,7 +338,7 @@ def plot_unit_cell(atoms, extend=1, max_bond_length=1.0):
|
|
|
296
338
|
ax.set_xlabel('x [Å]')
|
|
297
339
|
ax.set_ylabel('y [Å]')
|
|
298
340
|
ax.set_zlabel('z [Å]')
|
|
299
|
-
return
|
|
341
|
+
return ax.get_figure()
|
|
300
342
|
|
|
301
343
|
|
|
302
344
|
# Jmol colors. See: http://jmol.sourceforge.net/jscolors/#color_U
|