4 script_roket.py <parameters_filename> [options]
6 with 'parameters_filename' the path to the parameters file
9 -h --help Show this help message and exit
10 -s, --savefile savename Set the name of the ouput h5 file that will be saved in $DATA_GUARDIAN
11 -d, --diam diam Set the telescope diameter [m]
12 --niter niter Set the number of iterations
13 --nssp nxsub Set the number of subapertures of the WFS. Number of actuators is actualized to nxsub+1
14 --npix npix Set the number of pixels per subap.
15 --pixsize pixsize Set the WFS pixel size [arcsec]
16 --nfilt nfilt Set the number of filtered modes
17 --winddir winddir Set the wind direction
18 --windspeed windspeed Set the wind speed
19 --noise noise Set the noise value
20 --gain gain Set the loop gain
21 --devices devices Specify the devices to use
22 --gamma gamma Set the value of the centroid gain
23 --seeds seeds Set the turbulence seeds
24 --alt alt Set the layer altitude
26 Usage with Ipython: ipython [-i] script_roket.py -- [options]
29 from docopt
import docopt
33 from guardian.roket
import Roket
35 arguments = docopt(__doc__)
36 param_file = arguments[
"<parameters_filename>"]
39 if arguments[
"--savefile"]:
40 savefile = arguments[
"--savefile"]
42 savefile =
"roket_default.h5"
45 if arguments[
"--gamma"]:
46 gamma = 1 / float(arguments[
"--gamma"])
47 roket = Roket(param_file, gamma=gamma)
49 if arguments[
"--diam"]:
50 roket.config.p_tel.set_diam(float(arguments[
"--diam"]))
51 if arguments[
"--niter"]:
52 roket.config.p_loop.set_niter(int(arguments[
"--niter"]))
53 if arguments[
"--nssp"]:
54 roket.config.p_wfss[0].set_nxsub(int(arguments[
"--nssp"]))
55 roket.config.p_dms[0].set_nact(int(arguments[
"--nssp"]) + 1)
56 if arguments[
"--npix"]:
57 roket.config.p_wfss[0].set_npix(int(arguments[
"--npix"]))
58 if arguments[
"--pixsize"]:
59 roket.config.p_wfss[0].set_pixsize(float(arguments[
"--pixsize"]))
60 if arguments[
"--nfilt"]:
61 roket.config.p_controllers[0].set_maxcond(float(arguments[
"--nfilt"]))
62 if arguments[
"--windspeed"]:
63 roket.config.p_atmos.set_windspeed([float(arguments[
"--windspeed"])])
64 if arguments[
"--winddir"]:
65 roket.config.p_atmos.set_winddir([float(arguments[
"--winddir"])])
66 if arguments[
"--noise"]:
67 roket.config.p_wfss[0].set_noise(float(arguments[
"--noise"]))
68 if arguments[
"--gain"]:
69 roket.config.p_controllers[0].set_gain(float(arguments[
"--gain"]))
70 if arguments[
"--seeds"]:
71 roket.config.p_atmos.set_seeds([int(arguments[
"--seeds"])])
72 if arguments[
"--alt"]:
73 roket.config.p_atmos.set_alt([float(arguments[
"--alt"])])
75 if arguments[
"--devices"]:
77 for k
in range(len(arguments[
"--devices"])):
78 devices.append(int(arguments[
"--devices"][k]))
79 roket.config.p_loop.set_devices(devices)
83 roket.save_in_hdf5(savefile)