COMPASS  5.0.0
End-to-end AO simulation tool using GPU acceleration
test_sh.py
1 import shesha.config as conf
2 
3 simul_name = "bench_scao_sh_16x16_8pix"
4 
5 # loop
6 p_loop = conf.Param_loop()
7 
8 p_loop.set_niter(1000)
9 p_loop.set_ittime(0.002) # =1/500
10 
11 # geom
12 p_geom = conf.Param_geom()
13 
14 p_geom.set_zenithangle(0.)
15 
16 # tel
17 p_tel = conf.Param_tel()
18 
19 p_tel.set_diam(8.0)
20 p_tel.set_cobs(0.12)
21 # p_tel.set_t_spiders(0.1)
22 # p_tel.set_type_ap("keck")
23 # p_tel.set_referr(0.1)
24 # p_tel.set_gap(0.1)
25 # p_tel.set_std_piston(0.05)
26 # p_tel.set_std_tt(0.1)
27 
28 
29 # atmos
30 p_atmos = conf.Param_atmos()
31 
32 p_atmos.set_r0(0.16)
33 p_atmos.set_nscreens(1)
34 p_atmos.set_frac([1.0])
35 p_atmos.set_alt([0.0])
36 p_atmos.set_windspeed([20.0])
37 p_atmos.set_winddir([45.])
38 p_atmos.set_L0([1.e5])
39 
40 # target
41 p_target = conf.Param_target()
42 p_targets = [p_target]
43 
44 # p_target.set_ntargets(1)
45 p_target.set_xpos(0.)
46 p_target.set_ypos(0.)
47 p_target.set_Lambda(1.65)
48 p_target.set_mag(10.)
49 
50 # wfs
51 p_wfs0 = conf.Param_wfs()
52 p_wfss = [p_wfs0]
53 
54 p_wfs0.set_type("sh")
55 p_wfs0.set_nxsub(16)
56 p_wfs0.set_npix(8)
57 p_wfs0.set_pixsize(0.3)
58 p_wfs0.set_fracsub(0.8)
59 p_wfs0.set_xpos(0.)
60 p_wfs0.set_ypos(0.)
61 p_wfs0.set_Lambda(0.5)
62 p_wfs0.set_gsmag(3.)
63 p_wfs0.set_optthroughput(0.5)
64 p_wfs0.set_zerop(1.e11)
65 p_wfs0.set_noise(-1.)
66 p_wfs0.set_atmos_seen(1)
67 
68 # lgs parameters
69 # p_wfs0.set_gsalt(90*1.e3)
70 # p_wfs0.set_lltx(0)
71 # p_wfs0.set_llty(0)
72 # p_wfs0.set_laserpower(10)
73 # p_wfs0.set_lgsreturnperwatt(1.e3)
74 # p_wfs0.set_proftype("Exp")
75 # p_wfs0.set_beamsize(0.8)
76 
77 # dm
78 p_dm0 = conf.Param_dm()
79 p_dm1 = conf.Param_dm()
80 p_dms = [p_dm0, p_dm1]
81 p_dm0.set_type("pzt")
82 nact = p_wfs0.nxsub + 1
83 p_dm0.set_nact(nact)
84 p_dm0.set_alt(0.)
85 p_dm0.set_thresh(0.3)
86 p_dm0.set_coupling(0.2)
87 p_dm0.set_unitpervolt(0.01)
88 p_dm0.set_push4imat(100.)
89 
90 p_dm1.set_type("tt")
91 p_dm1.set_alt(0.)
92 p_dm1.set_unitpervolt(0.0005)
93 p_dm1.set_push4imat(10.)
94 
95 # centroiders
96 p_centroider0 = conf.Param_centroider()
97 p_centroiders = [p_centroider0]
98 
99 p_centroider0.set_nwfs(0)
100 p_centroider0.set_type("cog")
101 # p_centroider0.set_type("corr")
102 # p_centroider0.set_type_fct("model")
103 
104 # controllers
105 p_controller0 = conf.Param_controller()
106 p_controllers = [p_controller0]
107 
108 p_controller0.set_type("ls")
109 p_controller0.set_nwfs([0])
110 p_controller0.set_ndm([0, 1])
111 p_controller0.set_maxcond(1500.)
112 p_controller0.set_delay(3.)
113 p_controller0.set_gain(0.4)
114 
115 p_controller0.set_modopti(0)
116 p_controller0.set_nrec(2048)
117 p_controller0.set_nmodes(216)
118 p_controller0.set_gmin(0.001)
119 p_controller0.set_gmax(0.5)
120 p_controller0.set_ngain(500)
shesha.config
Parameter classes for COMPASS.
Definition: shesha/shesha/config/__init__.py:1