Image Tools


Adaptive Fourier Filtering#

OpenInColab

part of

pyTEMlib

a pycroscopy ecosystem package

Notebook by Gerd Duscher, 2023

Microscopy Facilities
Institute of Advanced Materials & Manufacturing
The University of Tennessee, Knoxville

Model based analysis and quantification of data acquired with transmission electron microscopes

Content#

An introduction into Fourier Filtering of images.

Install pyTEMlib#

If you have not done so in the Introduction Notebook, please test and install pyTEMlib and other important packages with the code cell below.

import sys
import importlib.metadata
def test_package(package_name):
    """Test if package exists and returns version or -1"""
    try:
        version = importlib.metadata.version(package_name)
    except importlib.metadata.PackageNotFoundError:
        version = '-1'
    return version

if test_package('pyTEMlib') < '0.2025.3.0':
    print('installing pyTEMlib')
    !{sys.executable} -m pip install  --upgrade pyTEMlib -q
print('done')
done
import csv

Loading of necessary libraries#

Please note, that we only need to load the pyTEMlib library, which is based on sidpy Datasets.

%matplotlib widget
import numpy as np
import matplotlib.pylab as plt 
import sys
import scipy

if 'google.colab' in sys.modules:
    from google.colab import output
    output.enable_custom_widget_manager()
    from google.colab import drive

import sys
sys.path.insert(0, '../../')
sys.path.insert(0, '../../../sipdy/')
sys.path.insert(0, '../../../SciFiReaders/')


%load_ext autoreload
%autoreload 2
import SciFiReaders
import sidpy

import pyTEMlib


if 'google.colab' in sys.modules:
    drive.mount("/content/drive")
    
print('pyTEMlib version: ', pyTEMlib.__version__)
print('sidpy version', sidpy.__version__)
note_book_version = '2025.05.19'
note_book_name='pyTEMib/notebooks/Imaging/Adaptive_Fourier_Filter'
You don't have igor2 installed.     If you wish to open igor files, you will need to install it     (pip install igor2) before attempting.
You don't have gwyfile installed.     If you wish to open .gwy files, you will need to      install it (pip install gwyfile) before attempting.
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[3], line 23
     20 import SciFiReaders
     21 import sidpy
---> 23 import pyTEMlib
     26 if 'google.colab' in sys.modules:
     27     drive.mount("/content/drive")

File ~/work/pyTEMlib/pyTEMlib/notebooks/Imaging/../../pyTEMlib/__init__.py:19
     16 from .version import  __version__
     18 from . import file_tools
---> 19 from . import  image_tools
     20 from .image import image_atoms as atom_tools
     21 from . import graph_tools

File ~/work/pyTEMlib/pyTEMlib/notebooks/Imaging/../../pyTEMlib/image_tools.py:42
     39 from scipy.signal import fftconvolve
     41 ## import all function of the image package of pycroscopy
---> 42 from .image import *
     45 def get_atomic_pseudo_potential(fov, atoms, size=512, rotation=0):
     46     # Big assumption: the atoms are not near the edge of the unit cell
     47     # If any atoms are close to the edge (ex. [0,0]) then the potential will be clipped
     48     # before calling the function, shift the atoms to the center of the unit cell
     50     pixel_size = fov / size

File ~/work/pyTEMlib/pyTEMlib/notebooks/Imaging/../../pyTEMlib/image/__init__.py:25
     23 from .image_graph import find_polyhedra, breadth_first_search, breadth_first_search_flexible
     24 from .image_graph import get_base_atoms
---> 25 from .image_distortion import get_distortion_matrix, undistort, undistort_sitk
     26 from .image_registration import complete_registration, rigid_registration, demon_registration
     27 from .image_fft import power_spectrum, diffractogram_spots, adaptive_fourier_filter

File ~/work/pyTEMlib/pyTEMlib/notebooks/Imaging/../../pyTEMlib/image/image_distortion.py:14
     11 import scipy
     12 import skimage
---> 14 import SimpleITK 
     16 from tqdm.auto import trange
     18 ####################
     19 # Distortion Matrix
     20 ####################

ModuleNotFoundError: No module named 'SimpleITK'

Open File#

The data are held in the memory in the sidpy format with rather extensive capabilities.

All results can be stored in that NSID format file.

First we select the file and the dataset (the dropdown menu at the bottom), in case there are several.

fileWidget = pyTEMlib.file_tools.FileWidget()
import h5py
h5_file = h5py.File(fileWidget.file_name, mode='r+')
h5_file['Data']['Image'].keys()
<KeysViewHDF5 ['29c1a096334e4d00a113a40658276c6a', '3fe8ac69069a44c98a03d73f6e467e57', '833fd4db371b47a98bf9e8c5622aec8b', '88f3b377a4d944cabaebee90d0908198', 'f0eee0de16c345778daf792622101f22', 'f4952a9421184f1f87472055c6770640']>
data_array = h5_file['Data']['Image']['3fe8ac69069a44c98a03d73f6e467e57']['Data']
print(data_array)
plt.figure()
plt.imshow(np.array(data_array)[:,:,0].T)
<HDF5 dataset "Data": shape (1616, 170, 1), type "<u2">
<matplotlib.image.AxesImage at 0x10748bd8740>
import json
metadata_array =  h5_file['Data']['Image']['29c1a096334e4d00a113a40658276c6a']['Metadata'][:, 0]
metadata_string = metadata_array.tobytes().decode("utf-8")
metadata = dict(json.loads(metadata_string.rstrip('\x00')))
metadata
{'Core': {'MetadataDefinitionVersion': '7.9',
  'MetadataSchemaVersion': 'v1/2013/07',
  'guid': '00000000000000000000000000000000',
  'UserId': 'yzhao65'},
 'Instrument': {'ControlSoftwareVersion': '3.21.1',
  'Manufacturer': 'FEI Company',
  'InstrumentId': '4018',
  'InstrumentClass': 'Titan',
  'InstrumentModel': 'Spectra',
  'ComputerName': 'TITAN52340180'},
 'Acquisition': {'AcquisitionStartDatetime': {'DateTime': '1751400967'},
  'AcquisitionDatetime': {'DateTime': '0'},
  'BeamType': '',
  'SourceType': 'XFEG'},
 'Optics': {'GunLensSetting': '777.25067138671875',
  'ExtractorVoltage': '3600.03662109375',
  'AccelerationVoltage': '200000',
  'SpotIndex': '7',
  'C1LensIntensity': '-0.45199774718761859',
  'C2LensIntensity': '0.19410951924463052',
  'C3LensIntensity': '0.35430084129721517',
  'ObjectiveLensIntensity': '0.82398502199325219',
  'IntermediateLensIntensity': '0.060336265199823894',
  'DiffractionLensIntensity': '0.19139078553472397',
  'Projector1LensIntensity': '0.28091570010789807',
  'Projector2LensIntensity': '0.91034079367771092',
  'LorentzLensIntensity': '0',
  'MiniCondenserLensIntensity': '0.34343613593964234',
  'BeamConvergence': '0.030030056394484476',
  'ScreenCurrent': '0',
  'LastMeasuredScreenCurrent': '2.7559210169449673e-10',
  'FullScanFieldOfView': {'x': '1.2036044831963025e-05',
   'y': '1.2036044831963025e-05'},
  'Focus': '5.0366599727198754e-08',
  'StemFocus': '0',
  'Defocus': '5.0366599727198754e-08',
  'HighMagnificationMode': 'None',
  'Apertures': {'Aperture-0': {'Name': 'C1',
    'Number': '1',
    'MechanismType': 'Motorized',
    'Type': 'Circular',
    'Diameter': '0.002',
    'Enabled': '0'},
   'Aperture-1': {'Name': 'C2',
    'Number': '2',
    'MechanismType': 'Motorized',
    'Type': 'Circular',
    'Diameter': '6.9999999999999994e-05',
    'Enabled': '1'},
   'Aperture-2': {'Name': 'C3',
    'Number': '3',
    'MechanismType': 'Motorized',
    'Type': 'Circular',
    'Diameter': '0.002',
    'Enabled': '0'},
   'Aperture-3': {'Name': 'OBJ',
    'Number': '4',
    'MechanismType': 'Motorized',
    'Type': 'None'},
   'Aperture-4': {'Name': 'SA',
    'Number': '5',
    'MechanismType': 'Motorized',
    'Type': 'None'}},
  'OperatingMode': '2',
  'TemOperatingSubMode': 'None',
  'ProjectorMode': '1',
  'EFTEMOn': 'false',
  'ObjectiveLensMode': 'HM',
  'IlluminationMode': 'Probe',
  'ProbeMode': '1',
  'CameraLength': '0.090999999999999998'},
 'EnergyFilter': {'EntranceApertureType': ''},
 'Stage': {'Position': {'x': '0.00024801418499999987',
   'y': '-1.6007430000000024e-05',
   'z': '-0.00013106427'},
  'AlphaTilt': '9.9067999999933112e-05',
  'BetaTilt': '-0.00022881607583258301',
  'HolderType': 'FEI Double Tilt'},
 'Scan': {'ScanSize': {'width': '2048', 'height': '2048'},
  'DwellTime': '2.0000000000000002e-05',
  'ScanArea': {'left': '0.525390625',
   'top': '0.12451171875',
   'right': '0.6083984375',
   'bottom': '0.91357421875'},
  'MainsLockOn': 'false',
  'LineTime': '0.0035200000000000001',
  'LineIntegrationCount': '1',
  'LineInterlacing': '1',
  'FrameTime': '5.68832',
  'ScanRotation': '-2.5529513989856394'},
 'Vacuum': {'VacuumMode': 'Ready'},
 'Detectors': {'Detector-0': {'DetectorName': 'BF-S',
   'DetectorType': 'ScanningDetector',
   'Inserted': 'true',
   'Enabled': 'true',
   'Gain': '17.954729999999998',
   'Offset': '0',
   'CollectionAngleRange': {'begin': '0', 'end': '0.029320892016213126'}},
  'Detector-1': {'DetectorName': 'BM-Ceta',
   'DetectorType': 'ImagingDetector',
   'ExposureMode': '',
   'Binning': {'width': '2', 'height': '2'},
   'ReadOutArea': {'left': '768',
    'top': '768',
    'right': '1280',
    'bottom': '1280'},
   'ExposureTime': '0.20000000000000001',
   'Shutters': {'Shutter-0': {'Position': 'PreSpecimen',
     'Type': 'Electrostatic'}},
   'DarkGainCorrectionType': '3'},
  'Detector-2': {'DetectorName': 'DF-S',
   'DetectorType': 'ScanningDetector',
   'Inserted': 'false',
   'Enabled': 'true',
   'Gain': '27.424710000000019',
   'Offset': '0',
   'CollectionAngleRange': {'begin': '0', 'end': '0'}},
  'Detector-3': {'DetectorName': 'EF-CCD',
   'DetectorType': 'ImagingDetector',
   'ExposureMode': '',
   'Binning': {'width': '2', 'height': '2'},
   'ReadOutArea': {'left': '768',
    'top': '768',
    'right': '1280',
    'bottom': '1280'},
   'ExposureTime': '0.20000000000000001',
   'Shutters': {'Shutter-0': {'Position': 'PreSpecimen',
     'Type': 'Electrostatic'}},
   'DarkGainCorrectionType': '3'},
  'Detector-4': {'DetectorName': 'Flucam',
   'DetectorType': 'ImagingDetector',
   'ExposureMode': '',
   'Gain': '0.69999999999999996',
   'Binning': {'width': '2', 'height': '2'},
   'ReadOutArea': {'left': '0', 'top': '0', 'right': '512', 'bottom': '512'},
   'ExposureTime': '0.025000000000000001',
   'Shutters': {'Shutter-0': {'Position': 'None', 'Type': 'Electrostatic'}},
   'DarkGainCorrectionType': '3'},
  'Detector-5': {'DetectorName': 'HAADF',
   'DetectorType': 'ScanningDetector',
   'Inserted': 'true',
   'Enabled': 'true',
   'Gain': '16.493993679975603',
   'Offset': '-1.752',
   'CollectionAngleRange': {'begin': '0.072878546905260952',
    'end': '0.20000000000000001'}},
  'Detector-6': {'DetectorName': 'SuperXG21',
   'DetectorType': 'AnalyticalDetector',
   'Inserted': 'true',
   'Enabled': 'true',
   'ElevationAngle': '0.31415926999999999',
   'AzimuthAngle': '0.78539816339744828',
   'CollectionAngle': '0.69999999999999996',
   'Dispersion': '5',
   'PulseProcessTime': '3.0000000000000001e-06',
   'RealTime': '5.4938558500000001',
   'LiveTime': '4.352944742641971',
   'InputCountRate': '27397',
   'OutputCountRate': '21037',
   'AnalyticalDetectorShutterState': '4',
   'OffsetEnergy': '-250',
   'ElectronicsNoise': '25.359999999999999',
   'BeginEnergy': '120'},
  'Detector-7': {'DetectorName': 'SuperXG22',
   'DetectorType': 'AnalyticalDetector',
   'Inserted': 'true',
   'Enabled': 'true',
   'ElevationAngle': '0.31415926999999999',
   'AzimuthAngle': '2.3561944901923448',
   'CollectionAngle': '0.69999999999999996',
   'Dispersion': '5',
   'PulseProcessTime': '3.0000000000000001e-06',
   'RealTime': '5.4699942500000001',
   'LiveTime': '4.5494709282222434',
   'InputCountRate': '21730',
   'OutputCountRate': '17668',
   'AnalyticalDetectorShutterState': '4',
   'OffsetEnergy': '-250',
   'ElectronicsNoise': '25.170000000000002',
   'BeginEnergy': '120'},
  'Detector-8': {'DetectorName': 'SuperXG23',
   'DetectorType': 'AnalyticalDetector',
   'Inserted': 'true',
   'Enabled': 'true',
   'ElevationAngle': '0.31415926999999999',
   'AzimuthAngle': '3.9269908169872414',
   'CollectionAngle': '0.69999999999999996',
   'Dispersion': '5',
   'PulseProcessTime': '3.0000000000000001e-06',
   'RealTime': '5.4885608750000001',
   'LiveTime': '4.422507155096473',
   'InputCountRate': '22869',
   'OutputCountRate': '17915',
   'AnalyticalDetectorShutterState': '4',
   'OffsetEnergy': '-250',
   'ElectronicsNoise': '24.350000000000001',
   'BeginEnergy': '120'},
  'Detector-9': {'DetectorName': 'SuperXG24',
   'DetectorType': 'AnalyticalDetector',
   'Inserted': 'true',
   'Enabled': 'true',
   'ElevationAngle': '0.31415926999999999',
   'AzimuthAngle': '5.497787143782138',
   'CollectionAngle': '0.69999999999999996',
   'Dispersion': '5',
   'PulseProcessTime': '3.0000000000000001e-06',
   'RealTime': '5.4942633499999998',
   'LiveTime': '4.3318415522913698',
   'InputCountRate': '28552',
   'OutputCountRate': '21906',
   'AnalyticalDetectorShutterState': '4',
   'OffsetEnergy': '-250',
   'ElectronicsNoise': '25.460000000000001',
   'BeginEnergy': '120'}},
 'BinaryResult': {'AcquisitionUnit': '',
  'CompositionType': '',
  'DetectorIndex': '0',
  'Detector': 'BF-S',
  'PixelSize': {'width': '5.8769750156069458e-09',
   'height': '5.8769750156069458e-09'},
  'PixelUnitX': 'm',
  'PixelUnitY': 'm',
  'Offset': {'x': '0', 'y': '0'},
  'IntensityScale': '5.4389686385356711e-14',
  'IntensityUnit': 'A',
  'IntensityOffset': '-2.2278015543442109e-10',
  'Encoding': ''},
 'Sample': '',
 'GasInjectionSystems': '',
 'CustomProperties': {'Aperture[C1].Name': {'type': 'string', 'value': '2000'},
  'Aperture[C2].Name': {'type': 'string', 'value': '70'},
  'Aperture[C3].Name': {'type': 'string', 'value': '2000'},
  'Aperture[OBJ].Name': {'type': 'string', 'value': 'None'},
  'Aperture[SA].Name': {'type': 'string', 'value': 'None'},
  'BinaryResult.AcquisitionArea.bottom': {'type': 'double', 'value': '1'},
  'BinaryResult.AcquisitionArea.left': {'type': 'double', 'value': '0'},
  'BinaryResult.AcquisitionArea.right': {'type': 'double', 'value': '1'},
  'BinaryResult.AcquisitionArea.top': {'type': 'double', 'value': '0'},
  'Detectors[EF-CCD].CommercialName': {'type': 'string',
   'value': 'Continuum 1065'},
  'Detectors[EF-CCD].ElectronCounted': {'type': 'bool', 'value': '0'},
  'Detectors[Fluscreen].Inserted': {'type': 'bool', 'value': '0'},
  'Detectors[SuperXG21].BilatThresholdHi': {'type': 'double',
   'value': '0.0050390000000000001'},
  'Detectors[SuperXG21].CommercialName': {'type': 'string',
   'value': 'Super-X G2'},
  'Detectors[SuperXG21].DetectorConfigID': {'type': 'string',
   'value': '3101e35a-08ec-4b3d-9108-6aa5d0e49281'},
  'Detectors[SuperXG21].DistanceToSample': {'type': 'double',
   'value': '12.42'},
  'Detectors[SuperXG21].IncidentAngle': {'type': 'double',
   'value': '0.094596840000000001'},
  'Detectors[SuperXG21].KMax': {'type': 'double', 'value': '180'},
  'Detectors[SuperXG21].KMin': {'type': 'double', 'value': '120'},
  'Detectors[SuperXG21].PulsePairResolutionTime': {'type': 'double',
   'value': '4.9999999999999998e-07'},
  'Detectors[SuperXG21].SpectrumBeginEnergy': {'type': 'long', 'value': '120'},
  'Detectors[SuperXG22].BilatThresholdHi': {'type': 'double',
   'value': '0.0050390000000000001'},
  'Detectors[SuperXG22].CommercialName': {'type': 'string',
   'value': 'Super-X G2'},
  'Detectors[SuperXG22].DetectorConfigID': {'type': 'string',
   'value': '3101e35a-08ec-4b3d-9108-6aa5d0e49281'},
  'Detectors[SuperXG22].DistanceToSample': {'type': 'double',
   'value': '12.42'},
  'Detectors[SuperXG22].IncidentAngle': {'type': 'double',
   'value': '0.094596840000000001'},
  'Detectors[SuperXG22].KMax': {'type': 'double', 'value': '180'},
  'Detectors[SuperXG22].KMin': {'type': 'double', 'value': '120'},
  'Detectors[SuperXG22].PulsePairResolutionTime': {'type': 'double',
   'value': '4.9999999999999998e-07'},
  'Detectors[SuperXG22].SpectrumBeginEnergy': {'type': 'long', 'value': '120'},
  'Detectors[SuperXG23].BilatThresholdHi': {'type': 'double',
   'value': '0.0050390000000000001'},
  'Detectors[SuperXG23].CommercialName': {'type': 'string',
   'value': 'Super-X G2'},
  'Detectors[SuperXG23].DetectorConfigID': {'type': 'string',
   'value': '3101e35a-08ec-4b3d-9108-6aa5d0e49281'},
  'Detectors[SuperXG23].DistanceToSample': {'type': 'double',
   'value': '12.42'},
  'Detectors[SuperXG23].IncidentAngle': {'type': 'double',
   'value': '0.094596840000000001'},
  'Detectors[SuperXG23].KMax': {'type': 'double', 'value': '180'},
  'Detectors[SuperXG23].KMin': {'type': 'double', 'value': '120'},
  'Detectors[SuperXG23].PulsePairResolutionTime': {'type': 'double',
   'value': '4.9999999999999998e-07'},
  'Detectors[SuperXG23].SpectrumBeginEnergy': {'type': 'long', 'value': '120'},
  'Detectors[SuperXG24].BilatThresholdHi': {'type': 'double',
   'value': '0.0050390000000000001'},
  'Detectors[SuperXG24].CommercialName': {'type': 'string',
   'value': 'Super-X G2'},
  'Detectors[SuperXG24].DetectorConfigID': {'type': 'string',
   'value': '3101e35a-08ec-4b3d-9108-6aa5d0e49281'},
  'Detectors[SuperXG24].DistanceToSample': {'type': 'double',
   'value': '12.42'},
  'Detectors[SuperXG24].IncidentAngle': {'type': 'double',
   'value': '0.094596840000000001'},
  'Detectors[SuperXG24].KMax': {'type': 'double', 'value': '180'},
  'Detectors[SuperXG24].KMin': {'type': 'double', 'value': '120'},
  'Detectors[SuperXG24].PulsePairResolutionTime': {'type': 'double',
   'value': '4.9999999999999998e-07'},
  'Detectors[SuperXG24].SpectrumBeginEnergy': {'type': 'long', 'value': '120'},
  'Optics.BeamBlanked': {'type': 'bool', 'value': '0'},
  'Optics.MonoSpotSize': {'type': 'string', 'value': '<=11'},
  'Scan.ScanTransformation.A11': {'type': 'double', 'value': '1'},
  'Scan.ScanTransformation.A12': {'type': 'double', 'value': '0'},
  'Scan.ScanTransformation.A13': {'type': 'double', 'value': '0'},
  'Scan.ScanTransformation.A21': {'type': 'double', 'value': '0'},
  'Scan.ScanTransformation.A22': {'type': 'double', 'value': '1'},
  'Scan.ScanTransformation.A23': {'type': 'double', 'value': '0'},
  'StemMagnification': {'type': 'double', 'value': '7100'},
  'Vacuum.ValvesOpen': {'type': 'bool', 'value': '1'},
  'Velox.Series.FrameNumber': {'type': 'long', 'value': '1'}}}
data_array = h5_file['SharedProperties']['EDSSpectrumQuantificationSettings']['c87c8b86325b44e29d8bc5876a408b8f']
data_array[0].decode("utf-8")
'{"absorptionCorrection": {"density": 1, "enabled": false, "sampleThickness": 4.9999999999999998e-08, "useDensity": false}, "backgroundCorrection": "/SharedProperties/BackgroundCorrection/bbe110b945fc4f28b3044a5a110c4da2", "backgroundWindows": "/SharedProperties/BackgroundWindows/17b8ab62e108485ab797579d7313bdc0", "elementProperties": [{"atomicShellFamily": "K", "defaultLineSelect": true, "element": 0, "includeInAutoPeakId": true, "quantify": true}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 1, "includeInAutoPeakId": true, "quantify": true}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 2, "includeInAutoPeakId": true, "quantify": true}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 3, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 4, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 5, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 6, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 7, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 8, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 9, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 10, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 11, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 12, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 13, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 14, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 15, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 16, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 17, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 18, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 19, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}, {"from": "L2", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 20, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}, {"from": "L2", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 21, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}, {"from": "L2", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 22, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}, {"from": "L2", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 23, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}, {"from": "L2", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 24, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}, {"from": "L2", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 25, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}, {"from": "L2", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 26, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}, {"from": "L2", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 27, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}, {"from": "L2", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 28, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}, {"from": "L2", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 29, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}, {"from": "L2", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 30, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}, {"from": "L2", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 31, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}, {"from": "L2", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 32, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}, {"from": "L2", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 33, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}, {"from": "L2", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 34, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}, {"from": "L2", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 35, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}, {"from": "L2", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 36, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}, {"from": "L2", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 37, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}, {"from": "L2", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 38, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}, {"from": "L2", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 39, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}, {"from": "L2", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 40, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}, {"from": "L2", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 41, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}, {"from": "L2", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 42, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}, {"from": "L2", "to": "K"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 43, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "L3", "to": "K"}, {"from": "L2", "to": "K"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 44, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 45, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 46, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 47, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 48, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 49, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 50, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 51, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 52, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 53, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 54, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 55, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 56, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 57, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 58, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 59, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 60, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 61, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 62, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 63, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 64, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 65, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 66, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 67, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 68, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 69, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 70, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 71, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 72, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 73, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 74, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 75, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 76, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 77, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 78, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 79, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 80, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 81, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 82, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 83, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 84, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 85, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 86, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 87, "includeInAutoPeakId": true, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 88, "includeInAutoPeakId": false, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 89, "includeInAutoPeakId": false, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 90, "includeInAutoPeakId": false, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 91, "includeInAutoPeakId": false, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 92, "includeInAutoPeakId": false, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 93, "includeInAutoPeakId": false, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 94, "includeInAutoPeakId": false, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "L", "defaultLineSelect": true, "element": 95, "includeInAutoPeakId": false, "quantify": true, "xrayTransitions": [{"from": "M5", "to": "L3"}, {"from": "M4", "to": "L3"}]}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 96, "includeInAutoPeakId": true, "quantify": true}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 97, "includeInAutoPeakId": true, "quantify": true}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 98, "includeInAutoPeakId": true, "quantify": true}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 99, "includeInAutoPeakId": true, "quantify": true}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 100, "includeInAutoPeakId": true, "quantify": true}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 101, "includeInAutoPeakId": true, "quantify": true}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 102, "includeInAutoPeakId": true, "quantify": true}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 103, "includeInAutoPeakId": true, "quantify": true}, {"atomicShellFamily": "K", "defaultLineSelect": true, "element": 104, "includeInAutoPeakId": true, "quantify": true}], "elementSelection": [24, 26, 6, 78], "ionizationCrossSectionModel": "BrownPowell", "metadata": "{\\n    \\"Core\\": {\\n        \\"MetadataDefinitionVersion\\": \\"7.9\\",\\n        \\"MetadataSchemaVersion\\": \\"v1\\\\/2013\\\\/07\\",\\n        \\"guid\\": \\"00000000000000000000000000000000\\"\\n    },\\n    \\"Instrument\\": {\\n        \\"ControlSoftwareVersion\\": \\"3.21.1\\",\\n        \\"Manufacturer\\": \\"FEI Company\\",\\n        \\"InstrumentId\\": \\"4018\\",\\n        \\"InstrumentClass\\": \\"Titan\\",\\n        \\"InstrumentModel\\": \\"Spectra\\",\\n        \\"ComputerName\\": \\"TITAN52340180\\"\\n    },\\n    \\"Acquisition\\": {\\n        \\"AcquisitionStartDatetime\\": {\\n            \\"DateTime\\": \\"1751400967\\"\\n        },\\n        \\"AcquisitionDatetime\\": {\\n            \\"DateTime\\": \\"0\\"\\n        },\\n        \\"BeamType\\": \\"\\",\\n        \\"SourceType\\": \\"XFEG\\"\\n    },\\n    \\"Optics\\": {\\n        \\"GunLensSetting\\": \\"777.25067138671875\\",\\n        \\"ExtractorVoltage\\": \\"3600.03662109375\\",\\n        \\"AccelerationVoltage\\": \\"200000\\",\\n        \\"SpotIndex\\": \\"7\\",\\n        \\"C1LensIntensity\\": \\"-0.45199774718761859\\",\\n        \\"C2LensIntensity\\": \\"0.19410951924463052\\",\\n        \\"C3LensIntensity\\": \\"0.35430084129721517\\",\\n        \\"ObjectiveLensIntensity\\": \\"0.82398502199325219\\",\\n        \\"IntermediateLensIntensity\\": \\"0.060336265199823894\\",\\n        \\"DiffractionLensIntensity\\": \\"0.19139078553472397\\",\\n        \\"Projector1LensIntensity\\": \\"0.28091570010789807\\",\\n        \\"Projector2LensIntensity\\": \\"0.91034079367771092\\",\\n        \\"LorentzLensIntensity\\": \\"0\\",\\n        \\"MiniCondenserLensIntensity\\": \\"0.34343613593964234\\",\\n        \\"BeamConvergence\\": \\"0.030030056394484476\\",\\n        \\"ScreenCurrent\\": \\"0\\",\\n        \\"LastMeasuredScreenCurrent\\": \\"2.7559210169449673e-10\\",\\n        \\"FullScanFieldOfView\\": {\\n            \\"x\\": \\"1.2036044831963025e-05\\",\\n            \\"y\\": \\"1.2036044831963025e-05\\"\\n        },\\n        \\"Focus\\": \\"5.0366599727198754e-08\\",\\n        \\"StemFocus\\": \\"0\\",\\n        \\"Defocus\\": \\"5.0366599727198754e-08\\",\\n        \\"HighMagnificationMode\\": \\"None\\",\\n        \\"Apertures\\": {\\n            \\"Aperture-0\\": {\\n                \\"Name\\": \\"C1\\",\\n                \\"Number\\": \\"1\\",\\n                \\"MechanismType\\": \\"Motorized\\",\\n                \\"Type\\": \\"Circular\\",\\n                \\"Diameter\\": \\"0.002\\",\\n                \\"Enabled\\": \\"0\\"\\n            },\\n            \\"Aperture-1\\": {\\n                \\"Name\\": \\"C2\\",\\n                \\"Number\\": \\"2\\",\\n                \\"MechanismType\\": \\"Motorized\\",\\n                \\"Type\\": \\"Circular\\",\\n                \\"Diameter\\": \\"6.9999999999999994e-05\\",\\n                \\"Enabled\\": \\"1\\"\\n            },\\n            \\"Aperture-2\\": {\\n                \\"Name\\": \\"C3\\",\\n                \\"Number\\": \\"3\\",\\n                \\"MechanismType\\": \\"Motorized\\",\\n                \\"Type\\": \\"Circular\\",\\n                \\"Diameter\\": \\"0.002\\",\\n                \\"Enabled\\": \\"0\\"\\n            },\\n            \\"Aperture-3\\": {\\n                \\"Name\\": \\"OBJ\\",\\n                \\"Number\\": \\"4\\",\\n                \\"MechanismType\\": \\"Motorized\\",\\n                \\"Type\\": \\"None\\"\\n            },\\n            \\"Aperture-4\\": {\\n                \\"Name\\": \\"SA\\",\\n                \\"Number\\": \\"5\\",\\n                \\"MechanismType\\": \\"Motorized\\",\\n                \\"Type\\": \\"None\\"\\n            }\\n        },\\n        \\"OperatingMode\\": \\"2\\",\\n        \\"TemOperatingSubMode\\": \\"None\\",\\n        \\"ProjectorMode\\": \\"1\\",\\n        \\"EFTEMOn\\": \\"false\\",\\n        \\"ObjectiveLensMode\\": \\"HM\\",\\n        \\"IlluminationMode\\": \\"Probe\\",\\n        \\"ProbeMode\\": \\"1\\",\\n        \\"CameraLength\\": \\"0.090999999999999998\\"\\n    },\\n    \\"EnergyFilter\\": {\\n        \\"EntranceApertureType\\": \\"\\"\\n    },\\n    \\"Stage\\": {\\n        \\"Position\\": {\\n            \\"x\\": \\"0.00024802175999999985\\",\\n            \\"y\\": \\"-1.6016556000000025e-05\\",\\n            \\"z\\": \\"-0.00013106427\\"\\n        },\\n        \\"AlphaTilt\\": \\"9.9067999999933112e-05\\",\\n        \\"BetaTilt\\": \\"-0.00028813874814659357\\",\\n        \\"HolderType\\": \\"FEI Double Tilt\\"\\n    },\\n    \\"Scan\\": {\\n        \\"ScanSize\\": {\\n            \\"width\\": \\"2048\\",\\n            \\"height\\": \\"2048\\"\\n        },\\n        \\"DwellTime\\": \\"2.0000000000000002e-05\\",\\n        \\"ScanArea\\": {\\n            \\"left\\": \\"0.525390625\\",\\n            \\"top\\": \\"0.12451171875\\",\\n            \\"right\\": \\"0.6083984375\\",\\n            \\"bottom\\": \\"0.91357421875\\"\\n        },\\n        \\"MainsLockOn\\": \\"false\\",\\n        \\"LineTime\\": \\"0.0035200000000000001\\",\\n        \\"LineIntegrationCount\\": \\"1\\",\\n        \\"LineInterlacing\\": \\"1\\",\\n        \\"FrameTime\\": \\"5.68832\\",\\n        \\"ScanRotation\\": \\"-2.5529513989856394\\"\\n    },\\n    \\"Vacuum\\": {\\n        \\"VacuumMode\\": \\"Ready\\"\\n    },\\n    \\"Detectors\\": {\\n        \\"Detector-0\\": {\\n            \\"DetectorName\\": \\"BF-S\\",\\n            \\"DetectorType\\": \\"ScanningDetector\\",\\n            \\"Inserted\\": \\"true\\",\\n            \\"Enabled\\": \\"true\\",\\n            \\"Gain\\": \\"17.954729999999998\\",\\n            \\"Offset\\": \\"0\\",\\n            \\"CollectionAngleRange\\": {\\n                \\"begin\\": \\"0\\",\\n                \\"end\\": \\"0.029320892016213126\\"\\n            }\\n        },\\n        \\"Detector-1\\": {\\n            \\"DetectorName\\": \\"BM-Ceta\\",\\n            \\"DetectorType\\": \\"ImagingDetector\\",\\n            \\"ExposureMode\\": \\"\\",\\n            \\"Binning\\": {\\n                \\"width\\": \\"2\\",\\n                \\"height\\": \\"2\\"\\n            },\\n            \\"ReadOutArea\\": {\\n                \\"left\\": \\"768\\",\\n                \\"top\\": \\"768\\",\\n                \\"right\\": \\"1280\\",\\n                \\"bottom\\": \\"1280\\"\\n            },\\n            \\"ExposureTime\\": \\"0.20000000000000001\\",\\n            \\"Shutters\\": {\\n                \\"Shutter-0\\": {\\n                    \\"Position\\": \\"PreSpecimen\\",\\n                    \\"Type\\": \\"Electrostatic\\"\\n                }\\n            },\\n            \\"DarkGainCorrectionType\\": \\"3\\"\\n        },\\n        \\"Detector-2\\": {\\n            \\"DetectorName\\": \\"DF-S\\",\\n            \\"DetectorType\\": \\"ScanningDetector\\",\\n            \\"Inserted\\": \\"false\\",\\n            \\"Enabled\\": \\"true\\",\\n            \\"Gain\\": \\"27.424710000000019\\",\\n            \\"Offset\\": \\"0\\",\\n            \\"CollectionAngleRange\\": {\\n                \\"begin\\": \\"0\\",\\n                \\"end\\": \\"0\\"\\n            }\\n        },\\n        \\"Detector-3\\": {\\n            \\"DetectorName\\": \\"EF-CCD\\",\\n            \\"DetectorType\\": \\"ImagingDetector\\",\\n            \\"ExposureMode\\": \\"\\",\\n            \\"Binning\\": {\\n                \\"width\\": \\"2\\",\\n                \\"height\\": \\"2\\"\\n            },\\n            \\"ReadOutArea\\": {\\n                \\"left\\": \\"768\\",\\n                \\"top\\": \\"768\\",\\n                \\"right\\": \\"1280\\",\\n                \\"bottom\\": \\"1280\\"\\n            },\\n            \\"ExposureTime\\": \\"0.20000000000000001\\",\\n            \\"Shutters\\": {\\n                \\"Shutter-0\\": {\\n                    \\"Position\\": \\"PreSpecimen\\",\\n                    \\"Type\\": \\"Electrostatic\\"\\n                }\\n            },\\n            \\"DarkGainCorrectionType\\": \\"3\\"\\n        },\\n        \\"Detector-4\\": {\\n            \\"DetectorName\\": \\"Flucam\\",\\n            \\"DetectorType\\": \\"ImagingDetector\\",\\n            \\"ExposureMode\\": \\"\\",\\n            \\"Gain\\": \\"0.69999999999999996\\",\\n            \\"Binning\\": {\\n                \\"width\\": \\"2\\",\\n                \\"height\\": \\"2\\"\\n            },\\n            \\"ReadOutArea\\": {\\n                \\"left\\": \\"0\\",\\n                \\"top\\": \\"0\\",\\n                \\"right\\": \\"512\\",\\n                \\"bottom\\": \\"512\\"\\n            },\\n            \\"ExposureTime\\": \\"0.025000000000000001\\",\\n            \\"Shutters\\": {\\n                \\"Shutter-0\\": {\\n                    \\"Position\\": \\"None\\",\\n                    \\"Type\\": \\"Electrostatic\\"\\n                }\\n            },\\n            \\"DarkGainCorrectionType\\": \\"3\\"\\n        },\\n        \\"Detector-5\\": {\\n            \\"DetectorName\\": \\"HAADF\\",\\n            \\"DetectorType\\": \\"ScanningDetector\\",\\n            \\"Inserted\\": \\"true\\",\\n            \\"Enabled\\": \\"true\\",\\n            \\"Gain\\": \\"16.493993679975603\\",\\n            \\"Offset\\": \\"-1.752\\",\\n            \\"CollectionAngleRange\\": {\\n                \\"begin\\": \\"0.072878546905260952\\",\\n                \\"end\\": \\"0.20000000000000001\\"\\n            }\\n        },\\n        \\"Detector-6\\": {\\n            \\"DetectorName\\": \\"SuperXG21\\",\\n            \\"DetectorType\\": \\"AnalyticalDetector\\",\\n            \\"Inserted\\": \\"true\\",\\n            \\"Enabled\\": \\"true\\",\\n            \\"ElevationAngle\\": \\"0.31415926999999999\\",\\n            \\"AzimuthAngle\\": \\"0.78539816339744828\\",\\n            \\"CollectionAngle\\": \\"0.69999999999999996\\",\\n            \\"Dispersion\\": \\"5\\",\\n            \\"PulseProcessTime\\": \\"3.0000000000000001e-06\\",\\n            \\"RealTime\\": \\"3345.764639425\\",\\n            \\"LiveTime\\": \\"2646.7871848478562\\",\\n            \\"InputCountRate\\": \\"18642\\",\\n            \\"OutputCountRate\\": \\"16154\\",\\n            \\"AnalyticalDetectorShutterState\\": \\"4\\",\\n            \\"OffsetEnergy\\": \\"-250\\",\\n            \\"ElectronicsNoise\\": \\"25.359999999999999\\",\\n            \\"BeginEnergy\\": \\"120\\"\\n        },\\n        \\"Detector-7\\": {\\n            \\"DetectorName\\": \\"SuperXG22\\",\\n            \\"DetectorType\\": \\"AnalyticalDetector\\",\\n            \\"Inserted\\": \\"true\\",\\n            \\"Enabled\\": \\"true\\",\\n            \\"ElevationAngle\\": \\"0.31415926999999999\\",\\n            \\"AzimuthAngle\\": \\"2.3561944901923448\\",\\n            \\"CollectionAngle\\": \\"0.69999999999999996\\",\\n            \\"Dispersion\\": \\"5\\",\\n            \\"PulseProcessTime\\": \\"3.0000000000000001e-06\\",\\n            \\"RealTime\\": \\"3345.9598733499997\\",\\n            \\"LiveTime\\": \\"2763.9259184939579\\",\\n            \\"InputCountRate\\": \\"16677\\",\\n            \\"OutputCountRate\\": \\"14755\\",\\n            \\"AnalyticalDetectorShutterState\\": \\"4\\",\\n            \\"OffsetEnergy\\": \\"-250\\",\\n            \\"ElectronicsNoise\\": \\"25.170000000000002\\",\\n            \\"BeginEnergy\\": \\"120\\"\\n        },\\n        \\"Detector-8\\": {\\n            \\"DetectorName\\": \\"SuperXG23\\",\\n            \\"DetectorType\\": \\"AnalyticalDetector\\",\\n            \\"Inserted\\": \\"true\\",\\n            \\"Enabled\\": \\"true\\",\\n            \\"ElevationAngle\\": \\"0.31415926999999999\\",\\n            \\"AzimuthAngle\\": \\"3.9269908169872414\\",\\n            \\"CollectionAngle\\": \\"0.69999999999999996\\",\\n            \\"Dispersion\\": \\"5\\",\\n            \\"PulseProcessTime\\": \\"3.0000000000000001e-06\\",\\n            \\"RealTime\\": \\"3345.981236225\\",\\n            \\"LiveTime\\": \\"2686.8794048275386\\",\\n            \\"InputCountRate\\": \\"17646\\",\\n            \\"OutputCountRate\\": \\"15211\\",\\n            \\"AnalyticalDetectorShutterState\\": \\"4\\",\\n            \\"OffsetEnergy\\": \\"-250\\",\\n            \\"ElectronicsNoise\\": \\"24.350000000000001\\",\\n            \\"BeginEnergy\\": \\"120\\"\\n        },\\n        \\"Detector-9\\": {\\n            \\"DetectorName\\": \\"SuperXG24\\",\\n            \\"DetectorType\\": \\"AnalyticalDetector\\",\\n            \\"Inserted\\": \\"true\\",\\n            \\"Enabled\\": \\"true\\",\\n            \\"ElevationAngle\\": \\"0.31415926999999999\\",\\n            \\"AzimuthAngle\\": \\"5.497787143782138\\",\\n            \\"CollectionAngle\\": \\"0.69999999999999996\\",\\n            \\"Dispersion\\": \\"5\\",\\n            \\"PulseProcessTime\\": \\"3.0000000000000001e-06\\",\\n            \\"RealTime\\": \\"3346.0080250249998\\",\\n            \\"LiveTime\\": \\"2625.9493035398286\\",\\n            \\"InputCountRate\\": \\"19414\\",\\n            \\"OutputCountRate\\": \\"16878\\",\\n            \\"AnalyticalDetectorShutterState\\": \\"4\\",\\n            \\"OffsetEnergy\\": \\"-250\\",\\n            \\"ElectronicsNoise\\": \\"25.460000000000001\\",\\n            \\"BeginEnergy\\": \\"120\\"\\n        }\\n    },\\n    \\"BinaryResult\\": {\\n        \\"AcquisitionUnit\\": \\"\\",\\n        \\"CompositionType\\": \\"\\",\\n        \\"Detector\\": \\"SuperXG2\\",\\n        \\"PixelSize\\": {\\n            \\"width\\": \\"5.8769750156069458e-09\\",\\n            \\"height\\": \\"5.8769750156069458e-09\\"\\n        },\\n        \\"PixelUnitX\\": \\"m\\",\\n        \\"PixelUnitY\\": \\"m\\",\\n        \\"Offset\\": {\\n            \\"x\\": \\"1.8630010799474019e-06\\",\\n            \\"y\\": \\"-1.6866918294791934e-06\\"\\n        },\\n        \\"Encoding\\": \\"\\"\\n    },\\n    \\"Sample\\": \\"\\",\\n    \\"GasInjectionSystems\\": \\"\\",\\n    \\"CustomProperties\\": {\\n        \\"Aperture[C1].Name\\": {\\n            \\"type\\": \\"string\\",\\n            \\"value\\": \\"2000\\"\\n        },\\n        \\"Aperture[C2].Name\\": {\\n            \\"type\\": \\"string\\",\\n            \\"value\\": \\"70\\"\\n        },\\n        \\"Aperture[C3].Name\\": {\\n            \\"type\\": \\"string\\",\\n            \\"value\\": \\"2000\\"\\n        },\\n        \\"Aperture[OBJ].Name\\": {\\n            \\"type\\": \\"string\\",\\n            \\"value\\": \\"None\\"\\n        },\\n        \\"Aperture[SA].Name\\": {\\n            \\"type\\": \\"string\\",\\n            \\"value\\": \\"None\\"\\n        },\\n        \\"Detectors[EF-CCD].CommercialName\\": {\\n            \\"type\\": \\"string\\",\\n            \\"value\\": \\"Continuum 1065\\"\\n        },\\n        \\"Detectors[EF-CCD].ElectronCounted\\": {\\n            \\"type\\": \\"bool\\",\\n            \\"value\\": \\"0\\"\\n        },\\n        \\"Detectors[SuperXG21].BilatThresholdHi\\": {\\n            \\"type\\": \\"double\\",\\n            \\"value\\": \\"0.0050390000000000001\\"\\n        },\\n        \\"Detectors[SuperXG21].CommercialName\\": {\\n            \\"type\\": \\"string\\",\\n            \\"value\\": \\"Super-X G2\\"\\n        },\\n        \\"Detectors[SuperXG21].DetectorConfigID\\": {\\n            \\"type\\": \\"string\\",\\n            \\"value\\": \\"3101e35a-08ec-4b3d-9108-6aa5d0e49281\\"\\n        },\\n        \\"Detectors[SuperXG21].DistanceToSample\\": {\\n            \\"type\\": \\"double\\",\\n            \\"value\\": \\"12.42\\"\\n        },\\n        \\"Detectors[SuperXG21].IncidentAngle\\": {\\n            \\"type\\": \\"double\\",\\n            \\"value\\": \\"0.094596840000000001\\"\\n        },\\n        \\"Detectors[SuperXG21].KMax\\": {\\n            \\"type\\": \\"double\\",\\n            \\"value\\": \\"180\\"\\n        },\\n        \\"Detectors[SuperXG21].KMin\\": {\\n            \\"type\\": \\"double\\",\\n            \\"value\\": \\"120\\"\\n        },\\n        \\"Detectors[SuperXG21].PulsePairResolutionTime\\": {\\n            \\"type\\": \\"double\\",\\n            \\"value\\": \\"4.9999999999999998e-07\\"\\n        },\\n        \\"Detectors[SuperXG21].Selected\\": {\\n            \\"type\\": \\"bool\\",\\n            \\"value\\": \\"1\\"\\n        },\\n        \\"Detectors[SuperXG21].SpectrumBeginEnergy\\": {\\n            \\"type\\": \\"long\\",\\n            \\"value\\": \\"120\\"\\n        },\\n        \\"Detectors[SuperXG22].BilatThresholdHi\\": {\\n            \\"type\\": \\"double\\",\\n            \\"value\\": \\"0.0050390000000000001\\"\\n        },\\n        \\"Detectors[SuperXG22].CommercialName\\": {\\n            \\"type\\": \\"string\\",\\n            \\"value\\": \\"Super-X G2\\"\\n        },\\n        \\"Detectors[SuperXG22].DetectorConfigID\\": {\\n            \\"type\\": \\"string\\",\\n            \\"value\\": \\"3101e35a-08ec-4b3d-9108-6aa5d0e49281\\"\\n        },\\n        \\"Detectors[SuperXG22].DistanceToSample\\": {\\n            \\"type\\": \\"double\\",\\n            \\"value\\": \\"12.42\\"\\n        },\\n        \\"Detectors[SuperXG22].IncidentAngle\\": {\\n            \\"type\\": \\"double\\",\\n            \\"value\\": \\"0.094596840000000001\\"\\n        },\\n        \\"Detectors[SuperXG22].KMax\\": {\\n            \\"type\\": \\"double\\",\\n            \\"value\\": \\"180\\"\\n        },\\n        \\"Detectors[SuperXG22].KMin\\": {\\n            \\"type\\": \\"double\\",\\n            \\"value\\": \\"120\\"\\n        },\\n        \\"Detectors[SuperXG22].PulsePairResolutionTime\\": {\\n            \\"type\\": \\"double\\",\\n            \\"value\\": \\"4.9999999999999998e-07\\"\\n        },\\n        \\"Detectors[SuperXG22].Selected\\": {\\n            \\"type\\": \\"bool\\",\\n            \\"value\\": \\"1\\"\\n        },\\n        \\"Detectors[SuperXG22].SpectrumBeginEnergy\\": {\\n            \\"type\\": \\"long\\",\\n            \\"value\\": \\"120\\"\\n        },\\n        \\"Detectors[SuperXG23].BilatThresholdHi\\": {\\n            \\"type\\": \\"double\\",\\n            \\"value\\": \\"0.0050390000000000001\\"\\n        },\\n        \\"Detectors[SuperXG23].CommercialName\\": {\\n            \\"type\\": \\"string\\",\\n            \\"value\\": \\"Super-X G2\\"\\n        },\\n        \\"Detectors[SuperXG23].DetectorConfigID\\": {\\n            \\"type\\": \\"string\\",\\n            \\"value\\": \\"3101e35a-08ec-4b3d-9108-6aa5d0e49281\\"\\n        },\\n        \\"Detectors[SuperXG23].DistanceToSample\\": {\\n            \\"type\\": \\"double\\",\\n            \\"value\\": \\"12.42\\"\\n        },\\n        \\"Detectors[SuperXG23].IncidentAngle\\": {\\n            \\"type\\": \\"double\\",\\n            \\"value\\": \\"0.094596840000000001\\"\\n        },\\n        \\"Detectors[SuperXG23].KMax\\": {\\n            \\"type\\": \\"double\\",\\n            \\"value\\": \\"180\\"\\n        },\\n        \\"Detectors[SuperXG23].KMin\\": {\\n            \\"type\\": \\"double\\",\\n            \\"value\\": \\"120\\"\\n        },\\n        \\"Detectors[SuperXG23].PulsePairResolutionTime\\": {\\n            \\"type\\": \\"double\\",\\n            \\"value\\": \\"4.9999999999999998e-07\\"\\n        },\\n        \\"Detectors[SuperXG23].Selected\\": {\\n            \\"type\\": \\"bool\\",\\n            \\"value\\": \\"1\\"\\n        },\\n        \\"Detectors[SuperXG23].SpectrumBeginEnergy\\": {\\n            \\"type\\": \\"long\\",\\n            \\"value\\": \\"120\\"\\n        },\\n        \\"Detectors[SuperXG24].BilatThresholdHi\\": {\\n            \\"type\\": \\"double\\",\\n            \\"value\\": \\"0.0050390000000000001\\"\\n        },\\n        \\"Detectors[SuperXG24].CommercialName\\": {\\n            \\"type\\": \\"string\\",\\n            \\"value\\": \\"Super-X G2\\"\\n        },\\n        \\"Detectors[SuperXG24].DetectorConfigID\\": {\\n            \\"type\\": \\"string\\",\\n            \\"value\\": \\"3101e35a-08ec-4b3d-9108-6aa5d0e49281\\"\\n        },\\n        \\"Detectors[SuperXG24].DistanceToSample\\": {\\n            \\"type\\": \\"double\\",\\n            \\"value\\": \\"12.42\\"\\n        },\\n        \\"Detectors[SuperXG24].IncidentAngle\\": {\\n            \\"type\\": \\"double\\",\\n            \\"value\\": \\"0.094596840000000001\\"\\n        },\\n        \\"Detectors[SuperXG24].KMax\\": {\\n            \\"type\\": \\"double\\",\\n            \\"value\\": \\"180\\"\\n        },\\n        \\"Detectors[SuperXG24].KMin\\": {\\n            \\"type\\": \\"double\\",\\n            \\"value\\": \\"120\\"\\n        },\\n        \\"Detectors[SuperXG24].PulsePairResolutionTime\\": {\\n            \\"type\\": \\"double\\",\\n            \\"value\\": \\"4.9999999999999998e-07\\"\\n        },\\n        \\"Detectors[SuperXG24].Selected\\": {\\n            \\"type\\": \\"bool\\",\\n            \\"value\\": \\"1\\"\\n        },\\n        \\"Detectors[SuperXG24].SpectrumBeginEnergy\\": {\\n            \\"type\\": \\"long\\",\\n            \\"value\\": \\"120\\"\\n        },\\n        \\"Optics.MonoSpotSize\\": {\\n            \\"type\\": \\"string\\",\\n            \\"value\\": \\"<=11\\"\\n        },\\n        \\"Scan.ScanTransformation.A11\\": {\\n            \\"type\\": \\"double\\",\\n            \\"value\\": \\"1\\"\\n        },\\n        \\"Scan.ScanTransformation.A12\\": {\\n            \\"type\\": \\"double\\",\\n            \\"value\\": \\"0\\"\\n        },\\n        \\"Scan.ScanTransformation.A13\\": {\\n            \\"type\\": \\"double\\",\\n            \\"value\\": \\"0.0021895715035498142\\"\\n        },\\n        \\"Scan.ScanTransformation.A21\\": {\\n            \\"type\\": \\"double\\",\\n            \\"value\\": \\"0\\"\\n        },\\n        \\"Scan.ScanTransformation.A22\\": {\\n            \\"type\\": \\"double\\",\\n            \\"value\\": \\"1\\"\\n        },\\n        \\"Scan.ScanTransformation.A23\\": {\\n            \\"type\\": \\"double\\",\\n            \\"value\\": \\"-0.0031587188132107258\\"\\n        },\\n        \\"StemMagnification\\": {\\n            \\"type\\": \\"double\\",\\n            \\"value\\": \\"7100\\"\\n        }\\n    }\\n}\\n"}'
metadata = dict(json.loads(data_array[0].to.rstrip('\x00')))
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[124], line 1
----> 1 metadata = dict(json.loads(data_array[0].tobytes().rstrip('\x00')))

AttributeError: 'bytes' object has no attribute 'tobytes'
(h5_file['Info'])[0].decode("utf-8")
'{\n    "applicationVersion": "3.17.0.967-b5399cab"\n}\n'
h5_file['Data']['SpectrumStream']['3e8d521d544b48898e2d2947615f4933']['AcquisitionSettings'].keys()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[200], line 1
----> 1 h5_file['Data']['SpectrumStream']['3e8d521d544b48898e2d2947615f4933']['AcquisitionSettings'].keys()

AttributeError: 'Dataset' object has no attribute 'keys'
h5_file['Data']['SpectrumStream']['3e8d521d544b48898e2d2947615f4933']['Metadata']
<HDF5 dataset "Metadata": shape (60000, 609), type "|u1">
metadata_array =  h5_file['SharedProperties']['EDSSpectrumQuantificationSettings']['c87c8b86325b44e29d8bc5876a408b8f']
metadata_string = metadata_array[0].decode("utf-8")
metadata = dict(json.loads(metadata_string.rstrip('\x00')))
dict(json.loads(metadata_string.rstrip('\x00')))
metadata
{'absorptionCorrection': {'density': 1,
  'enabled': False,
  'sampleThickness': 5e-08,
  'useDensity': False},
 'backgroundCorrection': '/SharedProperties/BackgroundCorrection/bbe110b945fc4f28b3044a5a110c4da2',
 'backgroundWindows': '/SharedProperties/BackgroundWindows/17b8ab62e108485ab797579d7313bdc0',
 'elementProperties': [{'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 0,
   'includeInAutoPeakId': True,
   'quantify': True},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 1,
   'includeInAutoPeakId': True,
   'quantify': True},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 2,
   'includeInAutoPeakId': True,
   'quantify': True},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 3,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 4,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 5,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 6,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 7,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 8,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 9,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 10,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 11,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 12,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 13,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 14,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 15,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 16,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 17,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 18,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 19,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}, {'from': 'L2', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 20,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}, {'from': 'L2', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 21,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}, {'from': 'L2', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 22,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}, {'from': 'L2', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 23,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}, {'from': 'L2', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 24,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}, {'from': 'L2', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 25,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}, {'from': 'L2', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 26,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}, {'from': 'L2', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 27,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}, {'from': 'L2', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 28,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}, {'from': 'L2', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 29,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}, {'from': 'L2', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 30,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}, {'from': 'L2', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 31,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}, {'from': 'L2', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 32,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}, {'from': 'L2', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 33,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}, {'from': 'L2', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 34,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}, {'from': 'L2', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 35,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}, {'from': 'L2', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 36,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}, {'from': 'L2', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 37,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}, {'from': 'L2', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 38,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}, {'from': 'L2', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 39,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}, {'from': 'L2', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 40,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}, {'from': 'L2', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 41,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}, {'from': 'L2', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 42,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}, {'from': 'L2', 'to': 'K'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 43,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'L3', 'to': 'K'}, {'from': 'L2', 'to': 'K'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 44,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 45,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 46,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 47,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 48,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 49,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 50,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 51,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 52,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 53,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 54,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 55,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 56,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 57,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 58,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 59,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 60,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 61,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 62,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 63,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 64,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 65,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 66,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 67,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 68,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 69,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 70,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 71,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 72,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 73,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 74,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 75,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 76,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 77,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 78,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 79,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 80,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 81,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 82,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 83,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 84,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 85,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 86,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 87,
   'includeInAutoPeakId': True,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 88,
   'includeInAutoPeakId': False,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 89,
   'includeInAutoPeakId': False,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 90,
   'includeInAutoPeakId': False,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 91,
   'includeInAutoPeakId': False,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 92,
   'includeInAutoPeakId': False,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 93,
   'includeInAutoPeakId': False,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 94,
   'includeInAutoPeakId': False,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'L',
   'defaultLineSelect': True,
   'element': 95,
   'includeInAutoPeakId': False,
   'quantify': True,
   'xrayTransitions': [{'from': 'M5', 'to': 'L3'},
    {'from': 'M4', 'to': 'L3'}]},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 96,
   'includeInAutoPeakId': True,
   'quantify': True},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 97,
   'includeInAutoPeakId': True,
   'quantify': True},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 98,
   'includeInAutoPeakId': True,
   'quantify': True},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 99,
   'includeInAutoPeakId': True,
   'quantify': True},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 100,
   'includeInAutoPeakId': True,
   'quantify': True},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 101,
   'includeInAutoPeakId': True,
   'quantify': True},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 102,
   'includeInAutoPeakId': True,
   'quantify': True},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 103,
   'includeInAutoPeakId': True,
   'quantify': True},
  {'atomicShellFamily': 'K',
   'defaultLineSelect': True,
   'element': 104,
   'includeInAutoPeakId': True,
   'quantify': True}],
 'elementSelection': [24, 26, 6, 78],
 'ionizationCrossSectionModel': 'BrownPowell',
 'metadata': '{\n    "Core": {\n        "MetadataDefinitionVersion": "7.9",\n        "MetadataSchemaVersion": "v1\\/2013\\/07",\n        "guid": "00000000000000000000000000000000"\n    },\n    "Instrument": {\n        "ControlSoftwareVersion": "3.21.1",\n        "Manufacturer": "FEI Company",\n        "InstrumentId": "4018",\n        "InstrumentClass": "Titan",\n        "InstrumentModel": "Spectra",\n        "ComputerName": "TITAN52340180"\n    },\n    "Acquisition": {\n        "AcquisitionStartDatetime": {\n            "DateTime": "1751400967"\n        },\n        "AcquisitionDatetime": {\n            "DateTime": "0"\n        },\n        "BeamType": "",\n        "SourceType": "XFEG"\n    },\n    "Optics": {\n        "GunLensSetting": "777.25067138671875",\n        "ExtractorVoltage": "3600.03662109375",\n        "AccelerationVoltage": "200000",\n        "SpotIndex": "7",\n        "C1LensIntensity": "-0.45199774718761859",\n        "C2LensIntensity": "0.19410951924463052",\n        "C3LensIntensity": "0.35430084129721517",\n        "ObjectiveLensIntensity": "0.82398502199325219",\n        "IntermediateLensIntensity": "0.060336265199823894",\n        "DiffractionLensIntensity": "0.19139078553472397",\n        "Projector1LensIntensity": "0.28091570010789807",\n        "Projector2LensIntensity": "0.91034079367771092",\n        "LorentzLensIntensity": "0",\n        "MiniCondenserLensIntensity": "0.34343613593964234",\n        "BeamConvergence": "0.030030056394484476",\n        "ScreenCurrent": "0",\n        "LastMeasuredScreenCurrent": "2.7559210169449673e-10",\n        "FullScanFieldOfView": {\n            "x": "1.2036044831963025e-05",\n            "y": "1.2036044831963025e-05"\n        },\n        "Focus": "5.0366599727198754e-08",\n        "StemFocus": "0",\n        "Defocus": "5.0366599727198754e-08",\n        "HighMagnificationMode": "None",\n        "Apertures": {\n            "Aperture-0": {\n                "Name": "C1",\n                "Number": "1",\n                "MechanismType": "Motorized",\n                "Type": "Circular",\n                "Diameter": "0.002",\n                "Enabled": "0"\n            },\n            "Aperture-1": {\n                "Name": "C2",\n                "Number": "2",\n                "MechanismType": "Motorized",\n                "Type": "Circular",\n                "Diameter": "6.9999999999999994e-05",\n                "Enabled": "1"\n            },\n            "Aperture-2": {\n                "Name": "C3",\n                "Number": "3",\n                "MechanismType": "Motorized",\n                "Type": "Circular",\n                "Diameter": "0.002",\n                "Enabled": "0"\n            },\n            "Aperture-3": {\n                "Name": "OBJ",\n                "Number": "4",\n                "MechanismType": "Motorized",\n                "Type": "None"\n            },\n            "Aperture-4": {\n                "Name": "SA",\n                "Number": "5",\n                "MechanismType": "Motorized",\n                "Type": "None"\n            }\n        },\n        "OperatingMode": "2",\n        "TemOperatingSubMode": "None",\n        "ProjectorMode": "1",\n        "EFTEMOn": "false",\n        "ObjectiveLensMode": "HM",\n        "IlluminationMode": "Probe",\n        "ProbeMode": "1",\n        "CameraLength": "0.090999999999999998"\n    },\n    "EnergyFilter": {\n        "EntranceApertureType": ""\n    },\n    "Stage": {\n        "Position": {\n            "x": "0.00024802175999999985",\n            "y": "-1.6016556000000025e-05",\n            "z": "-0.00013106427"\n        },\n        "AlphaTilt": "9.9067999999933112e-05",\n        "BetaTilt": "-0.00028813874814659357",\n        "HolderType": "FEI Double Tilt"\n    },\n    "Scan": {\n        "ScanSize": {\n            "width": "2048",\n            "height": "2048"\n        },\n        "DwellTime": "2.0000000000000002e-05",\n        "ScanArea": {\n            "left": "0.525390625",\n            "top": "0.12451171875",\n            "right": "0.6083984375",\n            "bottom": "0.91357421875"\n        },\n        "MainsLockOn": "false",\n        "LineTime": "0.0035200000000000001",\n        "LineIntegrationCount": "1",\n        "LineInterlacing": "1",\n        "FrameTime": "5.68832",\n        "ScanRotation": "-2.5529513989856394"\n    },\n    "Vacuum": {\n        "VacuumMode": "Ready"\n    },\n    "Detectors": {\n        "Detector-0": {\n            "DetectorName": "BF-S",\n            "DetectorType": "ScanningDetector",\n            "Inserted": "true",\n            "Enabled": "true",\n            "Gain": "17.954729999999998",\n            "Offset": "0",\n            "CollectionAngleRange": {\n                "begin": "0",\n                "end": "0.029320892016213126"\n            }\n        },\n        "Detector-1": {\n            "DetectorName": "BM-Ceta",\n            "DetectorType": "ImagingDetector",\n            "ExposureMode": "",\n            "Binning": {\n                "width": "2",\n                "height": "2"\n            },\n            "ReadOutArea": {\n                "left": "768",\n                "top": "768",\n                "right": "1280",\n                "bottom": "1280"\n            },\n            "ExposureTime": "0.20000000000000001",\n            "Shutters": {\n                "Shutter-0": {\n                    "Position": "PreSpecimen",\n                    "Type": "Electrostatic"\n                }\n            },\n            "DarkGainCorrectionType": "3"\n        },\n        "Detector-2": {\n            "DetectorName": "DF-S",\n            "DetectorType": "ScanningDetector",\n            "Inserted": "false",\n            "Enabled": "true",\n            "Gain": "27.424710000000019",\n            "Offset": "0",\n            "CollectionAngleRange": {\n                "begin": "0",\n                "end": "0"\n            }\n        },\n        "Detector-3": {\n            "DetectorName": "EF-CCD",\n            "DetectorType": "ImagingDetector",\n            "ExposureMode": "",\n            "Binning": {\n                "width": "2",\n                "height": "2"\n            },\n            "ReadOutArea": {\n                "left": "768",\n                "top": "768",\n                "right": "1280",\n                "bottom": "1280"\n            },\n            "ExposureTime": "0.20000000000000001",\n            "Shutters": {\n                "Shutter-0": {\n                    "Position": "PreSpecimen",\n                    "Type": "Electrostatic"\n                }\n            },\n            "DarkGainCorrectionType": "3"\n        },\n        "Detector-4": {\n            "DetectorName": "Flucam",\n            "DetectorType": "ImagingDetector",\n            "ExposureMode": "",\n            "Gain": "0.69999999999999996",\n            "Binning": {\n                "width": "2",\n                "height": "2"\n            },\n            "ReadOutArea": {\n                "left": "0",\n                "top": "0",\n                "right": "512",\n                "bottom": "512"\n            },\n            "ExposureTime": "0.025000000000000001",\n            "Shutters": {\n                "Shutter-0": {\n                    "Position": "None",\n                    "Type": "Electrostatic"\n                }\n            },\n            "DarkGainCorrectionType": "3"\n        },\n        "Detector-5": {\n            "DetectorName": "HAADF",\n            "DetectorType": "ScanningDetector",\n            "Inserted": "true",\n            "Enabled": "true",\n            "Gain": "16.493993679975603",\n            "Offset": "-1.752",\n            "CollectionAngleRange": {\n                "begin": "0.072878546905260952",\n                "end": "0.20000000000000001"\n            }\n        },\n        "Detector-6": {\n            "DetectorName": "SuperXG21",\n            "DetectorType": "AnalyticalDetector",\n            "Inserted": "true",\n            "Enabled": "true",\n            "ElevationAngle": "0.31415926999999999",\n            "AzimuthAngle": "0.78539816339744828",\n            "CollectionAngle": "0.69999999999999996",\n            "Dispersion": "5",\n            "PulseProcessTime": "3.0000000000000001e-06",\n            "RealTime": "3345.764639425",\n            "LiveTime": "2646.7871848478562",\n            "InputCountRate": "18642",\n            "OutputCountRate": "16154",\n            "AnalyticalDetectorShutterState": "4",\n            "OffsetEnergy": "-250",\n            "ElectronicsNoise": "25.359999999999999",\n            "BeginEnergy": "120"\n        },\n        "Detector-7": {\n            "DetectorName": "SuperXG22",\n            "DetectorType": "AnalyticalDetector",\n            "Inserted": "true",\n            "Enabled": "true",\n            "ElevationAngle": "0.31415926999999999",\n            "AzimuthAngle": "2.3561944901923448",\n            "CollectionAngle": "0.69999999999999996",\n            "Dispersion": "5",\n            "PulseProcessTime": "3.0000000000000001e-06",\n            "RealTime": "3345.9598733499997",\n            "LiveTime": "2763.9259184939579",\n            "InputCountRate": "16677",\n            "OutputCountRate": "14755",\n            "AnalyticalDetectorShutterState": "4",\n            "OffsetEnergy": "-250",\n            "ElectronicsNoise": "25.170000000000002",\n            "BeginEnergy": "120"\n        },\n        "Detector-8": {\n            "DetectorName": "SuperXG23",\n            "DetectorType": "AnalyticalDetector",\n            "Inserted": "true",\n            "Enabled": "true",\n            "ElevationAngle": "0.31415926999999999",\n            "AzimuthAngle": "3.9269908169872414",\n            "CollectionAngle": "0.69999999999999996",\n            "Dispersion": "5",\n            "PulseProcessTime": "3.0000000000000001e-06",\n            "RealTime": "3345.981236225",\n            "LiveTime": "2686.8794048275386",\n            "InputCountRate": "17646",\n            "OutputCountRate": "15211",\n            "AnalyticalDetectorShutterState": "4",\n            "OffsetEnergy": "-250",\n            "ElectronicsNoise": "24.350000000000001",\n            "BeginEnergy": "120"\n        },\n        "Detector-9": {\n            "DetectorName": "SuperXG24",\n            "DetectorType": "AnalyticalDetector",\n            "Inserted": "true",\n            "Enabled": "true",\n            "ElevationAngle": "0.31415926999999999",\n            "AzimuthAngle": "5.497787143782138",\n            "CollectionAngle": "0.69999999999999996",\n            "Dispersion": "5",\n            "PulseProcessTime": "3.0000000000000001e-06",\n            "RealTime": "3346.0080250249998",\n            "LiveTime": "2625.9493035398286",\n            "InputCountRate": "19414",\n            "OutputCountRate": "16878",\n            "AnalyticalDetectorShutterState": "4",\n            "OffsetEnergy": "-250",\n            "ElectronicsNoise": "25.460000000000001",\n            "BeginEnergy": "120"\n        }\n    },\n    "BinaryResult": {\n        "AcquisitionUnit": "",\n        "CompositionType": "",\n        "Detector": "SuperXG2",\n        "PixelSize": {\n            "width": "5.8769750156069458e-09",\n            "height": "5.8769750156069458e-09"\n        },\n        "PixelUnitX": "m",\n        "PixelUnitY": "m",\n        "Offset": {\n            "x": "1.8630010799474019e-06",\n            "y": "-1.6866918294791934e-06"\n        },\n        "Encoding": ""\n    },\n    "Sample": "",\n    "GasInjectionSystems": "",\n    "CustomProperties": {\n        "Aperture[C1].Name": {\n            "type": "string",\n            "value": "2000"\n        },\n        "Aperture[C2].Name": {\n            "type": "string",\n            "value": "70"\n        },\n        "Aperture[C3].Name": {\n            "type": "string",\n            "value": "2000"\n        },\n        "Aperture[OBJ].Name": {\n            "type": "string",\n            "value": "None"\n        },\n        "Aperture[SA].Name": {\n            "type": "string",\n            "value": "None"\n        },\n        "Detectors[EF-CCD].CommercialName": {\n            "type": "string",\n            "value": "Continuum 1065"\n        },\n        "Detectors[EF-CCD].ElectronCounted": {\n            "type": "bool",\n            "value": "0"\n        },\n        "Detectors[SuperXG21].BilatThresholdHi": {\n            "type": "double",\n            "value": "0.0050390000000000001"\n        },\n        "Detectors[SuperXG21].CommercialName": {\n            "type": "string",\n            "value": "Super-X G2"\n        },\n        "Detectors[SuperXG21].DetectorConfigID": {\n            "type": "string",\n            "value": "3101e35a-08ec-4b3d-9108-6aa5d0e49281"\n        },\n        "Detectors[SuperXG21].DistanceToSample": {\n            "type": "double",\n            "value": "12.42"\n        },\n        "Detectors[SuperXG21].IncidentAngle": {\n            "type": "double",\n            "value": "0.094596840000000001"\n        },\n        "Detectors[SuperXG21].KMax": {\n            "type": "double",\n            "value": "180"\n        },\n        "Detectors[SuperXG21].KMin": {\n            "type": "double",\n            "value": "120"\n        },\n        "Detectors[SuperXG21].PulsePairResolutionTime": {\n            "type": "double",\n            "value": "4.9999999999999998e-07"\n        },\n        "Detectors[SuperXG21].Selected": {\n            "type": "bool",\n            "value": "1"\n        },\n        "Detectors[SuperXG21].SpectrumBeginEnergy": {\n            "type": "long",\n            "value": "120"\n        },\n        "Detectors[SuperXG22].BilatThresholdHi": {\n            "type": "double",\n            "value": "0.0050390000000000001"\n        },\n        "Detectors[SuperXG22].CommercialName": {\n            "type": "string",\n            "value": "Super-X G2"\n        },\n        "Detectors[SuperXG22].DetectorConfigID": {\n            "type": "string",\n            "value": "3101e35a-08ec-4b3d-9108-6aa5d0e49281"\n        },\n        "Detectors[SuperXG22].DistanceToSample": {\n            "type": "double",\n            "value": "12.42"\n        },\n        "Detectors[SuperXG22].IncidentAngle": {\n            "type": "double",\n            "value": "0.094596840000000001"\n        },\n        "Detectors[SuperXG22].KMax": {\n            "type": "double",\n            "value": "180"\n        },\n        "Detectors[SuperXG22].KMin": {\n            "type": "double",\n            "value": "120"\n        },\n        "Detectors[SuperXG22].PulsePairResolutionTime": {\n            "type": "double",\n            "value": "4.9999999999999998e-07"\n        },\n        "Detectors[SuperXG22].Selected": {\n            "type": "bool",\n            "value": "1"\n        },\n        "Detectors[SuperXG22].SpectrumBeginEnergy": {\n            "type": "long",\n            "value": "120"\n        },\n        "Detectors[SuperXG23].BilatThresholdHi": {\n            "type": "double",\n            "value": "0.0050390000000000001"\n        },\n        "Detectors[SuperXG23].CommercialName": {\n            "type": "string",\n            "value": "Super-X G2"\n        },\n        "Detectors[SuperXG23].DetectorConfigID": {\n            "type": "string",\n            "value": "3101e35a-08ec-4b3d-9108-6aa5d0e49281"\n        },\n        "Detectors[SuperXG23].DistanceToSample": {\n            "type": "double",\n            "value": "12.42"\n        },\n        "Detectors[SuperXG23].IncidentAngle": {\n            "type": "double",\n            "value": "0.094596840000000001"\n        },\n        "Detectors[SuperXG23].KMax": {\n            "type": "double",\n            "value": "180"\n        },\n        "Detectors[SuperXG23].KMin": {\n            "type": "double",\n            "value": "120"\n        },\n        "Detectors[SuperXG23].PulsePairResolutionTime": {\n            "type": "double",\n            "value": "4.9999999999999998e-07"\n        },\n        "Detectors[SuperXG23].Selected": {\n            "type": "bool",\n            "value": "1"\n        },\n        "Detectors[SuperXG23].SpectrumBeginEnergy": {\n            "type": "long",\n            "value": "120"\n        },\n        "Detectors[SuperXG24].BilatThresholdHi": {\n            "type": "double",\n            "value": "0.0050390000000000001"\n        },\n        "Detectors[SuperXG24].CommercialName": {\n            "type": "string",\n            "value": "Super-X G2"\n        },\n        "Detectors[SuperXG24].DetectorConfigID": {\n            "type": "string",\n            "value": "3101e35a-08ec-4b3d-9108-6aa5d0e49281"\n        },\n        "Detectors[SuperXG24].DistanceToSample": {\n            "type": "double",\n            "value": "12.42"\n        },\n        "Detectors[SuperXG24].IncidentAngle": {\n            "type": "double",\n            "value": "0.094596840000000001"\n        },\n        "Detectors[SuperXG24].KMax": {\n            "type": "double",\n            "value": "180"\n        },\n        "Detectors[SuperXG24].KMin": {\n            "type": "double",\n            "value": "120"\n        },\n        "Detectors[SuperXG24].PulsePairResolutionTime": {\n            "type": "double",\n            "value": "4.9999999999999998e-07"\n        },\n        "Detectors[SuperXG24].Selected": {\n            "type": "bool",\n            "value": "1"\n        },\n        "Detectors[SuperXG24].SpectrumBeginEnergy": {\n            "type": "long",\n            "value": "120"\n        },\n        "Optics.MonoSpotSize": {\n            "type": "string",\n            "value": "<=11"\n        },\n        "Scan.ScanTransformation.A11": {\n            "type": "double",\n            "value": "1"\n        },\n        "Scan.ScanTransformation.A12": {\n            "type": "double",\n            "value": "0"\n        },\n        "Scan.ScanTransformation.A13": {\n            "type": "double",\n            "value": "0.0021895715035498142"\n        },\n        "Scan.ScanTransformation.A21": {\n            "type": "double",\n            "value": "0"\n        },\n        "Scan.ScanTransformation.A22": {\n            "type": "double",\n            "value": "1"\n        },\n        "Scan.ScanTransformation.A23": {\n            "type": "double",\n            "value": "-0.0031587188132107258"\n        },\n        "StemMagnification": {\n            "type": "double",\n            "value": "7100"\n        }\n    }\n}\n'}
h5_file['SharedProperties']['EDSSpectrumQuantificationSettings']['.keys()']
<HDF5 dataset "c87c8b86325b44e29d8bc5876a408b8f": shape (1,), type "|O">

Now, we open and plot the selected dataset. Select another one and rerun only cell below (Home button gets you back to original).

Please note that you can zoom and drag the intensity values in the color-bar.

chooser = pyTEMlib.file_tools.ChooseDataset(fileWidget.datasets)
datasets = fileWidget.datasets
dataset = fileWidget.selected_dataset

if dataset.data_type.name != 'IMAGE':
    print('We really would need an image here')

view = dataset.plot()
datasets.keys()
We really would need an image here
dict_keys(['Channel_000', 'Channel_001', 'Channel_002', 'Channel_003', 'Channel_004', 'Channel_005', 'Channel_006', 'Channel_007', 'Channel_008', 'Channel_009'])
dataset.view_original_metadata()
Core :
	MetadataDefinitionVersion : 7.9
	MetadataSchemaVersion : v1/2013/07
	guid : 00000000000000000000000000000000
Instrument :
	ControlSoftwareVersion : 3.21.1
	Manufacturer : FEI Company
	InstrumentId : 4018
	InstrumentClass : Titan
	InstrumentModel : Spectra
	ComputerName : TITAN52340180
Acquisition :
	AcquisitionStartDatetime :
		DateTime : 1751400967
	AcquisitionDatetime :
		DateTime : 0
	BeamType : 
	SourceType : XFEG
Optics :
	GunLensSetting : 777.25067138671875
	ExtractorVoltage : 3600.03662109375
	AccelerationVoltage : 200000
	SpotIndex : 7
	C1LensIntensity : -0.45199774718761859
	C2LensIntensity : 0.19410951924463052
	C3LensIntensity : 0.35430084129721517
	ObjectiveLensIntensity : 0.82398502199325219
	IntermediateLensIntensity : 0.060336265199823894
	DiffractionLensIntensity : 0.19139078553472397
	Projector1LensIntensity : 0.28091570010789807
	Projector2LensIntensity : 0.91034079367771092
	LorentzLensIntensity : 0
	MiniCondenserLensIntensity : 0.34343613593964234
	BeamConvergence : 0.030030056394484476
	ScreenCurrent : 0
	LastMeasuredScreenCurrent : 2.7559210169449673e-10
	FullScanFieldOfView :
		x : 1.2036044831963025e-05
		y : 1.2036044831963025e-05
	Focus : 5.0366599727198754e-08
	StemFocus : 0
	Defocus : 5.0366599727198754e-08
	HighMagnificationMode : None
	Apertures :
		Aperture-0 :
			Name : C1
			Number : 1
			MechanismType : Motorized
			Type : Circular
			Diameter : 0.002
			Enabled : 0
		Aperture-1 :
			Name : C2
			Number : 2
			MechanismType : Motorized
			Type : Circular
			Diameter : 6.9999999999999994e-05
			Enabled : 1
		Aperture-2 :
			Name : C3
			Number : 3
			MechanismType : Motorized
			Type : Circular
			Diameter : 0.002
			Enabled : 0
		Aperture-3 :
			Name : OBJ
			Number : 4
			MechanismType : Motorized
			Type : None
		Aperture-4 :
			Name : SA
			Number : 5
			MechanismType : Motorized
			Type : None
	OperatingMode : 2
	TemOperatingSubMode : None
	ProjectorMode : 1
	EFTEMOn : false
	ObjectiveLensMode : HM
	IlluminationMode : Probe
	ProbeMode : 1
	CameraLength : 0.090999999999999998
EnergyFilter :
	EntranceApertureType : 
Stage :
	Position :
		x : 0.00024801569999999989
		y : -1.6006416000000027e-05
		z : -0.00013106427
	AlphaTilt : 9.9067999999933112e-05
	BetaTilt : -0.00023729076201561838
	HolderType : FEI Double Tilt
Scan :
	ScanSize :
		width : 2048
		height : 2048
	DwellTime : 2.0000000000000002e-05
	ScanArea :
		left : 0.525390625
		top : 0.12451171875
		right : 0.6083984375
		bottom : 0.91357421875
	MainsLockOn : false
	LineTime : 0.0035200000000000001
	LineIntegrationCount : 1
	LineInterlacing : 1
	FrameTime : 5.68832
	ScanRotation : -2.5529513989856394
Vacuum :
	VacuumMode : Ready
Detectors :
	Detector-0 :
		DetectorName : BF-S
		DetectorType : ScanningDetector
		Inserted : true
		Enabled : true
		Gain : 17.954729999999998
		Offset : 0
		CollectionAngleRange :
			begin : 0
			end : 0.029320892016213126
	Detector-1 :
		DetectorName : BM-Ceta
		DetectorType : ImagingDetector
		ExposureMode : 
		Binning :
			width : 2
			height : 2
		ReadOutArea :
			left : 768
			top : 768
			right : 1280
			bottom : 1280
		ExposureTime : 0.20000000000000001
		Shutters :
			Shutter-0 :
				Position : PreSpecimen
				Type : Electrostatic
		DarkGainCorrectionType : 3
	Detector-2 :
		DetectorName : DF-S
		DetectorType : ScanningDetector
		Inserted : false
		Enabled : true
		Gain : 27.424710000000019
		Offset : 0
		CollectionAngleRange :
			begin : 0
			end : 0
	Detector-3 :
		DetectorName : EF-CCD
		DetectorType : ImagingDetector
		ExposureMode : 
		Binning :
			width : 2
			height : 2
		ReadOutArea :
			left : 768
			top : 768
			right : 1280
			bottom : 1280
		ExposureTime : 0.20000000000000001
		Shutters :
			Shutter-0 :
				Position : PreSpecimen
				Type : Electrostatic
		DarkGainCorrectionType : 3
	Detector-4 :
		DetectorName : Flucam
		DetectorType : ImagingDetector
		ExposureMode : 
		Gain : 0.69999999999999996
		Binning :
			width : 2
			height : 2
		ReadOutArea :
			left : 0
			top : 0
			right : 512
			bottom : 512
		ExposureTime : 0.025000000000000001
		Shutters :
			Shutter-0 :
				Position : None
				Type : Electrostatic
		DarkGainCorrectionType : 3
	Detector-5 :
		DetectorName : HAADF
		DetectorType : ScanningDetector
		Inserted : true
		Enabled : true
		Gain : 16.493993679975603
		Offset : -1.752
		CollectionAngleRange :
			begin : 0.072878546905260952
			end : 0.20000000000000001
	Detector-6 :
		DetectorName : SuperXG21
		DetectorType : AnalyticalDetector
		Inserted : true
		Enabled : true
		ElevationAngle : 0.31415926999999999
		AzimuthAngle : 0.78539816339744828
		CollectionAngle : 0.69999999999999996
		Dispersion : 5
		PulseProcessTime : 3.0000000000000001e-06
		RealTime : 5.4938558500000001
		LiveTime : 4.352944742641971
		InputCountRate : 27397
		OutputCountRate : 21037
		AnalyticalDetectorShutterState : 4
		OffsetEnergy : -250
		ElectronicsNoise : 25.359999999999999
		BeginEnergy : 120
	Detector-7 :
		DetectorName : SuperXG22
		DetectorType : AnalyticalDetector
		Inserted : true
		Enabled : true
		ElevationAngle : 0.31415926999999999
		AzimuthAngle : 2.3561944901923448
		CollectionAngle : 0.69999999999999996
		Dispersion : 5
		PulseProcessTime : 3.0000000000000001e-06
		RealTime : 5.5145069250000001
		LiveTime : 4.5610697515153706
		InputCountRate : 21730
		OutputCountRate : 17668
		AnalyticalDetectorShutterState : 4
		OffsetEnergy : -250
		ElectronicsNoise : 25.170000000000002
		BeginEnergy : 120
	Detector-8 :
		DetectorName : SuperXG23
		DetectorType : AnalyticalDetector
		Inserted : true
		Enabled : true
		ElevationAngle : 0.31415926999999999
		AzimuthAngle : 3.9269908169872414
		CollectionAngle : 0.69999999999999996
		Dispersion : 5
		PulseProcessTime : 3.0000000000000001e-06
		RealTime : 5.5144955250000001
		LiveTime : 4.4375722868860628
		InputCountRate : 22869
		OutputCountRate : 17915
		AnalyticalDetectorShutterState : 4
		OffsetEnergy : -250
		ElectronicsNoise : 24.350000000000001
		BeginEnergy : 120
	Detector-9 :
		DetectorName : SuperXG24
		DetectorType : AnalyticalDetector
		Inserted : true
		Enabled : true
		ElevationAngle : 0.31415926999999999
		AzimuthAngle : 5.497787143782138
		CollectionAngle : 0.69999999999999996
		Dispersion : 5
		PulseProcessTime : 3.0000000000000001e-06
		RealTime : 5.5145737749999997
		LiveTime : 4.3493202745713182
		InputCountRate : 28552
		OutputCountRate : 21906
		AnalyticalDetectorShutterState : 4
		OffsetEnergy : -250
		ElectronicsNoise : 25.460000000000001
		BeginEnergy : 120
BinaryResult :
	AcquisitionUnit : 
	CompositionType : 
	DetectorIndex : 6
	Detector : SuperXG21
	PixelSize :
		width : 5.8769750156069458e-09
		height : 5.8769750156069458e-09
	PixelUnitX : m
	PixelUnitY : m
	Offset :
		x : 1.8630010799474019e-06
		y : -1.6866918294791934e-06
	Encoding : 
Sample : 
GasInjectionSystems : 
CustomProperties :
	Aperture[C1].Name :
		type : string
		value : 2000
	Aperture[C2].Name :
		type : string
		value : 70
	Aperture[C3].Name :
		type : string
		value : 2000
	Aperture[OBJ].Name :
		type : string
		value : None
	Aperture[SA].Name :
		type : string
		value : None
	Detectors[EF-CCD].CommercialName :
		type : string
		value : Continuum 1065
	Detectors[EF-CCD].ElectronCounted :
		type : bool
		value : 0
	Detectors[SuperXG21].BilatThresholdHi :
		type : double
		value : 0.0050390000000000001
	Detectors[SuperXG21].CommercialName :
		type : string
		value : Super-X G2
	Detectors[SuperXG21].DetectorConfigID :
		type : string
		value : 3101e35a-08ec-4b3d-9108-6aa5d0e49281
	Detectors[SuperXG21].DistanceToSample :
		type : double
		value : 12.42
	Detectors[SuperXG21].IncidentAngle :
		type : double
		value : 0.094596840000000001
	Detectors[SuperXG21].KMax :
		type : double
		value : 180
	Detectors[SuperXG21].KMin :
		type : double
		value : 120
	Detectors[SuperXG21].PulsePairResolutionTime :
		type : double
		value : 4.9999999999999998e-07
	Detectors[SuperXG21].SpectrumBeginEnergy :
		type : long
		value : 120
	Detectors[SuperXG22].BilatThresholdHi :
		type : double
		value : 0.0050390000000000001
	Detectors[SuperXG22].CommercialName :
		type : string
		value : Super-X G2
	Detectors[SuperXG22].DetectorConfigID :
		type : string
		value : 3101e35a-08ec-4b3d-9108-6aa5d0e49281
	Detectors[SuperXG22].DistanceToSample :
		type : double
		value : 12.42
	Detectors[SuperXG22].IncidentAngle :
		type : double
		value : 0.094596840000000001
	Detectors[SuperXG22].KMax :
		type : double
		value : 180
	Detectors[SuperXG22].KMin :
		type : double
		value : 120
	Detectors[SuperXG22].PulsePairResolutionTime :
		type : double
		value : 4.9999999999999998e-07
	Detectors[SuperXG22].SpectrumBeginEnergy :
		type : long
		value : 120
	Detectors[SuperXG23].BilatThresholdHi :
		type : double
		value : 0.0050390000000000001
	Detectors[SuperXG23].CommercialName :
		type : string
		value : Super-X G2
	Detectors[SuperXG23].DetectorConfigID :
		type : string
		value : 3101e35a-08ec-4b3d-9108-6aa5d0e49281
	Detectors[SuperXG23].DistanceToSample :
		type : double
		value : 12.42
	Detectors[SuperXG23].IncidentAngle :
		type : double
		value : 0.094596840000000001
	Detectors[SuperXG23].KMax :
		type : double
		value : 180
	Detectors[SuperXG23].KMin :
		type : double
		value : 120
	Detectors[SuperXG23].PulsePairResolutionTime :
		type : double
		value : 4.9999999999999998e-07
	Detectors[SuperXG23].SpectrumBeginEnergy :
		type : long
		value : 120
	Detectors[SuperXG24].BilatThresholdHi :
		type : double
		value : 0.0050390000000000001
	Detectors[SuperXG24].CommercialName :
		type : string
		value : Super-X G2
	Detectors[SuperXG24].DetectorConfigID :
		type : string
		value : 3101e35a-08ec-4b3d-9108-6aa5d0e49281
	Detectors[SuperXG24].DistanceToSample :
		type : double
		value : 12.42
	Detectors[SuperXG24].IncidentAngle :
		type : double
		value : 0.094596840000000001
	Detectors[SuperXG24].KMax :
		type : double
		value : 180
	Detectors[SuperXG24].KMin :
		type : double
		value : 120
	Detectors[SuperXG24].PulsePairResolutionTime :
		type : double
		value : 4.9999999999999998e-07
	Detectors[SuperXG24].SpectrumBeginEnergy :
		type : long
		value : 120
	Optics.MonoSpotSize :
		type : string
		value : <=11
	Scan.ScanTransformation.A11 :
		type : double
		value : 1
	Scan.ScanTransformation.A12 :
		type : double
		value : 0
	Scan.ScanTransformation.A13 :
		type : double
		value : -0
	Scan.ScanTransformation.A21 :
		type : double
		value : 0
	Scan.ScanTransformation.A22 :
		type : double
		value : 1
	Scan.ScanTransformation.A23 :
		type : double
		value : -0
	StemMagnification :
		type : double
		value : 7100
AcquisitionSettings :
	encoding : uint16
	bincount : 4096
	StreamEncoding : uint16
	Size : 2097152
	RasterScanDefinition :
		Width : 2048
		Height : 2048
f = dataset[10,200:230,:].sum(axis=[0])
f2 = dataset[10,200,:]
plt.figure()
plt.plot(f2*30)
plt.plot(f)

dataset.shape
(170, 1616, 2048)
dataset.y.slope
5.876975015606945
plt.figure()
plt.imshow(haadf[100:200].T)
<matplotlib.image.AxesImage at 0x23e36897020>
plt.figure()
plt.plot(haadf[100:200].sum(axis=0))
[<matplotlib.lines.Line2D at 0x23e3580c4d0>]
profile = []
for key in ['Channel_001', 'Channel_002','Channel_004', 'Channel_005']:
    profile = datasets[key][100:200].sum(axis=0)
    profiles.append(profile)
plt.figure()
for profile in profiles:
    plt.plot(profile)
KeyboardInterrupt
plt.close('all')
def analyze_atomic_structure(dataset, crystal, start_atom_index, tolerance=1.5):
    graph = dataset.metadata['atoms']['positions']
    
    layer = pyTEMlib.crystal_tools.get_projection(crystal)
    gamma = np.radians(layer.cell.angles()[2])
    rotation_angle = np.radians(crystal.info['experimental']['angle'])
                        
    length = (layer.cell.lengths() /10/dataset.x.slope)[:2]
    a = np.array([np.cos(rotation_angle)*length[0], np.sin(rotation_angle)*length[0]])
    b = np.array([np.cos(rotation_angle+gamma)*length[1], np.sin(rotation_angle+gamma)*length[1]])
    base = layer.get_scaled_positions()
    base[:, :2] = np.dot(base[:, :2],[a,b])
    projection_tags = {'lattice_vector': {'a': a, 'b': b},
                       'allowed_variation': tolerance,
                       'distance_unit_cell':  np.max(length)*1.04,
                       'start_atom_index': start_atom_index,
                       'base': base}
    layer.info['projection'] = projection_tags

    origins, ideal = pyTEMlib.graph_tools.breadth_first_search(blobs[:,:2], start_atom_index, layer)
    dataset.metadata['atoms']['projection'] = layer
    sublattices = pyTEMlib.graph_tools.get_base_atoms(graph[:, :2], origins, base[:, :2], tolerance=2)
    
    dataset.metadata['atoms']['origins'] = origins
    dataset.metadata['atoms']['ideal_origins'] = ideal
    dataset.metadata['atoms']['sublattices'] = sublattices
    dataset.metadata['atoms']['base'] = base
    
    return sublattices

crystal = pyTEMlib.crystal_tools.structure_by_name('aluminium')
crystal.info['experimental']={'zone_axis': [0, 1, 1], 'angle': 180}

sublattice_indices = pyTEMlib.graph_tools.analyze_atomic_structure(dataset, crystal, 186, tolerance=1.5)
sublattice_indices                                   
base = dataset.metadata['atoms']['projection_tags']['base']
blobs = dataset.metadata['atoms']['positions']
plt.figure()
plt.imshow(dataset.T, interpolation='nearest',cmap='gray', vmax=np.median(np.array(dataset))+3*np.std(np.array(dataset)))
base = dataset.metadata['atoms']['projection_tags']['base']
for i, sub_lattice in enumerate(sublattice_indices):
    if base[i, 2] > 0.5:
        color = 'blue'
    else:
        color = 'red'
    plt.scatter(blobs[sub_lattice, 0], blobs[sub_lattice, 1], c=color, alpha = 0.2)
[26.96005723 38.12727858] 3.141592653589793 1.5707963267948966
124 origins found
dataset.metadata['atoms'].keys()
dict_keys(['positions', 'size', 'projection', 'origins', 'ideal_origins', 'sublattices', 'projection_tags'])
crystal = pyTEMlib.crystal_tools.structure_by_name('theta_prime')
crystal.info['experimental']={'zone_axis': [1, 0, 1], 'angle': 180}

sublattice_indices2 = pyTEMlib.graph_tools.analyze_atomic_structure(dataset, crystal, 717, tolerance=4.8)
print(len(sublattice_indices2))                                   

blobs = dataset.metadata['atoms']['positions']
np.max(blobs, axis=1)

plt.figure()
plt.imshow(dataset.T, interpolation='nearest',cmap='gray', vmax=np.median(np.array(dataset))+3*np.std(np.array(dataset)))
for i, sub_lattice in enumerate(sublattice_indices2):
    if dataset.metadata['atoms']['projection_tags']['base'][i, 2] < 0.2:
        color = 'red'
    elif dataset.metadata['atoms']['projection_tags']['base'][i, 2] < 0.4:
        color = 'blue'
    
    elif dataset.metadata['atoms']['projection_tags']['base'][i, 2] < 0.7:
        color = 'orange'
    else:
        color = 'purple'
   
    plt.scatter(blobs[sub_lattice, 0], blobs[sub_lattice, 1], c=color, alpha = 0.2)
for i, sub_lattice in enumerate(sublattice_indices):
    if base[i, 2] > 0.5:
        color = 'blue'
    else:
        color = 'red'
    plt.scatter(blobs[sub_lattice, 0], blobs[sub_lattice, 1], c=color, alpha = 0.2)
[38.12727858 38.51436747] 3.141592653589793 1.5707963267948968
252 origins found
12
np.max(blobs, axis=0)
len 
del_blobsblobs[:,0] < 5]
array([506.       , 482.       ,   4.7712026], dtype=float32)
np.round(np.unique(np.round(dataset.metadata['atoms']['projection_tags']['base'][:,2],2))*3,0)
array([0., 1., 2., 3.])
print(dataset.metadata['atoms']['projection_tags'])
a = dataset.metadata['atoms']['projection_tags']['lattice_vector']['a']
b = dataset.metadata['atoms']['projection_tags']['lattice_vector']['b']
blobs = dataset.metadata['atoms']['positions']
init = 676
plt.figure()
plt.imshow(dataset.T, interpolation='nearest',cmap='gray')
plt.scatter(blobs[init, 0], blobs[init, 1], c='orange')
plt.scatter((blobs[init,:2]+a)[0], (blobs[init,:2]+a)[1], c='orange')
plt.scatter((blobs[init,:2]+b)[0], (blobs[init,:2]+b)[1], c='orange')
{'lattice_vector': {'a': array([26.96005723,  0.        ]), 'b': array([1.65082739e-15, 2.69600572e+01])}, 'allowed_variation': 1.5, 'distance_unit_cell': 28.038459519347416, 'start_atom_index': 676, 'base': array([[8.25413695e-16, 1.34800286e+01, 2.66666667e-01],
       [1.34800286e+01, 0.00000000e+00, 3.33333333e-01],
       [1.34800286e+01, 0.00000000e+00, 1.00000000e+00],
       [8.25413695e-16, 1.34800286e+01, 1.00000000e+00],
       [0.00000000e+00, 0.00000000e+00, 0.00000000e+00],
       [1.34800286e+01, 1.34800286e+01, 6.66666667e-01]])}
<matplotlib.collections.PathCollection at 0x246f35323c0>
crystal = pyTEMlib.crystal_tools.structure_by_name('theta_prime')
crystal.info['experimental']={'zone_axis': [1, 0, 1], 'angle': 0}

layer = pyTEMlib.crystal_tools.get_projection(crystal)
print(layer)
blobs = dataset.metadata['atoms']['positions']

plt.figure()
plt.imshow(dataset.T, interpolation='nearest',cmap='gray')
#plt.scatter(one_grain[:, 0], one_grain[:, 1], c='blue', alpha = 0.2)

# init = np.argmin(np.linalg.norm(blobs[:,:2]- [674, 594], axis=1))
#init = np.argmin(np.linalg.norm(blobs[:,:2]- [610, 552], axis=1))
init = 676
plt.scatter(blobs[:, 0], blobs[:, 1], c='red')
plt.scatter(blobs[init, 0], blobs[init, 1], c='orange')
projected atomic numbers
Atoms(symbols='Al4Cu2', pbc=[True, True, False], cell=[5.727564927611035, 5.785714285714286, 1.4318912319027588], tags=...)
<matplotlib.collections.PathCollection at 0x246809773b0>
gamma = np.radians(layer.cell.angles()[2])
one_grain_angle = 0
length = (layer.cell.lengths() /10/dataset.x.slope)[:2]
length, np.round(layer.get_scaled_positions(),3)
(array([38.12727858, 38.51436747]),
 array([[0.25, 0.2 , 1.  ],
        [0.75, 0.25, 1.  ],
        [0.75, 0.75, 1.  ],
        [0.25, 0.75, 1.  ],
        [0.  , 0.  , 0.  ],
        [0.5 , 0.5 , 0.  ]]))
import pyTEMlib.graph_tools
plt.close('all')
image = dataset
init = np.argmin(np.linalg.norm(blobs[:,:2]- [812, 199], axis=1))


a = np.array([np.cos(one_grain_angle)*length[0], np.sin(one_grain_angle)*length[0]])
b = np.array([np.cos(one_grain_angle+gamma)*length[1], np.sin(one_grain_angle+gamma)*length[1]])
base = layer.get_scaled_positions()
base[:, :2] = np.dot(base[:, :2],[a,b])
init = 676
#plt.scatter(blobs[init][0], blobs[init][1], c='orange')
projection_tags = {'lattice_vector': {'a': a, 'b': b},
                   'allowed_variation': 2,
                   'distance_unit_cell':  np.max(length)*1.04,
                   'start_atom_index': init,
                   'base': base}
layer.info['projection'] = projection_tags
init = 676


hop1, ideal = pyTEMlib.graph_tools.breadth_first_search(blobs[:,:2], init, layer)

plt.figure()
plt.imshow(image.T, interpolation='nearest',cmap='gray', vmax=np.median(np.array(image))+3*np.std(np.array(image)))
plt.scatter(blobs[init, 0], blobs[init, 1], c='orange')
plt.scatter((blobs[init,:2]+a) [0], (blobs[init,:2]+a)[1], c='orange')
plt.scatter((blobs[init,:2]+b) [0], (blobs[init,:2]+b)[1], c='orange')
plt.scatter(hop1[:,0], hop1[:,1], c='red', alpha = 0.3)

layer.info['projection']
{'lattice_vector': {'a': array([38.12727858,  0.        ]),
  'b': array([2.35832484e-15, 3.85143675e+01])},
 'allowed_variation': 2,
 'distance_unit_cell': 40.054942170496304,
 'start_atom_index': 676,
 'base': array([[9.53181964e+00, 7.70287349e+00, 1.00000000e+00],
        [2.85954589e+01, 9.62859187e+00, 1.00000000e+00],
        [2.85954589e+01, 2.88857756e+01, 1.00000000e+00],
        [9.53181964e+00, 2.88857756e+01, 1.00000000e+00],
        [0.00000000e+00, 0.00000000e+00, 0.00000000e+00],
        [1.90636393e+01, 1.92571837e+01, 1.86616479e-17]])}
import scipy
def get_base_atoms(graph, origins, base, tolerance=3):
    sublattices = []
    neighbour_tree = scipy.spatial.KDTree(graph)
    for base_atom in base:
         distances, indices = neighbour_tree.query(origins+base_atom[:2], k=50) 
         sublattices.append(indices[distances < tolerance]) 
    return sublattices

base = layer.get_scaled_positions()
base[:, :2] = np.dot(base[:, :2],[a,b])
sublattice_indices = get_base_atoms(blobs[:,:2], hop1, base[:,:2])

plt.figure()
plt.imshow(image.T, interpolation='nearest',cmap='gray', vmax=np.median(np.array(image))+3*np.std(np.array(image)))
for i, sub_lattice in enumerate(sublattice_indices):
    if base[i, 2] > 0.5:
        color = 'blue'
    else:
        color = 'red'
    plt.scatter(blobs[sub_lattice, 0], blobs[sub_lattice, 1], c=color, alpha = 0.2)
dataset.x.slope*21, 4.03/np.sqrt(2)/dataset.x
C:\Users\gduscher\AppData\Local\Temp\ipykernel_31628\2202695786.py:1: RuntimeWarning: divide by zero encountered in divide
  dataset.x.slope*21, 4.03/np.sqrt(2)/dataset.x
(0.31546668938414874, x:  Length (nm) of size (512,))
blobs
{'positions': array([[  9.       , 474.       ,   2.8856013],
        [505.       , 474.       ,   2.8856013],
        [  9.       ,   8.       ,   2.8856013],
        ...,
        [  0.       ,  60.       ,   1.       ],
        [  0.       , 157.       ,   1.       ],
        [  0.       , 143.       ,   1.       ]], dtype=float32),
 'size': 0.1,
 'projection': Atoms(symbols='Al4', pbc=[True, True, False], cell=[4.05, 5.727564927611035, 1.4318912319027588], tags=...),
 'origins': array([[120., 282.],
        [147., 282.],
        [ 92., 282.],
        [120., 321.],
        [120., 243.],
        [175., 283.],
        [147., 244.],
        [147., 321.],
        [ 65., 281.],
        [ 92., 320.],
        [ 92., 243.],
        [119., 360.],
        [120., 204.],
        [202., 283.],
        [175., 244.],
        [175., 322.],
        [147., 360.],
        [ 37., 281.],
        [ 65., 242.],
        [ 64., 320.],
        [ 92., 359.],
        [ 92., 204.],
        [119., 399.],
        [147., 204.],
        [120., 165.],
        [230., 284.],
        [202., 245.],
        [202., 322.],
        [175., 205.],
        [175., 361.],
        [147., 399.],
        [  9., 280.],
        [ 37., 319.],
        [ 37., 242.],
        [ 65., 203.],
        [ 64., 359.],
        [ 92., 398.],
        [ 92., 165.],
        [119., 438.],
        [147., 165.],
        [120., 126.],
        [258., 285.],
        [230., 323.],
        [230., 245.],
        [202., 206.],
        [202., 361.],
        [175., 166.],
        [175., 400.],
        [146., 438.],
        [  9., 241.],
        [  9., 319.],
        [ 37., 358.],
        [ 37., 203.],
        [ 65., 164.],
        [ 64., 398.],
        [ 91., 437.],
        [ 92., 126.],
        [119., 475.],
        [148., 127.],
        [120.,  87.],
        [258., 324.],
        [258., 245.],
        [230., 206.],
        [202., 400.],
        [202., 166.],
        [175., 127.],
        [174., 439.],
        [  9., 202.],
        [  9., 358.],
        [ 36., 397.],
        [ 37., 164.],
        [ 65., 125.],
        [ 64., 437.],
        [ 91., 474.],
        [ 92.,  87.],
        [145., 475.],
        [147.,  87.],
        [120.,  48.],
        [259., 362.],
        [257., 207.],
        [230., 167.],
        [228., 401.],
        [202., 127.],
        [175.,  88.],
        [201., 440.],
        [  9., 164.],
        [  9., 397.],
        [ 36., 436.],
        [ 37., 125.],
        [ 65.,  86.],
        [ 63., 474.],
        [ 92.,  48.],
        [147.,  49.],
        [257., 167.],
        [230., 128.],
        [229., 363.],
        [227., 440.],
        [203.,  88.],
        [175.,  49.],
        [  9., 435.],
        [ 36., 474.],
        [ 10., 124.],
        [ 37.,  86.],
        [ 65.,  47.],
        [257., 129.],
        [230.,  89.],
        [203.,  49.],
        [  9., 474.],
        [ 10.,  85.],
        [ 38.,  47.],
        [ 65.,   8.],
        [258.,  89.],
        [230.,  50.],
        [ 10.,  47.],
        [ 37.,   8.],
        [ 92.,   8.],
        [258.,  50.],
        [  9.,   8.],
        [120.,   8.],
        [258.,  11.],
        [147.,   9.],
        [230.,  10.],
        [175.,   9.],
        [202.,   9.]], dtype=float32),
 'ideal_origins': [array([120., 282.], dtype=float32),
  array([146.96005723, 282.        ]),
  array([ 93.03994277, 282.        ]),
  array([120.        , 320.12727858]),
  array([120.        , 243.87272142]),
  array([173.92011446, 282.        ]),
  array([146.96005723, 243.87272142]),
  array([146.96005723, 320.12727858]),
  array([ 66.07988554, 282.        ]),
  array([ 93.03994277, 320.12727858]),
  array([ 93.03994277, 243.87272142]),
  array([120.        , 358.25455715]),
  array([120.        , 205.74544285]),
  array([200.88017169, 282.        ]),
  array([173.92011446, 243.87272142]),
  array([173.92011446, 320.12727858]),
  array([146.96005723, 358.25455715]),
  array([ 39.11982831, 282.        ]),
  array([ 66.07988554, 243.87272142]),
  array([ 66.07988554, 320.12727858]),
  array([ 93.03994277, 358.25455715]),
  array([ 93.03994277, 205.74544285]),
  array([120.        , 396.38183573]),
  array([146.96005723, 205.74544285]),
  array([120.        , 167.61816427]),
  array([227.84022892, 282.        ]),
  array([200.88017169, 243.87272142]),
  array([200.88017169, 320.12727858]),
  array([173.92011446, 205.74544285]),
  array([173.92011446, 358.25455715]),
  array([146.96005723, 396.38183573]),
  array([ 12.15977108, 282.        ]),
  array([ 39.11982831, 320.12727858]),
  array([ 39.11982831, 243.87272142]),
  array([ 66.07988554, 205.74544285]),
  array([ 66.07988554, 358.25455715]),
  array([ 93.03994277, 396.38183573]),
  array([ 93.03994277, 167.61816427]),
  array([120.        , 434.50911431]),
  array([146.96005723, 167.61816427]),
  array([120.        , 129.49088569]),
  array([254.80028615, 282.        ]),
  array([227.84022892, 320.12727858]),
  array([227.84022892, 243.87272142]),
  array([200.88017169, 205.74544285]),
  array([200.88017169, 358.25455715]),
  array([173.92011446, 167.61816427]),
  array([173.92011446, 396.38183573]),
  array([146.96005723, 434.50911431]),
  array([ 12.15977108, 243.87272142]),
  array([ 12.15977108, 320.12727858]),
  array([ 39.11982831, 358.25455715]),
  array([ 39.11982831, 205.74544285]),
  array([ 66.07988554, 167.61816427]),
  array([ 66.07988554, 396.38183573]),
  array([ 93.03994277, 434.50911431]),
  array([ 93.03994277, 129.49088569]),
  array([120.        , 472.63639289]),
  array([146.96005723, 129.49088569]),
  array([120.        ,  91.36360711]),
  array([254.80028615, 320.12727858]),
  array([254.80028615, 243.87272142]),
  array([227.84022892, 205.74544285]),
  array([200.88017169, 396.38183573]),
  array([200.88017169, 167.61816427]),
  array([173.92011446, 129.49088569]),
  array([173.92011446, 434.50911431]),
  array([ 12.15977108, 205.74544285]),
  array([ 12.15977108, 358.25455715]),
  array([ 39.11982831, 396.38183573]),
  array([ 39.11982831, 167.61816427]),
  array([ 66.07988554, 129.49088569]),
  array([ 66.07988554, 434.50911431]),
  array([ 93.03994277, 472.63639289]),
  array([93.03994277, 91.36360711]),
  array([146.96005723, 472.63639289]),
  array([146.96005723,  91.36360711]),
  array([120.        ,  53.23632854]),
  array([254.80028615, 358.25455715]),
  array([254.80028615, 205.74544285]),
  array([227.84022892, 167.61816427]),
  array([227.84022892, 396.38183573]),
  array([200.88017169, 129.49088569]),
  array([173.92011446,  91.36360711]),
  array([200.88017169, 434.50911431]),
  array([ 12.15977108, 167.61816427]),
  array([ 12.15977108, 396.38183573]),
  array([ 39.11982831, 434.50911431]),
  array([ 39.11982831, 129.49088569]),
  array([66.07988554, 91.36360711]),
  array([ 66.07988554, 472.63639289]),
  array([93.03994277, 53.23632854]),
  array([146.96005723,  53.23632854]),
  array([254.80028615, 167.61816427]),
  array([227.84022892, 129.49088569]),
  array([227.84022892, 358.25455715]),
  array([227.84022892, 434.50911431]),
  array([200.88017169,  91.36360711]),
  array([173.92011446,  53.23632854]),
  array([ 12.15977108, 434.50911431]),
  array([ 39.11982831, 472.63639289]),
  array([ 12.15977108, 129.49088569]),
  array([39.11982831, 91.36360711]),
  array([66.07988554, 53.23632854]),
  array([254.80028615, 129.49088569]),
  array([227.84022892,  91.36360711]),
  array([200.88017169,  53.23632854]),
  array([ 12.15977108, 472.63639289]),
  array([12.15977108, 91.36360711]),
  array([39.11982831, 53.23632854]),
  array([66.07988554, 15.10904996]),
  array([254.80028615,  91.36360711]),
  array([227.84022892,  53.23632854]),
  array([12.15977108, 53.23632854]),
  array([39.11982831, 15.10904996]),
  array([93.03994277, 15.10904996]),
  array([254.80028615,  53.23632854]),
  array([12.15977108, 15.10904996]),
  array([120.        ,  15.10904996]),
  array([254.80028615,  15.10904996]),
  array([146.96005723,  15.10904996]),
  array([227.84022892,  15.10904996]),
  array([173.92011446,  15.10904996]),
  array([200.88017169,  15.10904996])],
 'sublattices': [array([186, 263, 228, 117, 193, 284, 287, 270, 119, 121, 224, 113, 240,
         385, 289, 274, 153, 169, 139,  98,  97, 230, 145, 394, 241, 586,
         335, 372, 386, 258, 198,  41, 101, 173, 162, 124, 155, 207, 136,
         347, 316, 456, 763, 480, 349, 388, 360, 184, 187,  35,  28, 104,
         168, 175, 163, 116, 285,  93, 369, 276, 477, 439, 424, 429, 408,
         384, 156,  52,  26, 126, 122, 191,  91,  57, 306,  67, 322, 300,
         455, 471, 432, 770, 399, 330, 371,  46,  48, 114, 176, 185,  16,
         283, 292, 410, 413, 738, 773, 420, 321,  10,  31,  34, 264, 255,
         352, 423, 419,   0,  21, 232,  55, 353, 404,  25,  54,  60, 326,
           2, 280, 434, 146, 339, 151, 199], dtype=int64),
  array([213, 166, 108, 140, 183, 310, 317, 236, 115, 100, 215, 201, 192,
         428, 332, 229, 243, 148, 203, 133, 130, 181,  99, 340, 304, 747,
         387, 451, 305, 170, 165,  44, 123, 157, 194, 135, 127, 273,  88,
         367, 337, 476, 693, 627, 381, 405, 354, 167,  85,  20,  53, 111,
         154, 190, 160,  63, 261, 331, 275, 435, 389, 453, 427, 379, 338,
          95,  49,  22, 125, 174, 221,  61, 271, 302, 299, 469, 343, 431,
         751, 350, 309, 234,   8,  43,  71, 200, 237, 286, 296, 522, 433,
         657, 743, 397, 314,  30,  50, 239, 220, 361, 422, 395,  56, 217,
         281, 377, 425,  18, 177, 301, 398,  11, 334, 393, 346, 437, 351,
         416], dtype=int64),
  array([249, 216, 143, 225, 262, 348, 267, 238, 137, 171, 150, 164, 250,
         681, 345, 366, 227, 132, 222, 149, 129, 144, 142, 278, 328, 840,
         442, 631, 391, 329, 211,  64, 189, 105, 195, 120, 106, 293, 356,
         333, 809, 810, 793, 403, 638, 382, 312, 468,  79,  76, 110, 159,
         298, 102, 426, 259, 362, 295, 852, 801, 670, 753, 363, 375, 498,
          81,  74,  96, 245, 179, 769, 268, 365, 279, 822, 791, 537, 841,
         392, 341, 925,  82,  62, 415, 252, 269, 291, 308, 775, 642, 833,
         406, 358, 257,  83, 223, 253, 697, 483, 411,  66, 288, 182, 777,
         418,  68, 235, 219, 737,  73, 313, 739, 260, 479, 364, 400],
        dtype=int64),
  array([ 231,  251,  131,  244,  205,  380,  325,  266,  180,  178,  147,
           94,  246,  452,  401,  357,  209,  138,  141,  109,  158,  254,
          161,  376,  336,  785,  421,  556,  383,  315,  247,   80,  152,
          188,  202,  118,  197,  218,  226,  409,  342,  823,  799,  764,
          396,  621,  370,  303,  210,   86,   70,  212,  172,  248,  103,
          134,  294,  344,  290,  820,  781,  488,  761,  417,  373,  402,
           87,   69,   92,  204,  265,  107, 1070,  320,  324,  282,  858,
          795,  541,  804,  414,  359,  779,   84,   78,   89,  196,  208,
          277,  311,  732,  511,  789,  368,  355,   65,   77,  256,  206,
          759,  454,  407,   90,  214,  297,  700,  465,   75,  318,  319,
          736,  242,  307,  701,  272,  449,  412,  378], dtype=int64)],
 'base': array([[0.00000000e+00, 0.00000000e+00, 0.00000000e+00],
        [1.16731124e-15, 1.90636393e+01, 1.86616479e-17],
        [1.34800286e+01, 2.85954589e+01, 1.00000000e+00],
        [1.34800286e+01, 9.53181964e+00, 1.00000000e+00]])}
dataset.metadata['atoms']['projection'].info['projection']['base']
array([[0.00000000e+00, 0.00000000e+00, 0.00000000e+00],
       [1.16731124e-15, 1.90636393e+01, 1.86616479e-17],
       [1.34800286e+01, 2.85954589e+01, 1.00000000e+00],
       [1.34800286e+01, 9.53181964e+00, 1.00000000e+00]])
base =np.dot(layer.get_scaled_positions()[:,:2],[a,b])
<matplotlib.collections.PathCollection at 0x1692c6c6180>
layer.cell
Cell([[-1.8146981453231288, 3.6206864875822644, 0.0], [-5.120423935839844, -2.5663707287292707, 0.0], [0.0, 0.0, 1.4318912319027588]])
import h5py
import SciFiReaders
nsid_reader = SciFiReaders.NSIDReader(fileWidget.file_name)
sidpy_datasets = nsid_reader.read()
sidpy_datasets['_relationship']
{'structures': {'Crystal_000': {'angle': 0.0,
   'name': 'aluminum',
   'zone_axis': array([0, 1, 1])}}}
(sidpy_dataset.h5_dataset.name)
'/Measurement_000/Channel_004/LRdeconvol_DemonReg/LRdeconvol_DemonReg'
_main_dsets = []
def read_all(recursive=True, parent=None):
        
        if parent is None:
            h5_group = hdf5_file
        else:
            if not isinstance(parent, h5py.Group):
                raise TypeError('parent should be a h5py.Group object')
            self.__validate_obj_in_same_file(parent)
            h5_group = parent

        if recursive:
            list_of_main = _main_dsets
            keys = ['Channel_{:03}'.format(i) for i in range(len(list_of_main))]
        else:
            list_of_main = []
            keys = []
            for key in h5_group:
                if isinstance(h5_group[key], h5py.Dataset):
                    if check_if_main(h5_group[key]):
                        list_of_main.append(h5_group[key])
                        keys.append(key)

        # Go through each of the identified
        dictionary_of_datasets = {}
        for i,dset in enumerate(list_of_main):
            dictionary_of_datasets[keys[i]] = read_h5py_dataset(dset)
        return dictionary_of_datasets

read_all(recursive=True)
{}
from pyNSID.io.hdf_utils import check_if_main, get_all_main, read_h5py_dataset, h5_group_to_dict

main = get_all_main(hdf5_file)

i = 0
if '_relationship' in hdf5_file[main[i].parent.parent.parent.name].keys():
    g =  hdf5_file[main[i].parent.parent.parent.name] 
    print(g)
    p = h5_group_to_dict(g['_relationship'])
p['_relationship']
hdf5_file[main[i].parent.parent.parent.name].keys()
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[21], line 3
      1 from pyNSID.io.hdf_utils import check_if_main, get_all_main, read_h5py_dataset, h5_group_to_dict
----> 3 main = get_all_main(hdf5_file)
      5 i = 0
      6 if '_relationship' in hdf5_file[main[i].parent.parent.parent.name].keys():

NameError: name 'hdf5_file' is not defined
import sidpy
hdf5_file = h5py.File(fileWidget.file_name, 'r+')
print(hdf5_file["Measurement_000"].keys())
sidpy.hdf_utils.print_tree(hdf5_file)
<KeysViewHDF5 ['Channel_004', '_relationship']>
/
├ Measurement_000
  ---------------
  ├ Channel_004
    -----------
    ├ LRdeconvol_DemonReg
      -------------------
      ├ LRdeconvol_DemonReg
      ├ metadata
        --------
        ├ analysis
          --------
          ├ background_correction
            ---------------------
          ├ non_rigid_demon_registration
            ----------------------------
          ├ rigid_registration
            ------------------
        ├ atoms
          -----
        ├ experiment
          ----------
        ├ fourier
          -------
        ├ plot
          ----
      ├ provenance
        ----------
        ├ sidpy
          -----
          ├ parent_data
            -----------
            ├ provenance
              ----------
              ├ sidpy
                -----
                ├ parent_data
                  -----------
                  ├ provenance
                    ----------
                    ├ sidpy
                      -----
                      ├ parent_data
                        -----------
                        ├ provenance
                          ----------
                          ├ sidpy
                            -----
                            ├ parent_data
                              -----------
                              ├ provenance
                                ----------
                                ├ sidpy
                                  -----
                                  ├ parent_data
                                    -----------
                                    ├ provenance
                                      ----------
                                      ├ sidpy
                                        -----
                                        ├ parent_data
                                          -----------
                                          ├ provenance
                                            ----------
                                            ├ sidpy
                                              -----
      ├ x
      ├ y
  ├ _relationship
    -------------
    ├ structures
      ----------
      ├ Crystal_000
        -----------
hdf5_file.close()
#power_spectrum.add_provenance('jup', 'kkle', 1)
print(dataset.provenance)
im = dataset.sum(axis=0)
im.provenance
{'sidpy': {'like_data': '_0.12.7_2025-07-08-16:14:30.740127', 'parent_data': {'title': 'Sum-DemonReg_new_new', 'provenance': {'sidpy': {'like_data': '_0.12.7_2025-07-08-16:14:27.585951', 'parent_data': {'title': 'Sum-DemonReg_new', 'provenance': {'sidpy': {'like_data': '_0.12.7_2025-07-08-16:14:27.554767', 'parent_data': {'title': 'Sum-DemonReg', 'provenance': {'sidpy': {'like_data': '_0.12.7_2025-07-08-16:11:33.909983', 'parent_data': {'title': 'DemonReg-HAADF', 'provenance': {'sidpy': {'like_data': '_0.12.7_2025-07-08-16:07:26.160958', 'parent_data': {'title': 'RigidReg-HAADF', 'provenance': {'sidpy': {'like_data': '_0.12.7_2025-07-08-16:03:16.254320', 'parent_data': {'title': 'Rigid_Registration', 'provenance': {'sidpy': {'from_array_': '_0.12.7_2025-07-08-16:03:16.254320'}}}}}}}}}}}}}}}}}}}}
{'sidpy': {'like_data': '_0.12.7_2025-07-10-10:54:47.894292',
  'parent_data': {'title': 'LRdeconvol_DemonReg',
   'provenance': {'sidpy': {'like_data': '_0.12.7_2025-07-08-16:14:30.740127',
     'parent_data': {'title': 'Sum-DemonReg_new_new',
      'provenance': {'sidpy': {'like_data': '_0.12.7_2025-07-08-16:14:27.585951',
        'parent_data': {'title': 'Sum-DemonReg_new',
         'provenance': {'sidpy': {'like_data': '_0.12.7_2025-07-08-16:14:27.554767',
           'parent_data': {'title': 'Sum-DemonReg',
            'provenance': {'sidpy': {'like_data': '_0.12.7_2025-07-08-16:11:33.909983',
              'parent_data': {'title': 'DemonReg-HAADF',
               'provenance': {'sidpy': {'like_data': '_0.12.7_2025-07-08-16:07:26.160958',
                 'parent_data': {'title': 'RigidReg-HAADF',
                  'provenance': {'sidpy': {'like_data': '_0.12.7_2025-07-08-16:03:16.254320',
                    'parent_data': {'title': 'Rigid_Registration',
                     'provenance': {'sidpy': {'from_array_': '_0.12.7_2025-07-08-16:03:16.254320'}}}}}}}}}}}}}}}}}}}}}}}

Power Spectrum of Image#

if dataset.data_type.name == 'IMAGE_STACK':
  stack_dim = dataset.get_dimensions_by_type('TEMPORAL')
  image = dataset.sum(axis=stack_dim)
  image.data_type = 'Image'
elif dataset.data_type.name == 'IMAGE':
  image = dataset
else:
  print('We really would need an image here')

power_spectrum = pyTEMlib.image_tools.power_spectrum(image, smoothing=1)
power_spectrum.view_metadata()
print('source: ', power_spectrum.source)
view = power_spectrum.plot()
fft :
	smoothing : 1
	minimum_intensity : 11.103847889613466
	maximum_intensity : 21.181684397201778
source:  LRdeconvol_DemonReg

Spot Detection in Fourier Transform#

Change the spot_threshold value slightly up or down (down is more spots)

# ------Input----------
spot_threshold=0.15
# ---------------------

spots, _ = pyTEMlib.image_tools.diffractogram_spots(power_spectrum, spot_threshold=spot_threshold)
spots = spots[np.linalg.norm(spots[:,:2],axis=1)<7,:]
spots = spots[np.linalg.norm(spots[:,:2],axis=1)>0.5,:]
power_spectrum.plot()

plt.gca().scatter(spots[:,0],spots[:,1], color='red', alpha=0.4);
Found 19 reflections
dataset.provenance
{'sidpy': {'from_array_': '_0.12.7_2025-03-19-18:27:18.331601'}}

Adaptive Fourier Filter#

filtered_dataset = pyTEMlib.image_tools.adaptive_fourier_filter(image, spots, 
                                                                low_pass=2.0, reflection_radius=.3)
view = filtered_dataset.plot(cmap='gray')

Let’s see what we did - In Fourier space, of course.

filtered_power_spectrum = pyTEMlib.image_tools.power_spectrum(filtered_dataset, smoothing=0)

power_spectrum.view_metadata()
print('source: ', power_spectrum.source)
view = filtered_power_spectrum.plot()
fft :
	smoothing : 1
	minimum_intensity : 13.52620834490971
	maximum_intensity : 21.520821921762174
source:  sum_aggregate_DCFI%28HAADF%29

Please note that the spots are ordered from center to outside.

The third parameter of a spot is its angle.

print(spots[:5])
[[-6.70853549 -0.36592012 -1.62528778]
 [ 6.70853549  0.36592012  1.51630487]
 [ 5.42781508 -3.96413461  2.20159394]
 [-5.42781508  3.96413461 -0.93999871]
 [-3.110321   -5.97669526 -2.66175213]]

Log the result#

filtered_dataset.title = 'Fourier_Filtered_Image'
datasets.update({'Log_000': filtered_dataset})

Save Datasets to file#

group = pyTEMlib.file_tools.save_dataset(datasets, filename=dataset.metadata['filename'])
Cannot overwrite file. Using:  p1-3-hr3-1.hf5
C:\Users\gduscher\AppData\Local\anaconda3\lib\site-packages\pyNSID\io\hdf_io.py:111: UserWarning: main_data_name should not contain the "-" character. Reformatted name from:p1-3-hr3 to p1_3_hr3
  warn('main_data_name should not contain the "-" character. Reformatted'
C:\Users\gduscher\AppData\Local\anaconda3\lib\site-packages\pyNSID\io\hdf_utils.py:376: FutureWarning: validate_h5_dimension may be removed in a future version
  warn('validate_h5_dimension may be removed in a future version',
C:\Users\gduscher\AppData\Local\anaconda3\lib\site-packages\pyNSID\io\hdf_utils.py:376: FutureWarning: validate_h5_dimension may be removed in a future version
  warn('validate_h5_dimension may be removed in a future version',

A convenient function to select a dataset (for further processing, visualization or whatever)

chooser = pyTEMlib.file_tools.ChooseDataset(datasets)
chooser.dataset.metadata
{'analysis': 'adaptive fourier filtered',
 'spots': array([[-2.62027028,  2.21908057, -0.86811058],
        [ 2.62027028, -2.21908057,  2.27348207],
        [-3.4226497 ,  0.43880124, -1.44328677],
        [ 3.4226497 , -0.43880124,  1.69830589],
        [-3.22205484, -1.25371784, -1.94187537],
        [ 3.22205484,  1.25371784,  1.19971728],
        [ 1.31640373, -3.23459202,  2.75508635],
        [-1.31640373,  3.23459202, -0.38650631],
        [-2.10624597, -2.80832796, -2.49809154],
        [ 2.10624597,  2.80832796,  0.64350111],
        [-3.51040995,  0.33850382, -1.47466498],
        [ 3.51040995, -0.33850382,  1.66692768],
        [-0.60178456, -3.48533559, -2.97061654],
        [ 0.60178456,  3.48533559,  0.17097612],
        [-2.21908057, -2.93369974, -2.49400159],
        [ 2.21908057,  2.93369974,  0.64759107],
        [-4.73905343,  3.67339327, -0.91140362],
        [ 4.73905343, -3.67339327,  2.23018903],
        [-5.52889567, -2.36952671, -1.97568811],
        [ 5.52889567,  2.36952671,  1.16590454],
        [-0.78984224, -6.0303828 , -3.01135688],
        [ 0.78984224,  6.0303828 ,  0.13023578]]),
 'low_pass': 2.0,
 'reflection_radius': 0.3}

A tree-like plot of the file

print(dataset.h5_dataset.file.filename)
pyTEMlib.file_tools.h5_tree(dataset.h5_dataset.file)
C:\Users\gduscher\Documents\Github\pyTEMlib\example_data\p1-3-hr3-1.hf5
/
├ Measurement_000
  ---------------
  ├ Channel_000
    -----------
    ├ p1_3_hr3
      --------
      ├ metadata
        --------
        ├ experiment
          ----------
      ├ original_metadata
        -----------------
        ├ DM
          --
        ├ DocumentObjectList
          ------------------
          ├ 0
            -
            ├ AnnotationGroupList
              -------------------
              ├ 0
                -
                ├ Font
                  ----
                ├ ObjectTags
                  ----------
            ├ ImageDisplayInfo
              ----------------
              ├ DimensionLabels
                ---------------
              ├ MainSliceId
                -----------
            ├ ObjectTags
              ----------
        ├ DocumentTags
          ------------
        ├ Image Behavior
          --------------
          ├ UnscaledTransform
            -----------------
          ├ ZoomAndMoveTransform
            --------------------
        ├ ImageData
          ---------
          ├ Calibrations
            ------------
            ├ Brightness
              ----------
            ├ Dimension
              ---------
              ├ 0
                -
              ├ 1
                -
          ├ Dimensions
            ----------
        ├ ImageSourceList
          ---------------
          ├ 0
            -
            ├ Id
              --
        ├ ImageTags
          ---------
          ├ Acquisition
            -----------
            ├ Device
              ------
              ├ CCD
                ---
              ├ Configuration
                -------------
                ├ Transpose
                  ---------
            ├ Frame
              -----
              ├ Area
                ----
                ├ Transform
                  ---------
                  ├ Transform List
                    --------------
                    ├ 0
                      -
                      ├ Transpose
                        ---------
              ├ CCD
                ---
              ├ Intensity
                ---------
                ├ Range
                  -----
                ├ Transform
                  ---------
                  ├ Transform List
                    --------------
                    ├ 0
                      -
                    ├ 1
                      -
              ├ Reference Images
                ----------------
                ├ Dark
                  ----
              ├ Sequence
                --------
            ├ Parameters
              ----------
              ├ Base Detector
                -------------
              ├ Detector
                --------
              ├ Environment
                -----------
              ├ High Level
                ----------
                ├ Shutter
                  -------
                ├ Transform
                  ---------
              ├ Objects
                -------
                ├ 0
                  -
                ├ 1
                  -
                ├ 2
                  -
                ├ 3
                  -
          ├ DataBar
            -------
            ├ Custom elements
              ---------------
          ├ Microscope Info
            ---------------
            ├ Items
              -----
              ├ 0
                -
              ├ 1
                -
              ├ 2
                -
        ├ MinVersionList
          --------------
          ├ 0
            -
        ├ Page Behavior
          -------------
          ├ PageTransform
            -------------
        ├ SentinelList
          ------------
        ├ Thumbnails
          ----------
          ├ 0
            -
        ├ UniqueID
          --------
      ├ p1_3_hr3
      ├ x
      ├ y
  ├ Log_000
    -------
    ├ Fourier_Filtered_Image
      ----------------------
      ├ Fourier_Filtered_Image
      ├ metadata
        --------
      ├ x
      ├ y

Close File#

let’s close the file but keep the filename

filename = dataset.h5_dataset.file.filename
dataset.h5_dataset.file.close()

Simulate new notebook#

We can now simulate a new notebook and open the file again.

new_dataset= pyTEMlib.file_tools.open_file(filename)
choose_image = pyTEMlib.file_tools.ChooseDataset(new_dataset)
view = choose_image.dataset.plot()

We want to make an image operation of the images in the file.

choose_image = pyTEMlib.file_tools.ChooseDataset(new_dataset)
print('       subtract')
choose_image2 = pyTEMlib.file_tools.ChooseDataset(new_dataset)
       subtract
new_image = np.array(choose_image.dataset) - np.array(choose_image2.dataset)
new_image = choose_image.dataset.like_data(new_image)
vew = new_image.plot()
choose_image.dataset.metadata
{'filename': 'C:\\Users\\gduscher\\Documents\\Github\\pyTEMlib\\example_data\\p1-3-hr3.dm3',
 'experiment': {'acceleration_voltage': 199990.28125,
  'exposure_time': 1.0,
  'microscope': 'Libra 200 MC'}}