Analysis

Group of tools for analyzing the data

source

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
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"""
    config_file_path = Dir.joinpath('config', 'main.ini')
    if not isfile(config_file_path):
        warning('The main config file "config/main.ini" does not exist! Using the default!')
        copyfile(Dir.joinpath('config', 'default.ini'), config_file_path)
    return Config(config_file_path)

source

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


source

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

source

Analysis.create_run_config

 Analysis.create_run_config ()

Creates a runlog.json from Google spreadsheet


source

main

 main ()

source

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


source

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'

source

Analysis.print_testcampaign

 Analysis.print_testcampaign ()

Prints current timestamp and the location and date of the beam test

z = Analysis('201912', verbose=True)
z.print_testcampaign()
INFO:     14:47:47 --> Beam Test in Dec 2019 at DESY
Analysis.Locations
{'CERN': [201809, 201810], 'DESY': [201912]}