pyTEMlib 0.2024.1.1__tar.gz → 0.2024.2.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.

Files changed (42) hide show
  1. {pyTEMlib-0.2024.1.1/pyTEMlib.egg-info → pyTEMlib-0.2024.2.0}/PKG-INFO +1 -1
  2. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib/eds_tools.py +1 -1
  3. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib/image_tools.py +71 -0
  4. pyTEMlib-0.2024.2.0/pyTEMlib/version.py +6 -0
  5. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0/pyTEMlib.egg-info}/PKG-INFO +1 -1
  6. pyTEMlib-0.2024.1.1/pyTEMlib/version.py +0 -6
  7. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/LICENSE +0 -0
  8. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/MANIFEST.in +0 -0
  9. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/README.rst +0 -0
  10. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib/__init__.py +0 -0
  11. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib/animation.py +0 -0
  12. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib/atom_tools.py +0 -0
  13. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib/config_dir.py +0 -0
  14. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib/crystal_tools.py +0 -0
  15. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib/diffraction_plot.py +0 -0
  16. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib/dynamic_scattering.py +0 -0
  17. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib/eels_dialog.py +0 -0
  18. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib/eels_dialog_utilities.py +0 -0
  19. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib/eels_tools.py +0 -0
  20. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib/file_tools.py +0 -0
  21. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib/file_tools_qt.py +0 -0
  22. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib/graph_tools.py +0 -0
  23. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib/graph_viz.py +0 -0
  24. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib/image_dialog.py +0 -0
  25. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib/image_dlg.py +0 -0
  26. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib/info_widget.py +0 -0
  27. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib/interactive_image.py +0 -0
  28. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib/kinematic_scattering.py +0 -0
  29. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib/microscope.py +0 -0
  30. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib/peak_dialog.py +0 -0
  31. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib/peak_dlg.py +0 -0
  32. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib/probe_tools.py +0 -0
  33. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib/sidpy_tools.py +0 -0
  34. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib/simulation_tools.py +0 -0
  35. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib/xrpa_x_sections.py +0 -0
  36. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib.egg-info/SOURCES.txt +0 -0
  37. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib.egg-info/dependency_links.txt +0 -0
  38. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib.egg-info/entry_points.txt +0 -0
  39. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib.egg-info/requires.txt +0 -0
  40. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/pyTEMlib.egg-info/top_level.txt +0 -0
  41. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/setup.cfg +0 -0
  42. {pyTEMlib-0.2024.1.1 → pyTEMlib-0.2024.2.0}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: pyTEMlib
3
- Version: 0.2024.1.1
3
+ Version: 0.2024.2.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
@@ -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
 
@@ -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"""
@@ -0,0 +1,6 @@
1
+ """
2
+ version
3
+ """
4
+ _version = '0.2024.02.0'
5
+ __version__ = _version
6
+ _time = '2024-02-08 19:58:26'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: pyTEMlib
3
- Version: 0.2024.1.1
3
+ Version: 0.2024.2.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
@@ -1,6 +0,0 @@
1
- """
2
- version
3
- """
4
- _version = '0.2024.01.1'
5
- __version__ = _version
6
- _time = '2024-01-08 19:58:26'
File without changes
File without changes
File without changes
File without changes
File without changes