Reverted a few minor refactoring changes.

This commit is contained in:
2024-02-15 10:10:10 +01:00
parent 8ba9547895
commit 337a1947fe
2 changed files with 11 additions and 5 deletions

View File

@ -8,6 +8,8 @@ from igor2.binarywave import load as loadibw
#import h5py
import os
import tempfile
import shutil
def read_xps_ibw_file_as_dict(filename):
@ -39,14 +41,14 @@ def read_xps_ibw_file_as_dict(filename):
if not key in exclude_list:
file_dict['attributes_dict'][key] = value
# TODO: talk to thorsten to see if there is an easier way to access the below attributes
# TODO: talk to Thorsten to see if there is an easier way to access the below attributes
dimension_labels = file_obj['wave']['dimension_units'].decode("utf-8").split(']')
file_dict['attributes_dict']['dimension_units'] = [item+']' for item in dimension_labels[0:len(dimension_labels)-1]]
return file_dict
def main():

View File

@ -12,7 +12,7 @@ from plotly.subplots import make_subplots
import g5505_file_reader
import g5505_utils as utils
import src.smog_chamber_file_reader as smog_chamber_file_reader
import smog_chamber_file_reader
def read_mtable_as_dataframe(filename):
@ -472,8 +472,9 @@ def main_5505():
file_dict = g5505_file_reader.read_xps_ibw_file_as_dict(inputfile_dir+'\\SES\\0069069_N1s_495eV.ibw')
group_by_type = lambda x : utils.group_by_df_column(x,'filetype')
select_file_keywords=[]
select_dir_keywords = ['NEXAFS', 'Notes', 'Photos', 'Pressure', 'RGA', 'SES']
create_hdf5_file_from_filesystem_path('test_sls_data.h5',inputfile_dir,select_dir_keywords,select_file_keywords=[])
create_hdf5_file_from_filesystem_path('test_sls_data.h5',inputfile_dir,select_dir_keywords,select_file_keywords)
display_group_hierarchy_on_a_treemap('test_smog_chamber_v5.h5')
#create_hdf5_file('test', inputfile_dir, 'Topdown', [group_by_type], extract_attrs_func = None)
@ -489,8 +490,11 @@ def main_smog_chamber():
display_group_hierarchy_on_a_treemap('test_smog_chamber_v5.h5')
def main_mtable_h5_from_dataframe():
#import os
ROOT_DIR = os.path.abspath(os.curdir)
# Read BeamTimeMetaData.h5, containing Thorsten's Matlab Table
input_data_df = read_mtable_as_dataframe('input_files\\BeamTimeMetaData.h5')
input_data_df = read_mtable_as_dataframe(os.path.join(ROOT_DIR,'input_files\\BeamTimeMetaData.h5'))
# Preprocess Thorsten's input_data dataframe so that i can be used to create a newer .h5 file
# under certain grouping specificiations.