Register new file reader in the reader registry system.

This commit is contained in:
2025-05-14 13:51:28 +02:00
parent ad4339a76b
commit a22532d08d
2 changed files with 84 additions and 77 deletions

View File

@ -15,8 +15,9 @@ from instruments.readers.xps_ibw_reader import read_xps_ibw_file_as_dict
from instruments.readers.g5505_text_reader import read_txt_files_as_dict from instruments.readers.g5505_text_reader import read_txt_files_as_dict
from instruments.readers.acsm_tofware_reader import read_acsm_files_as_dict from instruments.readers.acsm_tofware_reader import read_acsm_files_as_dict
from instruments.readers.acsm_flag_reader import read_jsonflag_as_dict from instruments.readers.acsm_flag_reader import read_jsonflag_as_dict
from instruments.readers.nasa_ames_reader import read_nasa_ames_as_dict
file_extensions = ['.ibw','.txt','.dat','.h5','.TXT','.csv','.pkl','.json','.yaml'] file_extensions = ['.ibw','.txt','.dat','.h5','.TXT','.csv','.pkl','.json','.yaml','.nas']
# Define the instruments directory (modify this as needed or set to None) # Define the instruments directory (modify this as needed or set to None)
default_instruments_dir = None # or provide an absolute path default_instruments_dir = None # or provide an absolute path
@ -28,7 +29,8 @@ file_readers = {
'csv': 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),
'ACSM_TOFWARE_txt' : lambda x: read_acsm_files_as_dict(x, instruments_dir=default_instruments_dir, work_with_copy=False), 'ACSM_TOFWARE_txt' : lambda x: read_acsm_files_as_dict(x, instruments_dir=default_instruments_dir, work_with_copy=False),
'ACSM_TOFWARE_csv' : lambda x: read_acsm_files_as_dict(x, instruments_dir=default_instruments_dir, work_with_copy=False), 'ACSM_TOFWARE_csv' : lambda x: read_acsm_files_as_dict(x, instruments_dir=default_instruments_dir, work_with_copy=False),
'ACSM_TOFWARE_flags_json' : lambda x: read_jsonflag_as_dict(x)} 'ACSM_TOFWARE_flags_json' : lambda x: read_jsonflag_as_dict(x),
'ACSM_TOFWARE_nas' : lambda x: read_nasa_ames_as_dict(x)}
REGISTRY_FILE = "registry.yaml" #os.path.join(os.path.dirname(__file__), "registry.yaml") REGISTRY_FILE = "registry.yaml" #os.path.join(os.path.dirname(__file__), "registry.yaml")

View File

@ -1,75 +1,80 @@
instruments: instruments:
- instrumentFolderName: default - instrumentFolderName: default
fileExtension: csv fileExtension: csv
fileReaderPath: instruments/readers/g5505_text_reader.py fileReaderPath: instruments/readers/g5505_text_reader.py
InstrumentDictionaryPath: null InstrumentDictionaryPath: null
- instrumentFolderName: NEXAFS - instrumentFolderName: NEXAFS
fileExtension: h5 fileExtension: h5
fileReaderPath: instruments/readers/hdf5_file_reader.py fileReaderPath: instruments/readers/hdf5_file_reader.py
InstrumentDictionaryPath: null InstrumentDictionaryPath: null
- instrumentFolderName: SES - instrumentFolderName: SES
fileExtension: ibw fileExtension: ibw
fileReaderPath: instruments/readers/xps_ibw_reader.py fileReaderPath: instruments/readers/xps_ibw_reader.py
InstrumentDictionaryPath: null InstrumentDictionaryPath: null
- instrumentFolderName: RGA - instrumentFolderName: RGA
fileExtension: txt fileExtension: txt
fileReaderPath: instruments/readers/g5505_text_reader.py fileReaderPath: instruments/readers/g5505_text_reader.py
InstrumentDictionaryPath: instruments/dictionaries/RGA.yaml InstrumentDictionaryPath: instruments/dictionaries/RGA.yaml
- instrumentFolderName: Pressure - instrumentFolderName: Pressure
fileExtension: dat fileExtension: dat
fileReaderPath: instruments/readers/g5505_text_reader.py fileReaderPath: instruments/readers/g5505_text_reader.py
InstrumentDictionaryPath: instruments/dictionaries/Pressure.yaml InstrumentDictionaryPath: instruments/dictionaries/Pressure.yaml
- instrumentFolderName: Humidity_Sensors - instrumentFolderName: Humidity_Sensors
fileExtension: dat fileExtension: dat
fileReaderPath: instruments/readers/g5505_text_reader.py fileReaderPath: instruments/readers/g5505_text_reader.py
InstrumentDictionaryPath: instruments/dictionaries/Humidity_Sensors.yaml InstrumentDictionaryPath: instruments/dictionaries/Humidity_Sensors.yaml
- instrumentFolderName: ICAD - instrumentFolderName: ICAD
fileExtension: dat fileExtension: dat
fileReaderPath: instruments/readers/g5505_text_reader.py fileReaderPath: instruments/readers/g5505_text_reader.py
InstrumentDictionaryPath: instruments/dictionaries/ICAD.yaml InstrumentDictionaryPath: instruments/dictionaries/ICAD.yaml
- instrumentFolderName: Lopap - instrumentFolderName: Lopap
fileExtension: dat fileExtension: dat
fileReaderPath: instruments/readers/g5505_text_reader.py fileReaderPath: instruments/readers/g5505_text_reader.py
InstrumentDictionaryPath: instruments/dictionaries/Lopap.yaml InstrumentDictionaryPath: instruments/dictionaries/Lopap.yaml
- instrumentFolderName: T200_NOx - instrumentFolderName: T200_NOx
fileExtension: dat fileExtension: dat
fileReaderPath: instruments/readers/g5505_text_reader.py fileReaderPath: instruments/readers/g5505_text_reader.py
InstrumentDictionaryPath: instruments/dictionaries/T200_NOx.yaml InstrumentDictionaryPath: instruments/dictionaries/T200_NOx.yaml
- instrumentFolderName: T360U_CO2 - instrumentFolderName: T360U_CO2
fileExtension: dat fileExtension: dat
fileReaderPath: instruments/readers/g5505_text_reader.py fileReaderPath: instruments/readers/g5505_text_reader.py
InstrumentDictionaryPath: instruments/dictionaries/T360U_CO2.yaml InstrumentDictionaryPath: instruments/dictionaries/T360U_CO2.yaml
- instrumentFolderName: htof - instrumentFolderName: htof
fileExtension: h5 fileExtension: h5
fileReaderPath: null fileReaderPath: null
InstrumentDictionaryPath: null InstrumentDictionaryPath: null
- instrumentFolderName: smps - instrumentFolderName: smps
fileExtension: txt fileExtension: txt
fileReaderPath: instruments/readers/g5505_text_reader.py fileReaderPath: instruments/readers/g5505_text_reader.py
InstrumentDictionaryPath: instruments/dictionaries/smps.yaml InstrumentDictionaryPath: instruments/dictionaries/smps.yaml
- instrumentFolderName: gas - instrumentFolderName: gas
fileExtension: txt fileExtension: txt
fileReaderPath: instruments/readers/g5505_text_reader.py fileReaderPath: instruments/readers/g5505_text_reader.py
InstrumentDictionaryPath: instruments/dictionaries/gas.yaml InstrumentDictionaryPath: instruments/dictionaries/gas.yaml
- instrumentFolderName: ACSM_TOFWARE - instrumentFolderName: ACSM_TOFWARE
fileExtension: txt fileExtension: txt
fileReaderPath: instruments/readers/acsm_tofware_reader.py fileReaderPath: instruments/readers/acsm_tofware_reader.py
InstrumentDictionaryPath: instruments/dictionaries/ACSM_TOFWARE.yaml InstrumentDictionaryPath: instruments/dictionaries/ACSM_TOFWARE.yaml
- instrumentFolderName: ACSM_TOFWARE - instrumentFolderName: ACSM_TOFWARE
fileExtension: csv fileExtension: csv
fileReaderPath: instruments/readers/acsm_tofware_reader.py fileReaderPath: instruments/readers/acsm_tofware_reader.py
InstrumentDictionaryPath: instruments/dictionaries/ACSM_TOFWARE.yaml InstrumentDictionaryPath: instruments/dictionaries/ACSM_TOFWARE.yaml
- instrumentFolderName: ACSM_TOFWARE
fileExtension: nas
fileReaderPath: instruments/readers/nasa_ames_reader.py
InstrumentDictionaryPath: instruments/dictionaries/EBAS.yaml