Example #1
0
 # (from configuration.yaml)
 # fe_configuration:
 # ...
 #
 # If no configuration file exists, a initial configuration will be create according to fe_flavor.
 # To load a specific configuration file, a path to FE configuration file or a run number (e.g. 5) can be given:
 #
 # (from configuration.yaml)
 # fe_configuration: 1
 # ...
 #
 # This will retain the configuration for the following scans.
 # Please note: no configuration file exists at this stage because no run was executed so far.
 #
 # Executing runs defined by a primlist:
 runmngr.run_primlist('example_run_manager.plst', skip_remaining=True)  # executing primlist.plst file, specific run configuration are set inside the primlist file, skip remaining scans on error
 # press Ctrl-C to abort the run at any time
 # Each scan has a default run configuration, which is defined inside the corresponding scan file in /host/pybar/scans/.
 # It is not necessary to add run parameters to the primlist file. If not given they are taken from the default run configuration (_default_run_conf).
 #
 # Running a single scan and changing default run configuration (_default_run_conf):
 join = runmngr.run_run(run=AnalogScan, run_conf={"scan_parameters": [('PlsrDAC', 500)], "n_injections": 1000}, use_thread=True)  # run_run returns a function object when use_thread is True
 status = join()  # waiting here for finishing the run, press Ctrl-C to abort the run at any time
 print 'Status:', status  # will wait for run to be finished and returns run status
 #
 # Or use a run configuration file:
 status = runmngr.run_run(run=AnalogScan, run_conf="example_run_manager_run_config.txt")  # using no thread
 print 'Status:', status
 #
 # Example for a loop of runs, which is failing:
 for delay in range(14, 50, 16):
Example #2
0
from pybar.run_manager import RunManager  # importing run manager
from pybar.scans.scan_analog import AnalogScan
from pybar.scans.scan_ext_trigger_gdac import ExtTriggerGdacScan
from pybar.run_manager import run_status

if __name__ == "__main__":
    runmngr = RunManager('../../pybar/configuration.yaml')  # loading configuration file, specifying hardware configuration and module configuration.
    #
    # Running primlist:
    runmngr.run_primlist('example_run_manager.plst', skip_remaining=True)  # executing primlist.plst file, specific scan parameters are set inside the primlist file, skip remaining scans on error
    # Each scan has a default configuration, which is defined inside the corresponding scan file in /host/pybar/scans/. It is not necessary to define scan parameters inside primlist file.
    #
    # Running single scan and changing scan parameters:
    join = runmngr.run_run(run=AnalogScan, run_conf={"scan_parameters": [('PlsrDAC', 500)], "n_injections": 1000}, use_thread=True)  # run_run returns a function object when use_thread is True
    status = join()
    print 'Status:', status  # will wait for scan to be finished and returns run status
    #
    # Or use a run configuration file:
    status = runmngr.run_run(run=AnalogScan, run_conf="run_configuration.txt")  # using no thread
    print 'Status:', status
    #
    # Example for a loop:
    for gdac in range(50, 200, 10):
        join = runmngr.run_run(ExtTriggerGdacScan, run_conf={'scan_parameters': {'GDAC': gdac}}, use_thread=True)  # use thread
        print 'Status:', join(timeout=5)  # join has a timeout, return None if run has not yet finished
        runmngr.abort_current_run()  # stopping/aborting run from outside
        if join() != run_status.finished:  # status OK?
            print 'ERROR!'
            break  # jump out
    #
    # After finishing the primlist/run: you will find the module data relative to the configuration.yaml file.
Example #3
0
 # fe_configuration:
 # ...
 #
 # If no configuration file exists, a initial configuration will be create according to fe_flavor.
 # To load a specific configuration file, a path to FE configuration file or a run number (e.g. 5) can be given:
 #
 # (from configuration.yaml)
 # fe_configuration: 1
 # ...
 #
 # This will retain the configuration for the following scans.
 # Please note: no configuration file exists at this stage because no run was executed so far.
 #
 # Executing runs defined by a primlist:
 runmngr.run_primlist(
     'example_run_manager.plst', skip_remaining=True
 )  # executing primlist.plst file, specific run configuration are set inside the primlist file, skip remaining scans on error
 # press Ctrl-C to abort the run at any time
 # Each scan has a default run configuration, which is defined inside the corresponding scan file in /host/pybar/scans/.
 # It is not necessary to add run parameters to the primlist file. If not given they are taken from the default run configuration (_default_run_conf).
 #
 # Running a single scan and changing default run configuration (_default_run_conf):
 join = runmngr.run_run(
     run=AnalogScan,
     run_conf={
         "scan_parameters": [('PlsrDAC', 500)],
         "n_injections": 1000
     },
     use_thread=True
 )  # run_run returns a function object when use_thread is True
 status = join(