COMPASS  5.0.0
End-to-end AO simulation tool using GPU acceleration
par_dm.py
1 # -*- coding: utf-8 -*-
2 """
3 Created on Wed Nov 9 14:03:29 2016
4 
5 @author: sdurand
6 """
7 
8 #import min :
9 import shesha as ao
10 import numpy as np
11 
12 simul_name = "dm_init"
13 
14 nact = 17 # number of actuator
15 pupdiam = 500 # size of DM
16 
17 # note available for norms != 0 :
18 alt = 0.
19 
20 
21 def calcul_size_support_dmpzt(nact, pupdiam):
22  """
23  This fonction is available just for alt =0 or/and norms = 0
24  """
25 
26  ssize = int(2**np.ceil(np.log2(pupdiam) + 1))
27  cent = ssize / 2 + 0.5
28  pitch = int(pupdiam / (nact - 1)) #--> for wfs_xpos and ypos = 0
29  extent = pitch * (nact + 5)
30  n1 = np.floor(cent - extent / 2)
31  n2 = np.ceil(cent + extent / 2)
32  taille = n2 - n1 + 1
33 
34  return taille
35 
36 
37 #geometry param :
38 p_geom = ao.Param_geom()
39 
40 p_geom.set_pupdiam(pupdiam) # size of dm in support (pixel)
41 p_geom.set_apod(0) #booleen 1 = actif 0 = inactif
42 
43 #telescope param :
44 
45 p_tel = ao.Param_tel()
46 
47 # These values are mandatory
48 # for alt = 0 or/and norm = 0 this value is not use for compute dm support size
49 
50 # diam is not use for pzt dm if alt=0 or/and norms=0
51 # diam is not use for kl dm
52 p_tel.set_diam(8.0) #--> use for tiptilt and dm_h5 (and dm support size)
53 
54 # Cobs is not use for tiptilt dm
55 # cobs is not use for pzt if have no filter
56 p_tel.set_cobs(0.12) #--> use for kl_miror and PZT filter
57 
58 #dm param:
59 
60 p_dm0 = ao.Param_dm()
61 p_dms = [p_dm0]
62 p_dm0.set_type("pzt")
63 p_dm0.set_nact(nact)
64 p_dm0.set_alt(alt)
65 p_dm0.set_thresh(0.3)
66 p_dm0.set_coupling(0.2)
67 p_dm0.set_unitpervolt(1.)
68 p_dm0.set_push4imat(1.)
69 p_dm0.set_margin_out(0)
par_dm.calcul_size_support_dmpzt
def calcul_size_support_dmpzt(nact, pupdiam)
This fonction is available just for alt =0 or/and norms = 0.
Definition: par_dm.py:24