From 88c34dfc3912148f4fe134ef31588886936f3840 Mon Sep 17 00:00:00 2001 From: ahoust17 <88668350+ahoust17@users.noreply.github.com> Date: Tue, 17 Dec 2024 08:03:57 -0500 Subject: [PATCH] change for nion compatibility --- pyTEMlib/file_tools.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pyTEMlib/file_tools.py b/pyTEMlib/file_tools.py index f5a50a2c..c3b16bfd 100644 --- a/pyTEMlib/file_tools.py +++ b/pyTEMlib/file_tools.py @@ -990,10 +990,11 @@ def open_file(filename=None, h5_group=None, write_hdf_file=False, sum_frames=Fa # Temporary Fix for dual eels spectra in dm files # Todo: Fic in ScifyReaders - for dset in dataset_dict.values(): - if 'single_exposure_time' in dset.metadata['experiment']: - dset.metadata['experiment']['exposure_time'] = dset.metadata['experiment']['number_of_frames'] * \ - dset.metadata['experiment']['single_exposure_time'] + for dset in dataset_dict.values(): + if 'experiment' in dset.metadata: + if 'single_exposure_time' in dset.metadata['experiment']: + dset.metadata['experiment']['exposure_time'] = dset.metadata['experiment']['number_of_frames'] * \ + dset.metadata['experiment']['single_exposure_time'] if write_hdf_file: h5_master_group = save_dataset(dataset_dict, filename=filename)