COMPASS  5.4.4
End-to-end AO simulation tool using GPU acceleration
shesha.util.tao.writer Namespace Reference

Functions

def used_actu (xpos, ypos, *Np=-1)
 return the indices of the used actuators More...
 
def get_idx (p_dm, *xpos=None, ypos=None)
 return a correspondance between the covariance matrix indices and the covariance map indices More...
 
def get_abs2fi (sup, *dm=0)
 
def OTF_telescope (sup)
 otf = OTF_telescope(fourier) More...
 
def get_subaps (sup, *wfs="all")
 Return the number of valid subaps (per wfs) as well as their position. More...
 
def autocorrelation (a)
 computes the autocorrelation so that More...
 
def func_influ (x, y, x0)
 
def generate_files (sup, *path=".", single_file=False, dm_use_tt=False, wfs="all", lgs_filter_cst=0.1, tar=-1)
 write inputs parameters More...
 
def to_str (a="")
 transform a np.array into a string More...
 
def write_sys_param (sup, path=".", wfs="all", lgs_filter_cst=0.1, tar=-1)
 Write a sysParam file for tao based on the compass configuration. More...
 
def write_atm_param (sup, *path=".")
 Write a atmParam file for tao based on the compass configuration. More...
 
def write_meta_Dx (meta_Dx, *nTS=0, nmeas=None, trans=True, path=".")
 Write command matrices. More...
 

Function Documentation

◆ autocorrelation()

def shesha.util.tao.writer.autocorrelation (   a)

computes the autocorrelation so that

max(aa) == sum(a^2)
Parameters
a(np.ndarray[ndim=2, dtype=np.float32]): matrix to compute the autocorrelation on

Definition at line 166 of file writer.py.

Here is the caller graph for this function:

◆ func_influ()

def shesha.util.tao.writer.func_influ (   x,
  y,
  x0 
)

Definition at line 181 of file writer.py.

◆ generate_files()

def shesha.util.tao.writer.generate_files (   sup,
path = ".",
  single_file = False,
  dm_use_tt = False,
  wfs = "all",
  lgs_filter_cst = 0.1,
  tar = -1 
)

write inputs parameters

sys contains the system parameters idx.fits : otftel.fits : abs2fi.fits : subaps number and position of the subapertures

Parameters
sup(CompassSupervisor) : current supervisor
path(str): (optional), default './' path where the files are written
single_file(bool): (optional), default=False write a single fits File
wfs(str) : (optional), default "all" wfs used by tao ( among "all", "lgs", "ngs")
lgs_filter_cst(float) : (optional) add constant to filter out lgs tt
tar(list) : (optional), default -1 index of the target

Definition at line 220 of file writer.py.

Here is the call graph for this function:

◆ get_abs2fi()

def shesha.util.tao.writer.get_abs2fi (   sup,
dm = 0 
)

Definition at line 76 of file writer.py.

Here is the caller graph for this function:

◆ get_idx()

def shesha.util.tao.writer.get_idx (   p_dm,
xpos = None,
  ypos = None 
)

return a correspondance between the covariance matrix indices and the covariance map indices

Parameters
p_dm(Param_dm): dm settings
xpos(np.ndarray[ndim=1, dtype=np.int32]): (optional) actuator position in x
ypos(np.ndarray[ndim=1, dtype=np.int32]): (optional) actuator position in y
Returns
index_map (np.ndarray[ndim=1, dtype=np.int32]) : correspondance between the covariance matrix indices and the covariance map indices

Definition at line 53 of file writer.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_subaps()

def shesha.util.tao.writer.get_subaps (   sup,
wfs = "all" 
)

Return the number of valid subaps (per wfs) as well as their position.

Parameters
sup(CompassSupervisor) : current supervisor
wfs(str) : (optional), default "all" wfs used by tao ( among "all", "lgs", "ngs")

Definition at line 133 of file writer.py.

Here is the caller graph for this function:

◆ OTF_telescope()

def shesha.util.tao.writer.OTF_telescope (   sup)

otf = OTF_telescope(fourier)

Computes the OTF of the telescope, so that

fft(OTF_telescope()).re

produces a PSF normalized with max(psf)=SR=1.0

Definition at line 96 of file writer.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ to_str()

def shesha.util.tao.writer.to_str (   a = "")

transform a np.array into a string

Parameters
a(np.ndarray[ndim=1, dtype=np.int32]) : input array

Definition at line 278 of file writer.py.

Here is the caller graph for this function:

◆ used_actu()

def shesha.util.tao.writer.used_actu (   xpos,
  ypos,
Np = -1 
)

return the indices of the used actuators

Parameters
xpos(np.ndarray[ndim=1, dtype=np.int32]): (optional) actuator position in x
ypos(np.ndarray[ndim=1, dtype=np.int32]): (optional) actuator position in y
Np(int): (optional) number of actuators along the diameter

Definition at line 23 of file writer.py.

Here is the caller graph for this function:

◆ write_atm_param()

def shesha.util.tao.writer.write_atm_param (   sup,
path = "." 
)

Write a atmParam file for tao based on the compass configuration.

Parameters
sup(CompassSupervisor) : current supervisor
path(str) : (optional), default "./" path to the atmParam file

Definition at line 459 of file writer.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_meta_Dx()

def shesha.util.tao.writer.write_meta_Dx (   meta_Dx,
nTS = 0,
  nmeas = None,
  trans = True,
  path = "." 
)

Write command matrices.

split the meta command matrix

Parameters
meta_Dx(np.ndarray[ndim=2, dtype=np.float32]): "meta" command matrix
nTS(int): (optional), default=0. Number of truth sensors, command matrices are written as Di.fits where 'i' belongs to [0,nTS[ , if nTS<1 write the whole matrix as Dx.fits
nmeas(np.ndarray[ndim=1, dtype=np.int32]): (optional) if set, must contains the number of measurements for each TS, the matrix is split according to theses numbers. By default, the matrix is split evenly between the nTS truth sensors
trans(bool): (optional), default=True. Transpose the matrix if true
path(str): (optional), default './' path where the files are written

Definition at line 495 of file writer.py.

◆ write_sys_param()

def shesha.util.tao.writer.write_sys_param (   sup,
  path = ".",
  wfs = "all",
  lgs_filter_cst = 0.1,
  tar = -1 
)

Write a sysParam file for tao based on the compass configuration.

Parameters
sup(CompassSupervisor) : current supervisor
path(str) : (optional), "./" path to the sysParam file
wfs(str) : (optional), default "all" wfs used by tao ( among "all", "lgs", "ngs")
lgs_filter_cst(float) : (optional) add constant to filter out lgs tt
tar(list) : (optional), default -1 index of the target

Definition at line 305 of file writer.py.

Here is the call graph for this function:
Here is the caller graph for this function: