9 from shesha.util.writers
import common
12 fits_file_name="./yao.fits",
13 screen_dir="\"./yao_screen\"",
17 imat_type="controller"):
18 """Write parameter files for YAO simulations
21 sup : (CompassSupervisor) : supervisor
24 param_file_name : (str) : (optional), default "./yao.par" name of the yao parameter file
26 fits_file_name : (str) : (optional), default "./yao.fits" name of fits file containing sub-apertures and actuator position etc
28 screen_dir : (str) : (optional), default "./yao_screen" path to the yao turbulent screen files
30 n_wfs : (int) : (optional), number of WFS (default: all wfs)
32 controller_id : (int) : index of te controller (default : all)
34 influ_index : (int) : actuator index to get the influence function from
36 imat_type : (str) : (optional), default "controller" use of regular controller or split tomography (among "controller", "splitTomo")
40 n_wfs = len(conf.p_wfss)
41 zerop = conf.p_wfss[0].zerop * sup.get_s_pupil().sum() * \
42 (conf.p_tel.diam / conf.p_geom.pupdiam) ** 2
43 lgs_return_per_watt = max([w.lgsreturnperwatt
for w
in conf.p_wfss])
45 print(
"writing parameter file to " + param_file_name)
46 write_general(param_file_name, conf.p_geom, conf.p_controllers,
47 conf.p_tel, conf.simul_name)
50 ndm = init_dm(param_file_name)
51 for sub_system, c
in enumerate(conf.p_controllers):
52 dms = [ conf.p_dms[i]
for i
in c.get_ndm() ]
53 ndm += write_dms (param_file_name, dms ,sub_system=sub_system + 1,
55 dm_offset = dm_offset+len(dms)
56 finish_dm(param_file_name, ndm)
57 gs = init_wfs(param_file_name)
58 for sub_system, c
in enumerate(conf.p_controllers):
59 wfss = [ conf.p_wfss[i]
for i
in c.get_nwfs()]
60 n_ngs, n_lgs = write_wfss(param_file_name, wfss, sub_system=sub_system + 1,
61 n_wfs=n_wfs, offset=wfs_offset)
62 gs = (gs[0] + n_ngs, gs[1] + n_lgs)
63 wfs_offset = wfs_offset + len(wfss)
64 finish_wfs(param_file_name, gs[0], gs[1])
65 write_targets(param_file_name, conf.p_targets)
66 write_gs(param_file_name, zerop, lgs_return_per_watt,
67 conf.p_geom.zenithangle)
68 write_atm(param_file_name, conf.p_atmos, screen_dir,conf.p_geom.zenithangle)
69 write_loop(param_file_name, conf.p_loop, conf.p_controllers[0])
70 common.write_data(fits_file_name, sup, wfss_indices=np.arange(n_wfs),
71 controller_id=controller_id, influ=influ_index, compose_type=imat_type)
def write_parfiles(sup, *param_file_name="./yao.par", fits_file_name="./yao.fits", screen_dir="\"./yao_screen\"", n_wfs=None, controller_id=-1, influ_index=0, imat_type="controller")
Write parameter files for YAO simulations.