3 def write_general(file_name, geom, controllers, tel, simul_name):
4 """Write (append) general simulation parameter to file for YAO use
7 file_name : (str) : name of the file to append the parameter to
9 geom : (Param_geom) : compass AO geometry parameters
11 controllers : ([Param_controller]) : list of compass controller parameters
13 tel : (Param_tel) : compass telescope parameters
15 simul_name : (str) : simulation name
17 f = open(file_name,
"w")
18 f.write(
"\n\n//------------------------------")
19 f.write(
"\n//general parameters")
20 f.write(
"\n//------------------------------")
21 f.write(
"\nsim.name = \"" + simul_name +
"\";")
22 f.write(
"\nsim.pupildiam = " + str(geom.pupdiam) +
";")
23 f.write(
"\nsim.debug = 0;")
24 f.write(
"\nsim.verbose = 1;")
26 f.write(
"\nmat.file = \"\";")
27 f.write(
"\nmat.condition = &(" + np.array2string( \
28 np.array([np.sqrt(c.maxcond)
for c
in controllers]), \
29 separator=
',',max_line_width=300) +
");")
31 f.write(
"\nmat.method = \"none\";")
33 f.write(
"\nYAO_SAVEPATH = \"\"; // where to save the output to the simulations")
35 f.write(
"\ntel.diam = " + str(tel.diam) +
";")
36 f.write(
"\ntel.cobs = " + str(tel.cobs) +
";")
38 f.write(
"\nwfs = [];")
def write_general(file_name, geom, controllers, tel, simul_name)
Write (append) general simulation parameter to file for YAO use.