The experiment_handler package contains a single module, experiment_handler, that is a standalone program.
This program runs a given experiment. It will use the experiment’s build_scans method to create the iterable ScanClassBase objects that will be used by the radar_control block, then it will pass the experiment to the radar_control block to run.
It will be passed some data to use in its update method at the end of every integration time. This has yet to be implemented but will allow experiment_prototype to modify itself based on received data as feedback.
2018 SuperDARN Canada
- experiment_handler.experiment_handler.experiment_handler(semaphore, args)¶
Run the experiment. This is the main process when this program is called.
This process runs the experiment from the module that was passed in as an argument. It currently does not exit unless killed. It may be updated in the future to exit if provided with an error flag.
This process begins with setup of sockets and retrieving the experiment class from the module. It then waits for a message of type RadarStatus to come in from the radar_control block. If the status is ‘EXPNEEDED’, meaning an experiment is needed, experiment_handler will build the scan iterable objects (of class ScanClassBase) and will pass them to radar_control. Other statuses will be implemented in the future.
In the future, the update method will be implemented where the experiment can be modified by the incoming data.
Creates the parser to retrieve the experiment module.
parser, the argument parser for the experiment_handler.
Retrieve the experiment class from the provided module given as an argument.
experiment_module_name – The name of the experiment module to run from the Borealis project’s experiments directory.
ExperimentException – if the experiment module provided as an argument does not contain a single class that inherits from ExperimentPrototype class.
Experiment, the experiment class, inherited from ExperimentPrototype.
- experiment_handler.experiment_handler.send_experiment(exp_handler_to_radar_control, iden, serialized_exp)¶
Send the experiment to radar_control module.
exp_handler_to_radar_control – socket to send the experiment on
iden – ZMQ identity
serialized_exp – Either a pickled experiment or a None.
Return the usage message for this process.
This is used if a -h flag or invalid arguments are provided.
the usage message
usage: experiment_handler.py [-h] experiment_module scheduling_mode_type Pass the module containing the experiment to the experiment handler as a required argument. It will search for the module in the BOREALISPATH/experiment_prototype package. It will retrieve the class from within the module (your experiment). It will use the experiment's build_scans method to create the iterable ScanClassBase objects that will be used by the radar_control block, then it will pass the experiment to the radar_control block to run. It will be passed some data to use in its .update() method at the end of every integration time. This has yet to be implemented but will allow experiments to modify themselves based on received data as feedback. This is not a necessary method for all experiments and if there is no update method experiment updates will not occur.
The name of the module in the experiment_prototype package that contains your Experiment class, e.g. normalscan
The type of scheduling time for this experiment run, e.g. common, special, or discretionary.
- -h, --help¶
show this help message and exit
- --kwargs_string <kwargs_string>¶
String of keyword arguments for the experiment.