Make file reader selection case insensitive by using ext.lower() and update config_text_reader.py to point to renamed dictionary.

This commit is contained in:
2025-02-08 19:45:16 +01:00
parent 0b29e2ec68
commit c28286a626
2 changed files with 4 additions and 3 deletions

View File

@ -30,7 +30,7 @@ HONO: #ICAD/HONO:
file_encoding : 'latin-1'
timestamp: ['Start Date/Time (UTC)']
datetime_format: '%Y-%m-%d %H:%M:%S.%f'
link_to_description: 'dictionaries/ICAD_HONO.yaml'
link_to_description: 'dictionaries/ICAD.yaml'
NO2: #ICAD/NO2:
table_header : 'Start Date/Time (UTC) Duration (s) NO2 (ppb) NO2 Uncertainty (ppb) H2O (ppb) H2O Uncertainty (ppb) CHOCHO (ppb) CHOCHO Uncertainty (ppb) File Number Light Intensity #ICEDOAS iter. Cell Pressure Ambient Pressure Cell Temp Spec Temp Lat Lon Height Speed GPSQuality 0-Air Ref. Time 0-Air Ref. Duration 0-Air Ref. File Number 0-Air Ref. Intensity 0-Air Ref. Rel Intensity 0-Air Ref. Intensity valid MeasMode SampleSource'
@ -38,7 +38,7 @@ NO2: #ICAD/NO2:
file_encoding : 'latin-1'
timestamp: ['Start Date/Time (UTC)']
datetime_format: '%Y-%m-%d %H:%M:%S.%f'
link_to_description: 'dictionaries/ICAD_NO2.yaml'
link_to_description: 'dictionaries/ICAD.yaml'
Lopap:
#table_header : 'Date;Time;Ch1;490.1;500.2;510.0;520.0;530.1;540.0;550.7;603.2;700.3;800.0;Ch2;500.5;510.3;520.5;530.7;540.8;550.5;550.8;560.9;570.9;581.2;586.2;591.2;596.1;601.1;606.4;611.3;'

View File

@ -15,7 +15,7 @@ default_instruments_dir = None # or provide an absolute path
file_readers = {
'ibw': lambda a1: read_xps_ibw_file_as_dict(a1),
'txt': lambda a1: read_txt_files_as_dict(a1, instruments_dir=default_instruments_dir, work_with_copy=False),
'TXT': lambda a1: read_txt_files_as_dict(a1, instruments_dir=default_instruments_dir, work_with_copy=False),
# 'TXT': lambda a1: read_txt_files_as_dict(a1, instruments_dir=default_instruments_dir, work_with_copy=False),
'dat': lambda a1: read_txt_files_as_dict(a1, instruments_dir=default_instruments_dir, work_with_copy=False),
'csv': lambda a1: read_txt_files_as_dict(a1, instruments_dir=default_instruments_dir, work_with_copy=False)
}
@ -52,6 +52,7 @@ def compute_filereader_key_from_path(hdf5_file_path):
# Extract the filename and its extension
filename, file_extension = os.path.splitext(parts[-1])
file_extension = file_extension.lower()
# Extract the first directory directly under the root directory '/' in the hdf5 file
subfolder_name = parts[0] if len(parts) > 1 else ""