momentoscope / hextof-processor

Code for preprocessing data from the HEXTOF instrument at FLASH, DESY in Hamburg (DE)
https://hextof-processor.readthedocs.io/en/latest/
GNU General Public License v3.0
7 stars 4 forks source link

settings folder at the wrong postion. #105

Closed MichaelHeber closed 2 years ago

MichaelHeber commented 2 years ago

The DldFlashProcessorExpress is looking for the settings in the src folder.

I shifted settings folder into src folder to solve the issue.

The Error:

FileNotFoundError Traceback (most recent call last)

in ----> 1 prc = DldFlashProcessorExpress(35461,settings='NiOnWX20', daq='fl1user2') 2 #print(os.listdir(prc.DATA_RAW_DIR)) 3 prc.readData(daq="fl1user2") 4 5 # prc = DldFlashProcessorExpress(36241,settings='Dendzik_2020exp', daq='fl1user2') ~/hextof-processor/src/processor/DldFlashDataframeCreatorExpress.py in __init__(self, runNumber, channels, settings, beamtime_dir, parquet_path, parquet_dir, beamtime_id, year, daq, silent) 31 def __init__(self, runNumber = None, channels = None, settings = None, beamtime_dir=None, 32 parquet_path=None, parquet_dir=None, beamtime_id=None, year=None, daq="fl1user2", silent=False): ---> 33 super().__init__(settings=settings,silent=silent) 34 self.runNumber = runNumber 35 ~/hextof-processor/src/processor/DldProcessor.py in __init__(self, settings, silent) 66 print(f'Using settings from {self._settings_file}') 67 else: ---> 68 available_settings = os.listdir(os.path.join(self.root_folder, 'settings')) 69 settings = os.path.splitext(settings)[0]+'.ini' 70 if settings not in available_settings: FileNotFoundError: [Errno 2] No such file or directory: '/home/hebermic/hextof-processor/src/settings' I needed to shift settings folder into src folder.
zain-sohail commented 2 years ago

Yes this was a problem. The DldProcessor can be easily bypassed if we use the file extension when passing it to DldFlashProcessorExpress:

prc = DldFlashProcessorExpress(36241,settings='Dendzik_2020exp.ini', daq='fl1user2')

This should work without trouble. Currently trying to finish the tutorials so it's clear.