COMPASS  5.0.0
End-to-end AO simulation tool using GPU acceleration
nono_loop.py
1 """script test to simulate a closed loop
2 
3 Usage:
4  closed_loop.py <parameters_filename> [options]
5 
6 with 'parameters_filename' the path to the parameters file
7 
8 Options:
9  -h --help Show this help message and exit
10  --brahma Distribute data with brahma
11  --bench For a timed call
12  -d, --devices devices Specify the devices
13 """
14 
15 from docopt import docopt
16 
17 import shesha.sim
18 from shesha.constants import ControllerType
19 
20 arguments = docopt(__doc__)
21 param_file = arguments["<parameters_filename>"]
22 
23 # Get parameters from file
24 # if arguments["--bench"]:
25 # sim = shesha_sim.Bench(param_file)
26 # elif arguments["--brahma"]:
27 # sim = shesha_sim.SimulatorBrahma(param_file)
28 # else:
29 # sim = shesha_sim.Simulator(param_file)
30 
31 sim = shesha_sim.BenchBrahma(param_file)
32 sim.config.p_controller0.set_type(ControllerType.GENERIC)
33 
34 if arguments["--devices"]:
35  devices = []
36  for k in range(len(arguments["--devices"])):
37  devices.append(int(arguments["--devices"][k]))
38  sim.config.p_loop.set_devices(devices)
39 
40 sim.init_sim()
41 sim.loop(monitoring_freq=100)
shesha.constants
Numerical constants for shesha and config enumerations for safe-typing.
Definition: constants.py:1