def load_config():
"""A utility function that loads config file
it expects main.ini file in the config directory under the root analyis directory
Returns the instance of `Config` class"""
= Dir.joinpath('config', 'main.ini')
config_file_path if not isfile(config_file_path):
'The main config file "config/main.ini" does not exist! Using the default!')
warning('config', 'default.ini'), config_file_path)
copyfile(Dir.joinpath(return Config(config_file_path)
Analysis
BeamTest
BeamTest (p:pathlib.Path)
structure containing information about a beam test: - Path to the data Dir - Location - T - date as a datetime - Year - Tag and Name - same as T but in string formats
Type | Details | |
---|---|---|
p | Path | path to the data dir |
load_config
load_config ()
A utility function that loads config file it expects main.ini file in the config directory under the root analyis directory Returns the instance of Config
class
Analysis
Analysis (beamtest:str=None, meta_sub_dir:str='', verbose:bool=False)
The analysis class provides default behaviour objects in the analysis framework and is the parent of all other analysis objects. The main part
Type | Default | Details | |
---|---|---|---|
beamtest | str | None | A year and a month of the beam test, for example ‘201912’ for DESY and ‘201810’ for CERN |
meta_sub_dir | str | Subdirectory for storing meta files | |
verbose | bool | False | Verbosity |
Analysis.create_run_config
Analysis.create_run_config ()
Creates a runlog.json from Google spreadsheet
main
main ()
Analysis.init_locations
Analysis.init_locations ()
creates folders for each beamtest organizing them by location then by date, in order to store there raw and processed data storing raw and processed data
Analysis.find_testcampaign
Analysis.find_testcampaign ()
Determine the Tag of the test beam, either from the current path or from config file
Analysis.find_testcampaign()
'201912'
Analysis.print_testcampaign
Analysis.print_testcampaign ()
Prints current timestamp and the location and date of the beam test
= Analysis('201912', verbose=True)
z z.print_testcampaign()
INFO: 14:47:47 --> Beam Test in Dec 2019 at DESY
Analysis.Locations
{'CERN': [201809, 201810], 'DESY': [201912]}