pyTEMlib 0.2025.4.0__py3-none-any.whl → 0.2025.4.1__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/file_tools.py CHANGED
@@ -1457,10 +1457,12 @@ def read_adorned_metadata(image):
1457
1457
  root = ET.fromstring(xml_str)
1458
1458
  metadata_dict = etree_to_dict(root)
1459
1459
  detector = 'detector'
1460
- if 'Detectors' in metadata_dict['Metadata']['Detectors']['ScanningDetector']:
1461
- if 'ScanningDetector' in metadata_dict['Metadata']['Detectors']['ScanningDetector']:
1460
+
1461
+ if 'Detectors' in metadata_dict['Metadata']:
1462
+ if 'ScanningDetector' in metadata_dict['Metadata']['Detectors']:
1462
1463
  detector = metadata_dict['Metadata']['Detectors']['ScanningDetector']['DetectorName']
1463
-
1464
+ elif 'ImagingDetector' in metadata_dict['Metadata']['Detectors']:
1465
+ detector = metadata_dict['Metadata']['Detectors']['ImagingDetector']['DetectorName']
1464
1466
  segment = ''
1465
1467
  if 'CustomPropertyGroup' in metadata_dict['Metadata']:
1466
1468
  if 'CustomProperties' in metadata_dict['Metadata']['CustomPropertyGroup']:
@@ -1476,6 +1478,29 @@ def read_adorned_metadata(image):
1476
1478
  segment = '_'+item['@value']
1477
1479
  return detector+segment, metadata_dict['Metadata']
1478
1480
 
1481
+
1482
+ def get_metadata_from_adorned(ds):
1483
+ ds.metadata['experiment']= {}
1484
+ if 'Optics' in ds.original_metadata:
1485
+ if 'LastMeasuredScreenCurrent' in ds.original_metadata['Optics']:
1486
+ ds.metadata['experiment']['current'] = float(ds.original_metadata['Optics']['LastMeasuredScreenCurrent'])
1487
+ if 'ConvergenceAngle' in ds.original_metadata['Optics']:
1488
+ ds.metadata['experiment']['convergence_angle'] = float(ds.original_metadata['Optics']['ConvergenceAngle'])
1489
+ if 'AccelerationVoltage' in ds.original_metadata['Optics']:
1490
+ ds.metadata['experiment']['acceleration_voltage'] = float(ds.original_metadata['Optics']['AccelerationVoltage'])
1491
+ if 'SpotIndex' in ds.original_metadata['Optics']:
1492
+ ds.metadata['experiment']['spot_size'] = ds.original_metadata['Optics']['SpotIndex']
1493
+ if' StagesSettings' in ds.original_metadata:
1494
+ if 'StagePosition' in ds.original_metadata['StagesSettings']:
1495
+ ds.metadata['experiment']['stage_position'] = ds.original_metadata['StagesSettings']['StagePosition']
1496
+ if 'Detectors' in ds.original_metadata:
1497
+ if 'ScanningDetector' in ds.original_metadata['Detectors']:
1498
+ ds.metadata['experiment']['detector'] = ds.original_metadata['Detectors']['ScanningDetector']['DetectorName']
1499
+ elif 'ImagingDetector' in ds.original_metadata['Detectors']:
1500
+ ds.metadata['experiment']['detector'] = ds.original_metadata['Detectors']['ImagingDetector']['DetectorName']
1501
+ ds.metadata['experiment']['exposure_time'] = ds.original_metadata['Detectors']['ImagingDetector']['ExposureTime']
1502
+
1503
+
1479
1504
  def adorned_to_sidpy(images):
1480
1505
  """
1481
1506
  Convert a list of adorned images to a dictionary of Sidpy datasets.
@@ -1519,6 +1544,7 @@ def adorned_to_sidpy(images):
1519
1544
  ds.set_dimension(1, sidpy.Dimension(np.arange(image.data.shape[1]) * pixel_size_x_nm,
1520
1545
  name='x', units='nm', quantity='Length', dimension_type='spatial'))
1521
1546
 
1547
+ get_metadata_from_adorned(ds)
1522
1548
  return data_sets
1523
1549
 
1524
1550
 
pyTEMlib/version.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """
2
2
  version
3
3
  """
4
- _version = '0.2025.04.0'
4
+ _version = '0.2025.04.1'
5
5
  __version__ = _version
6
- _time = '2025-04-25 19:58:26'
6
+ _time = '2025-05-25 19:58:26'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyTEMlib
3
- Version: 0.2025.4.0
3
+ Version: 0.2025.4.1
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
@@ -10,7 +10,7 @@ pyTEMlib/eds_tools.py,sha256=Ilof2Cars-1ILXx5g2RsU2G4BgrPwjOHgQ7-OabmbrU,28000
10
10
  pyTEMlib/eels_dialog.py,sha256=QG_PU3uuzus_3I3zjfaxb2a9iYq8B053zYw-B52JklM,32595
11
11
  pyTEMlib/eels_dialog_utilities.py,sha256=73W9jFbPx-eeLEiSaBptTgGLr40bIYYfSyzLnZbhfvo,51761
12
12
  pyTEMlib/eels_tools.py,sha256=pl75ZDQHz1JngxD84T_595Kfrl5TEJSETPGgkXfBtrA,88688
13
- pyTEMlib/file_tools.py,sha256=AIeWD3JaB1OI32_pj_RSqQuRGjPM-wiD0zTbL5W17Tc,64559
13
+ pyTEMlib/file_tools.py,sha256=RniTJrcuiyt7PefE5SSY_z2pTZPTNhFRjb2oVXVa4nE,66373
14
14
  pyTEMlib/file_tools_qt.py,sha256=tLZACS4JyGH_AOzNR_SGAhjA01y4VJB261opPhGMlm8,7223
15
15
  pyTEMlib/graph_tools.py,sha256=VWuTgFGeu4gn4cfRgf-76kO6u2B1ZV_dz6gLfx2k4NY,46570
16
16
  pyTEMlib/graph_viz.py,sha256=m5PwSn6l2r0bsaLWBDSHc9IGR3_PneG2BrZgnEdi07I,13644
@@ -28,11 +28,11 @@ pyTEMlib/peak_dlg.py,sha256=qcjcnhwpGa4jBCeXzwQz9sCyX-tHsLLQ67ToqfKOiQY,11550
28
28
  pyTEMlib/probe_tools.py,sha256=sDW9CW3SMwjvSHYcEufceismHv_LVkqxcS-gCtEklCg,37926
29
29
  pyTEMlib/sidpy_tools.py,sha256=0oIx-qMtEmcZmLazQKW19dd-KoxyY3B15aIeMcyHA8E,4878
30
30
  pyTEMlib/simulation_tools.py,sha256=RmegD5TpQMU68uASvzZWVplAqs7bM5KkF6bWDWLjyc0,2799
31
- pyTEMlib/version.py,sha256=znL_4Pt7sBR4l1I39FM04SGxnneUfbZrv9R_6tFaynA,94
31
+ pyTEMlib/version.py,sha256=1mG-HaMBzuYiDf1nig-t9gxjgThQprsDbDaDFGoWGBY,94
32
32
  pyTEMlib/xrpa_x_sections.py,sha256=m4gaH7gaJiNi-CsIT9aKoH4fB6MQIAe876kxEmzSebI,1825392
33
- pytemlib-0.2025.4.0.dist-info/licenses/LICENSE,sha256=7HdBF6SXIBd38bHOKkQd4DYR1KV-OYm9mwB16fM-984,1062
34
- pytemlib-0.2025.4.0.dist-info/METADATA,sha256=mV1ni5hE1q19Z8qOzNfWGb9YAOy0rv69JZd3J1e14MM,3515
35
- pytemlib-0.2025.4.0.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
36
- pytemlib-0.2025.4.0.dist-info/entry_points.txt,sha256=zn2yO1IWTutI3c7C9e3GdARCvm43JURoOhqQ8YylV4Y,43
37
- pytemlib-0.2025.4.0.dist-info/top_level.txt,sha256=rPLVH0UJxrPSPgSoKScTjL1K_X69JFzsYYnDnYTYIlU,9
38
- pytemlib-0.2025.4.0.dist-info/RECORD,,
33
+ pytemlib-0.2025.4.1.dist-info/licenses/LICENSE,sha256=7HdBF6SXIBd38bHOKkQd4DYR1KV-OYm9mwB16fM-984,1062
34
+ pytemlib-0.2025.4.1.dist-info/METADATA,sha256=Cp3K3rOFMT-MZjC2EK0mKXBYU495_9UFUkZlg2yIH9Y,3515
35
+ pytemlib-0.2025.4.1.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
36
+ pytemlib-0.2025.4.1.dist-info/entry_points.txt,sha256=zn2yO1IWTutI3c7C9e3GdARCvm43JURoOhqQ8YylV4Y,43
37
+ pytemlib-0.2025.4.1.dist-info/top_level.txt,sha256=rPLVH0UJxrPSPgSoKScTjL1K_X69JFzsYYnDnYTYIlU,9
38
+ pytemlib-0.2025.4.1.dist-info/RECORD,,