pyTEMlib 0.2024.1.1__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/eds_tools.py +1 -1
- pyTEMlib/image_tools.py +71 -0
- pyTEMlib/version.py +2 -2
- {pyTEMlib-0.2024.1.1.dist-info → pyTEMlib-0.2024.2.0.dist-info}/METADATA +1 -1
- {pyTEMlib-0.2024.1.1.dist-info → pyTEMlib-0.2024.2.0.dist-info}/RECORD +9 -9
- {pyTEMlib-0.2024.1.1.dist-info → pyTEMlib-0.2024.2.0.dist-info}/LICENSE +0 -0
- {pyTEMlib-0.2024.1.1.dist-info → pyTEMlib-0.2024.2.0.dist-info}/WHEEL +0 -0
- {pyTEMlib-0.2024.1.1.dist-info → pyTEMlib-0.2024.2.0.dist-info}/entry_points.txt +0 -0
- {pyTEMlib-0.2024.1.1.dist-info → pyTEMlib-0.2024.2.0.dist-info}/top_level.txt +0 -0
pyTEMlib/eds_tools.py
CHANGED
|
@@ -424,7 +424,7 @@ def fit_model(spectrum, elements, use_detector_efficiency=False):
|
|
|
424
424
|
y = np.array(spectrum) # .compute()
|
|
425
425
|
[p, _] = leastsq(residuals, pin, args=(y))
|
|
426
426
|
|
|
427
|
-
print(pin[-6:], p[-6:])
|
|
427
|
+
# print(pin[-6:], p[-6:])
|
|
428
428
|
|
|
429
429
|
update_fit_values(out_tags, p)
|
|
430
430
|
|
pyTEMlib/image_tools.py
CHANGED
|
@@ -23,6 +23,7 @@ from tqdm.auto import trange, tqdm
|
|
|
23
23
|
from itertools import product
|
|
24
24
|
|
|
25
25
|
from scipy import fftpack
|
|
26
|
+
import scipy
|
|
26
27
|
# from scipy import signal
|
|
27
28
|
from scipy.interpolate import interp1d # , interp2d
|
|
28
29
|
import scipy.optimize as optimization
|
|
@@ -730,6 +731,76 @@ class LineSelector(matplotlib.widgets.PolygonSelector):
|
|
|
730
731
|
self.line_verts[moved_point] = self.new_point
|
|
731
732
|
self.set_linewidth()
|
|
732
733
|
|
|
734
|
+
def get_profile(dataset, line):
|
|
735
|
+
xv, yv = get_line_selection_points(line)
|
|
736
|
+
|
|
737
|
+
|
|
738
|
+
if dataset.data_type.name == 'IMAGE':
|
|
739
|
+
dataset.get_image_dims()
|
|
740
|
+
xv /= (dataset.x[1] - dataset.x[0])
|
|
741
|
+
yv /= (dataset.y[1] - dataset.y[0])
|
|
742
|
+
profile = scipy.ndimage.map_coordinates(np.array(dataset), [xv,yv])
|
|
743
|
+
|
|
744
|
+
profile_dataset = sidpy.Dataset.from_array(profile.sum(axis=0))
|
|
745
|
+
profile_dataset.data_type='spectrum'
|
|
746
|
+
profile_dataset.units = dataset.units
|
|
747
|
+
profile_dataset.quantity = dataset.quantity
|
|
748
|
+
profile_dataset.set_dimension(0, sidpy.Dimension(np.linspace(xv[0,0], xv[-1,-1], profile_dataset.shape[0]),
|
|
749
|
+
name='x', units=dataset.x.units, quantity=dataset.x.quantity,
|
|
750
|
+
dimension_type='spatial'))
|
|
751
|
+
|
|
752
|
+
profile_dataset
|
|
753
|
+
|
|
754
|
+
if dataset.data_type.name == 'SPECTRAL_IMAGE':
|
|
755
|
+
spectral_axis = dataset.get_spectral_dims(return_axis=True)[0]
|
|
756
|
+
profile = np.zeros([xv.shape[1], 2, len(spectral_axis)])
|
|
757
|
+
data =np.array(dataset)
|
|
758
|
+
|
|
759
|
+
for index_x in range(xv.shape[1]):
|
|
760
|
+
for index_y in range(xv.shape[0]):
|
|
761
|
+
x = xv[index_y, index_x]
|
|
762
|
+
y = yv[index_y, index_x]
|
|
763
|
+
profile[index_x, 0] +=data[int(x),int(y)]
|
|
764
|
+
profile_dataset = sidpy.Dataset.from_array(profile)
|
|
765
|
+
profile_dataset.data_type='spectral_image'
|
|
766
|
+
profile_dataset.units = dataset.units
|
|
767
|
+
profile_dataset.quantity = dataset.quantity
|
|
768
|
+
profile_dataset.set_dimension(0, sidpy.Dimension(np.linspace(xv[0,0], xv[-1,-1], profile_dataset.shape[0]),
|
|
769
|
+
name='x', units=dataset.x.units, quantity=dataset.x.quantity,
|
|
770
|
+
dimension_type='spatial'))
|
|
771
|
+
profile_dataset.set_dimension(1, sidpy.Dimension([0, 1],
|
|
772
|
+
name='y', units=dataset.x.units, quantity=dataset.x.quantity,
|
|
773
|
+
dimension_type='spatial'))
|
|
774
|
+
|
|
775
|
+
profile_dataset.set_dimension(2, spectral_axis)
|
|
776
|
+
return profile_dataset
|
|
777
|
+
|
|
778
|
+
|
|
779
|
+
def get_line_selection_points(line):
|
|
780
|
+
|
|
781
|
+
start_point = line.line_verts[3]
|
|
782
|
+
right_point = line.line_verts[0]
|
|
783
|
+
low_point = line.line_verts[2]
|
|
784
|
+
|
|
785
|
+
if start_point[0] > right_point[0]:
|
|
786
|
+
start_point = line.line_verts[0]
|
|
787
|
+
right_point = line.line_verts[3]
|
|
788
|
+
low_point = line.line_verts[1]
|
|
789
|
+
m = (right_point[1] - start_point[1]) / (right_point[0] - start_point[0])
|
|
790
|
+
length_x = int(abs(start_point[0]-right_point[0]))
|
|
791
|
+
length_v = int(np.linalg.norm(start_point-right_point))
|
|
792
|
+
|
|
793
|
+
linewidth = int(abs(start_point[1]-low_point[1]))
|
|
794
|
+
x = np.linspace(0,length_x, length_v)
|
|
795
|
+
y = np.linspace(0,linewidth, line.line_width)
|
|
796
|
+
xv, yv = np.meshgrid(x, y)
|
|
797
|
+
|
|
798
|
+
yy = yv +x*m+start_point[1]
|
|
799
|
+
xx = (xv.T -y*m ).T + start_point[0]
|
|
800
|
+
|
|
801
|
+
return xx, yy
|
|
802
|
+
|
|
803
|
+
|
|
733
804
|
|
|
734
805
|
def histogram_plot(image_tags):
|
|
735
806
|
"""interactive histogram"""
|
pyTEMlib/version.py
CHANGED
|
@@ -5,7 +5,7 @@ pyTEMlib/config_dir.py,sha256=4evlo9P2Yht-AnqaLI-WweLjDQcislbAP3I7P7EZsPU,2085
|
|
|
5
5
|
pyTEMlib/crystal_tools.py,sha256=g4OXyvd5NLw7vaXhjDP3P6VZpVV6eiyuPn8MdgR2amI,61652
|
|
6
6
|
pyTEMlib/diffraction_plot.py,sha256=pM5d3bdBGa8LlPZ5lw8sLT94mlYTXELxPLv-jUP2FWY,27959
|
|
7
7
|
pyTEMlib/dynamic_scattering.py,sha256=O9MxnxfndWJ2VhQRjksKNQ4yY7y-gN_hitRQ4Qox4ns,9472
|
|
8
|
-
pyTEMlib/eds_tools.py,sha256=
|
|
8
|
+
pyTEMlib/eds_tools.py,sha256=34YYoix9rhq0aYnZrHVi0A8gQeu9XZ9fGGT0VxPQo8Y,24882
|
|
9
9
|
pyTEMlib/eels_dialog.py,sha256=x5AOe2SjL4R8aR6X92HOWdC9mL0M-jKtSiNfR-SHQr8,32327
|
|
10
10
|
pyTEMlib/eels_dialog_utilities.py,sha256=srkRvRDUWIzN38EWNGRWimsJLK4YXSnGEfL6Dd1V3IY,51778
|
|
11
11
|
pyTEMlib/eels_tools.py,sha256=pzsiMY-1ZXth5ZIrPaRNOs6R3gMAyZr8TVYf-Lxnn5Y,77781
|
|
@@ -15,7 +15,7 @@ pyTEMlib/graph_tools.py,sha256=iu0Y2hIPU6CkQHQEh-dI1vKnUHnSNXx4-CXs2M-1Sr8,44097
|
|
|
15
15
|
pyTEMlib/graph_viz.py,sha256=m5PwSn6l2r0bsaLWBDSHc9IGR3_PneG2BrZgnEdi07I,13644
|
|
16
16
|
pyTEMlib/image_dialog.py,sha256=F-ZgKq7UnMtPPd1b9eqb7t8MXDfWN-8hVKwB2Il0x28,6235
|
|
17
17
|
pyTEMlib/image_dlg.py,sha256=n5gradDiYOFGEQ3k_Wlk9RUYYzl4bl_hKLzNVcYteNE,5694
|
|
18
|
-
pyTEMlib/image_tools.py,sha256=
|
|
18
|
+
pyTEMlib/image_tools.py,sha256=IoRBmKsL6o4V9xGAKoSUV0hOJhr0QXIPCbEiAPWLOq0,43231
|
|
19
19
|
pyTEMlib/info_widget.py,sha256=G8MArXYI_xdvRY3cD7-3UxUjczEUWPjlrGJOj2BKU2Y,49903
|
|
20
20
|
pyTEMlib/interactive_image.py,sha256=5PwypcA1OjLAD-fi8bmWWFHuOjdIPVY9Dh59V24WuDA,34
|
|
21
21
|
pyTEMlib/kinematic_scattering.py,sha256=CUdJnclkok7d8qm_jDUF92MVHrmaTeMkKdvxxB6AqvA,43309
|
|
@@ -25,11 +25,11 @@ pyTEMlib/peak_dlg.py,sha256=qcjcnhwpGa4jBCeXzwQz9sCyX-tHsLLQ67ToqfKOiQY,11550
|
|
|
25
25
|
pyTEMlib/probe_tools.py,sha256=8tPQuANClLsGAKnZo6Vo4gNIGKfyDR6WUMO3dXcm_4k,27177
|
|
26
26
|
pyTEMlib/sidpy_tools.py,sha256=0oIx-qMtEmcZmLazQKW19dd-KoxyY3B15aIeMcyHA8E,4878
|
|
27
27
|
pyTEMlib/simulation_tools.py,sha256=RmegD5TpQMU68uASvzZWVplAqs7bM5KkF6bWDWLjyc0,2799
|
|
28
|
-
pyTEMlib/version.py,sha256=
|
|
28
|
+
pyTEMlib/version.py,sha256=0VMCRcKqYUmPVFq0CCqmw64JL4otiQC0CzcUsUWQV1Y,94
|
|
29
29
|
pyTEMlib/xrpa_x_sections.py,sha256=peb2pozcH0T-3zlWITx-5rdyeoP2YhOfBpwsWD1-4T4,1813751
|
|
30
|
-
pyTEMlib-0.2024.
|
|
31
|
-
pyTEMlib-0.2024.
|
|
32
|
-
pyTEMlib-0.2024.
|
|
33
|
-
pyTEMlib-0.2024.
|
|
34
|
-
pyTEMlib-0.2024.
|
|
35
|
-
pyTEMlib-0.2024.
|
|
30
|
+
pyTEMlib-0.2024.2.0.dist-info/LICENSE,sha256=7HdBF6SXIBd38bHOKkQd4DYR1KV-OYm9mwB16fM-984,1062
|
|
31
|
+
pyTEMlib-0.2024.2.0.dist-info/METADATA,sha256=fFKLCe0EnCeRwkFKBHcQvqPl6MjtPRGsb7ygt97l-Co,3280
|
|
32
|
+
pyTEMlib-0.2024.2.0.dist-info/WHEEL,sha256=-G_t0oGuE7UD0DrSpVZnq1hHMBV9DD2XkS5v7XpmTnk,110
|
|
33
|
+
pyTEMlib-0.2024.2.0.dist-info/entry_points.txt,sha256=qiIFPP3ffSz-gxj-TowzbA0Setq5Lo0RJTVtSrqD1IY,44
|
|
34
|
+
pyTEMlib-0.2024.2.0.dist-info/top_level.txt,sha256=rPLVH0UJxrPSPgSoKScTjL1K_X69JFzsYYnDnYTYIlU,9
|
|
35
|
+
pyTEMlib-0.2024.2.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|