 |
COMPASS
5.0.0
End-to-end AO simulation tool using GPU acceleration
|
40 from .
import config_setter_utils
as csu
106 """ inter-actuator space in pixels"""
108 """ total number of actuators"""
110 """ influ function support size"""
112 """ position of leftmost pixel in largest support"""
114 """ position of rightmost pixel in largest support"""
117 """ influence functions"""
119 """ x positions of influ functions"""
121 """ y positions of influ functions"""
126 """ Influence functions"""
131 """ Magnifying factor"""
133 """ WFS rotation angle in the pupil"""
135 """ X axis misalignment in meters"""
137 """ Y axis misalignment in meters"""
142 :return: (float) : TODO
149 :param ap: (float) : TODO
151 self.
__ap = csu.enforce_arrayMultiDim(ap, (ap.shape[0], ap.shape[1]),
154 ap = property(get_ap, set_ap)
157 """ Get nfunc TODO !!!
159 :return: (int) : TODO
164 """ Set nfunc TODO !!!
166 :param nfunc: (int) : TODO
168 self.
__nfunc = csu.enforce_int(nfunc)
170 nfunc = property(get_nfunc, set_nfunc)
173 """ Get extent of pzt dm in pich unit default = 5
175 :return: (int) : extent pzt dm
180 """ Set extent of pzt dm in pich unit default = 5
182 :param p: (int) : extent pzt dm
186 pzt_extent = property(get_pzt_extent, set_pzt_extent)
192 """ Define mirror influence functions to be cropped by the spiders
193 (more generally, pupil edges)
195 :param p: (bool) : segment the mirror
199 segmented_mirror = property(get_segmented_mirror, set_segmented_mirror)
202 """ Get the influence function type for pzt DM
204 :return: (str) : centroider type
209 """ Set the influence function type for pzt DM
211 :param t: (str) : centroider type
213 self.
__influ_type = scons.check_enum(scons.InfluType, t)
215 influ_type = property(get_influ_type, set_influ_type)
218 """ Get the influence functions pixels that contributes to each DM pixel
220 :return: (np.ndarray[ndim=1, drype=np.int32]) : influpos
225 """ Set the influence functions pixels that contributes to each DM pixel
227 :param ip: (np.ndarray[ndim=1, drype=np.int32]) : influpos
229 self.
__influpos = csu.enforce_array(ip, ip.size, dtype=np.int32)
231 _influpos = property(get_influpos, set_influpos)
234 """ Get the number of influence functions pixels that contributes
237 :return: (np.ndarray[ndim=1, drype=np.int32]) : ninflu
242 """ Set the number of influence functions pixels that contributes
245 :param n: (np.ndarray[ndim=1, drype=np.int32]) : ninflu
247 self.
__ninflu = csu.enforce_array(n, n.size, dtype=np.int32)
249 _ninflu = property(get_ninflu, set_ninflu)
252 """ Get the index where to start a new DM pixel shape in the array influpos
255 :return: (np.ndarray[ndim=1, drype=np.int32]) : influstart
260 """ Set the index where to start a new DM pixel shape in the array influpos
263 :param n: (np.ndarray[ndim=1, drype=np.int32]) : influstart
265 self.
__influstart = csu.enforce_array(n, n.size, dtype=np.int32)
267 _influstart = property(get_influstart, set_influstart)
270 """ Get the gain to apply to the actuators of the dm
272 :return: (float) : gain
277 """ Set the gain to apply to the actuators of the dm
279 :param g: (float) : gain
281 self.
__gain = csu.enforce_float(g)
283 gain = property(get_gain, set_gain)
285 def _get_dim_screen(self):
286 """ Get the phase screen dimension
288 :return: (long) : phase screen dimension
292 def _set_dim_screen(self, n):
293 """ Set the phase screen dimension
295 :param n: (long) : phase screen dimension
299 _dim_screen = property(_get_dim_screen, _set_dim_screen)
302 """ Get the number of KL modes used for computation of covmat in case of minimum variance controller
304 :return: (long) : number of KL modes
309 """ Set the number of KL modes used for computation of covmat in case of minimum variance controller
311 :param n: (long) : number of KL modes
313 self.
__nkl = csu.enforce_int(n)
315 nkl = property(get_nkl, set_nkl)
318 """ Get the type of KL used for computation
320 :return: (string) : KL types : kolmo or karman
325 """ Set the type of KL used for computation
327 :param t: (string) : KL types : kolmo or karman
329 self.
__type_kl = scons.check_enum(scons.KLType, t)
331 type_kl = property(get_type_kl, set_type_kl)
336 :return: (str) : type of dm
343 :param t: (str) : type of dm
345 self.
__type = scons.check_enum(scons.DmType, t)
347 type = property(get_type, set_type)
350 """ Get the pattern type
352 :return: (str) : type of pattern
357 """ set the pattern type
359 :param t: (str) : type of pattern
363 type_pattern = property(get_type_pattern, set_type_pattern)
366 """ Get the name of hdf5 influence file
368 :return: (str) : Hdf5 file influence name
373 """ set the name of hdf5 influence file
375 :param filename: (str) : Hdf5 file influence name
379 file_influ_hdf5 = property(get_file_influ_hdf5, set_file_influ_hdf5)
382 """ Get the name of hdf5 influence file
384 :return: (str) : Hdf5 file influence name
389 """ set the name of hdf5 influence file
391 :param filename: (str) : Hdf5 file influence name
395 center_name = property(get_center_name, set_center_name)
398 """ Get the name of influence cube in hdf5
400 :return: (str) : name of influence cube
405 """ set the name of influence cube in hdf5
407 :param cubename: (str) : name of influence cube
411 cube_name = property(get_cube_name, set_cube_name)
414 """ Get the name of x coord of influence fonction in file
416 :return: (str) : name of x coord of influence
421 """ set the name of x coord of influence fonction in file
423 :param t: (str) : name of x coord of influence
427 x_name = property(get_x_name, set_x_name)
430 """ Get the name of y coord of influence fonction in file
432 :return: (str) : name of y coord of influence
437 """ set the name of y coord of influence fonction in file
439 :param yname: (str) : name of y coord of influence
443 y_name = property(get_y_name, set_y_name)
446 """ Get the name of influence fonction resolution in file
448 :return: (str) : name of resoltion (meter/pixel) of influence
453 """ set the name of influence fonction resolution in file
455 :param res: (str) : name of resoltion (meter/pixel) of influence
459 influ_res = property(get_influ_res, set_influ_res)
462 """ Get the name of dm diameter in file
464 :return: (str) : name of diameter (meter) dm
469 """ set the name of dm diameter in file
471 :param di: (str) : name of diameter (meter) dm
475 diam_dm = property(get_diam_dm, set_diam_dm)
478 """ Get the name of dm diameter projet on puille in file
480 :return: (str) : name of diameter (meter in pupil plan) dm
485 """ set the name of dm diameter projet on puille in file
487 :param dp: (str) : name of diameter (meter in pupil plan) dm
491 diam_dm_proj = property(get_diam_dm_proj, set_diam_dm_proj)
494 """ Get the number of actuator
496 :return: (long) : number of actuators in the dm
501 """ set the number of actuator
503 :param n: (long) : number of actuators in the dm
505 self.
__nact = csu.enforce_int(n)
507 nact = property(get_nact, set_nact)
510 """ Get the margin for outside actuator select
512 :return: (float) : unit is actuator pitch (+) for extra (-) for intra
517 """ set the margin for outside actuator select
519 :param n: (float) : unit is actuator pitch (+) for extra (-) for intra
523 margin_out = property(get_margin_out, set_margin_out)
526 """ Get the margin for inside actuator select (central obstruction)
528 :return: (float) : unit is actuator pitch (+) for extra (-) for intra
533 """ set the margin for inside actuator select (central obstruction)
535 :param n: (float) : unit is actuator pitch (+) for extra (-) for intra
539 margin_in = property(get_margin_in, set_margin_in)
542 """ Get the conjugaison altitude
544 :return: (float) : conjugaison altitude (im m)
549 """ set the conjugaison altitude
551 :param a: (float) : conjugaison altitude (im m)
553 self.
__alt = csu.enforce_float(a)
555 alt = property(get_alt, set_alt)
558 """ Get the threshold on response for selection
560 :return: (float) : threshold on response for selection (<1)
565 """ set the threshold on response for selection
567 :param t: (float) : threshold on response for selection (<1)
569 self.
__thresh = csu.enforce_float(t)
571 thresh = property(get_thresh, set_thresh)
574 """ Get the actuators coupling
576 :return: (float) : actuators coupling (<0.3)
581 """ set the actuators coupling
583 :param c: (float) : actuators coupling (<0.3)
587 coupling = property(get_coupling, set_coupling)
590 """ Get the Influence function sensitivity
592 :return: (float) : Influence function sensitivity in unit/volt
597 """ set the Influence function sensitivity
599 :param u: (float) : Influence function sensitivity in unit/volt
603 unitpervolt = property(get_unitpervolt, set_unitpervolt)
606 """ Get the nominal voltage for imat
608 :return: (float) : nominal voltage for imat
613 """ set the nominal voltage for imat
615 :param p: (float) : nominal voltage for imat
619 push4imat = property(get_push4imat, set_push4imat)
622 """ Get the total number of actuators
624 :return: (long) : total number of actuators
629 """ set the total number of actuators
631 :param n: (long) : total number of actuators
635 _ntotact = property(get_ntotact, set_ntotact)
638 """ Get the actuators pitch [pixels]
640 :return: (float) : actuators pitch [pixels]
645 """ set the actuators pitch [pixels]
647 :param p: (float) : actuators pitch [pixels]
649 self.
__pitch = csu.enforce_float(p)
651 _pitch = property(get_pitch, set_pitch)
654 """ Get the actuators influsize [pixels]
656 :return: (int) : actuators influsize [pixels]
661 """ set the actuators influsize [pixels]
663 :param s: (int) : actuators influsize [pixels]
667 _influsize = property(get_influsize, set_influsize)
670 """ Get the position of bottom left pixel in the largest support
672 :return: (int) : actuators n1 [pixels]
677 """ set the position of bottom left pixel in the largest support
679 :param n: (int) : actuators n1 [pixels]
681 self.
__n1 = csu.enforce_int(n)
683 _n1 = property(get_n1, set_n1)
686 """ Get the position of bottom right pixel in the largest support
688 :return: (int) : actuators n2 [pixels]
693 """ set the position of bottom right pixel in the largest support
695 :param n: (int) : actuators n2 [pixels]
697 self.
__n2 = csu.enforce_int(n)
699 _n2 = property(get_n2, set_n2)
702 """ Get the x positions of influ functions (lower left corner)
704 :return: (np.ndarray[ndim=1,dtype=np.float32_t]) : x positions of influ functions
709 """ Set the x positions of influ functions (lower left corner)
711 :param xpos: (np.ndarray[ndim=1,dtype=np.float32_t]) : x positions of influ functions
713 self.
__xpos = csu.enforce_array(xpos, self.
__ntotact, dtype=np.float32)
715 _xpos = property(get_xpos, set_xpos)
718 """ Get the y positions of influ functions (lower left corner)
720 :return: (np.ndarray[ndim=1,dtype=np.float32_t]) : y positions of influ functions
725 """ Set the y positions of influ functions (lower left corner)
727 :param ypos: (np.ndarray[ndim=1,dtype=np.float32_t]) : y positions of influ functions
729 self.
__ypos = csu.enforce_array(ypos, self.
__ntotact, dtype=np.float32)
731 _ypos = property(get_ypos, set_ypos)
734 """ Get the X-position of the bottom left corner of each influence function
736 :return: (np.ndarray[ndim=1,dtype=np.int32_t]) :
741 """ Set the X-position of the bottom left corner of each influence function
743 :param i1: (np.ndarray[ndim=1,dtype=np.int32_t]) :
745 self.
__i1 = csu.enforce_array(i1, self.
__ntotact, dtype=np.int32)
747 _i1 = property(get_i1, set_i1)
750 """ Get the Y-position of the bottom left corner of each influence function
752 :return: (np.ndarray[ndim=1,dtype=np.int32_t]) :
757 """ Set the Y-position of the bottom left corner of each influence function
759 :param j1: (np.ndarray[ndim=1,dtype=np.int32_t]) :
761 self.
__j1 = csu.enforce_array(j1, self.
__ntotact, dtype=np.int32)
763 _j1 = property(get_j1, set_j1)
766 """ Get the influence function
768 :return: (np.ndarray[ndim=3,dtype=np.float32_t]) : influence function
773 """ Set the influence function
775 :param influ: (np.ndarray[ndim=3,dtype=np.float32_t]) : influence function
777 self.
__influ = csu.enforce_arrayMultiDim(influ,
781 _influ = property(get_influ, set_influ)
784 """ Get the pupil offset in meters
786 :return: (np.ndarray[ndim=1,dtype=np.float32_t]) : offsets [m]
791 """ Set the pupil offset in meters
793 :param off: (np.ndarray[ndim=1,dtype=np.float32_t]) : offsets [m]
795 self.
__pupoffset = csu.enforce_array(off, 2, dtype=np.float32)
797 pupoffset = property(get_pupoffset, set_pupoffset)
800 """ Get the pupil offset in pixels
802 :return: (np.ndarray[ndim=1,dtype=np.float32_t]) : offsets [pixels]
807 """ Set the pupil offset in pixels
809 :param off: (np.ndarray[ndim=1,dtype=np.float32_t]) : offsets [pixels]
813 _puppixoffset = property(get_puppixoffset, set_puppixoffset)
816 """ Get the outer scale for KL with Von Karman spectrum
818 :return: (float) : outer scale [m]
823 """ Set the outer scale for KL with Von Karman spectrum
825 :param L0: (float) : outer scale [m]
827 self.
__outscl = csu.enforce_float(L0)
829 outscl = property(get_outscl, set_outscl)
832 """ Get the number of radial points for KL
834 :return: (int) : number of radial points
839 """ Set the number of radial points for KL
841 :param n: (int) : number of radial points
845 _nr = property(get_nr, set_nr)
848 """ Get the number of elements (?) for KL
850 :return: (int) : number of elements
855 """ Set the number of elements (?) for KL
857 :param n: (int) : number of elements
859 self.
__npp = csu.enforce_int(n)
861 _npp = property(get_npp, set_npp)
864 """ Get the dimension of grid (?)
866 :return: (int) : dimension
871 """ Set the dimension of grid (?)
873 :param n: (int) : dimension
877 _ncp = property(get_ncp, set_ncp)
880 """ Get the radial orders of the basis
882 :return: (int) : radial order of the basis
887 """ Set the radial orders of the basis
889 :param n: (int) : radial order of the basis
891 self.
__ord = csu.enforce_array(n, n.size, dtype=np.int32)
893 _ord = property(get_ord, set_ord)
896 """ Get the radial array of the KL basis
898 :return: (np.ndarray[ndim=1,dtype=np.float32_t]) : radial array
903 """ Set the radial array of the KL basis
905 :param r: (np.ndarray[ndim=1,dtype=np.float32_t]) : radial array
907 self.
__rabas = csu.enforce_arrayMultiDim(r, r.shape, dtype=np.float32)
909 _rabas = property(get_rabas, set_rabas)
912 """ Get the azimuthal array of the KL basis
914 :return: (np.ndarray[ndim=1,dtype=np.float32_t]) : azimuthal array
919 """ Set the azimuthal array of the KL basis
921 :param r: (np.ndarray[ndim=1,dtype=np.float32_t]) : azimuthal array
923 self.
__azbas = csu.enforce_arrayMultiDim(r, r.shape, dtype=np.float32)
925 _azbas = property(get_azbas, set_azbas)
928 """ Get the radial coordinates in carthesian grid
930 :return: (np.ndarray[ndim=1,dtype=np.float32_t]) : radial coordinates in carthesian grid
935 """ Set the radial coordinates in carthesian grid
937 :param r: (np.ndarray[ndim=1,dtype=np.float32_t]) : radial coordinates in carthesian grid
939 self.
__cr = csu.enforce_arrayMultiDim(r, r.shape, dtype=np.float32)
941 _cr = property(get_cr, set_cr)
944 """ Get the phi coordinates in carthesian grid
946 :return: (np.ndarray[ndim=1,dtype=np.float32_t]) : phi coordinates in carthesian grid
951 """ Set the phi coordinates in carthesian grid
953 :param r: (np.ndarray[ndim=1,dtype=np.float32_t]) : phi coordinates in carthesian grid
955 self.
__cp = csu.enforce_arrayMultiDim(r, r.shape, dtype=np.float32)
957 _cp = property(get_cp, set_cp)
960 """ Get the magnifying factor
962 :return: (float) : magnifying factor
967 """ Set the magnifying factor
969 :param G: (float) : magnifying factor
971 self.
__G = csu.enforce_float(G)
973 G = property(get_G, set_G)
976 """ Get the rotation angle in the pupil
978 :return: (float) : rotation angle (rad)
983 """ Set the rotation angle in the pupil
985 :param theta: (float) : rotation angle (rad)
987 self.
__theta = csu.enforce_float(theta)
989 theta = property(get_theta, set_theta)
992 """ Get the X axis misalignment
994 :return: (float) : dx (pix)
999 """ Set the X axis misalignment
1001 :param dx: (float) : dx (pix)
1003 self.
__dx = csu.enforce_float(dx)
1005 dx = property(get_dx, set_dx)
1008 """ Get the Y axis misalignment
1010 :return: (float) : dy (pix)
1015 """ Set the Y axis misalignment
1017 :param dy: (float) : dy (pix)
1019 self.
__dy = csu.enforce_float(dy)
1021 dy = property(get_dy, set_dy)
def set_influ_res(self, res)
set the name of influence fonction resolution in file
def set_file_influ_hdf5(self, f)
set the name of hdf5 influence file
def get_center_name(self)
Get the name of hdf5 influence file.
def set_outscl(self, L0)
Set the outer scale for KL with Von Karman spectrum.
def get_ord(self)
Get the radial orders of the basis.
def set_influ_type(self, t)
Set the influence function type for pzt DM.
def get_gain(self)
Get the gain to apply to the actuators of the dm.
def get_cube_name(self)
Get the name of influence cube in hdf5.
def set_cp(self, r)
Set the phi coordinates in carthesian grid.
def get_npp(self)
Get the number of elements (?) for KL.
def set_ntotact(self, n)
set the total number of actuators
def get_ntotact(self)
Get the total number of actuators.
def set_type_kl(self, t)
Set the type of KL used for computation.
def get_alt(self)
Get the conjugaison altitude.
def set_rabas(self, r)
Set the radial array of the KL basis.
def get_rabas(self)
Get the radial array of the KL basis.
def get_y_name(self)
Get the name of y coord of influence fonction in file.
def get_i1(self)
Get the X-position of the bottom left corner of each influence function.
def get_outscl(self)
Get the outer scale for KL with Von Karman spectrum.
def get_influ(self)
Get the influence function.
def set_ord(self, n)
Set the radial orders of the basis.
def set_n2(self, n)
set the position of bottom right pixel in the largest support
def get_influ_type(self)
Get the influence function type for pzt DM.
def get_influsize(self)
Get the actuators influsize [pixels].
def set_ypos(self, ypos)
Set the y positions of influ functions (lower left corner)
def get_type(self)
Get the dm type.
def set_gain(self, g)
Set the gain to apply to the actuators of the dm.
def set_ap(self, ap)
Set ap TODO!!!
def set_nact(self, n)
set the number of actuator
def set_pitch(self, p)
set the actuators pitch [pixels]
def get_ninflu(self)
Get the number of influence functions pixels that contributes to each DM pixel.
Numerical constants for shesha and config enumerations for safe-typing.
def get_n1(self)
Get the position of bottom left pixel in the largest support.
def get_ap(self)
Get ap TODO!!!
def get_pitch(self)
Get the actuators pitch [pixels].
def get_nkl(self)
Get the number of KL modes used for computation of covmat in case of minimum variance controller.
def set_type(self, t)
set the dm type
def set_cr(self, r)
Set the radial coordinates in carthesian grid.
def get_margin_out(self)
Get the margin for outside actuator select.
def get_segmented_mirror(self)
def get_azbas(self)
Get the azimuthal array of the KL basis.
def get_puppixoffset(self)
Get the pupil offset in pixels.
def set_xpos(self, xpos)
Set the x positions of influ functions (lower left corner)
def set_center_name(self, f)
set the name of hdf5 influence file
def set_ninflu(self, n)
Set the number of influence functions pixels that contributes to each DM pixel.
P-Class (parametres) Param_dm.
def get_nact(self)
Get the number of actuator.
def set_n1(self, n)
set the position of bottom left pixel in the largest support
def set_dy(self, dy)
Set the Y axis misalignment.
def set_segmented_mirror(self, b)
Define mirror influence functions to be cropped by the spiders (more generally, pupil edges)
def get_theta(self)
Get the rotation angle in the pupil.
def get_G(self)
Get the magnifying factor.
def get_push4imat(self)
Get the nominal voltage for imat.
def set_dx(self, dx)
Set the X axis misalignment.
def set_G(self, G)
Set the magnifying factor.
def set_theta(self, theta)
Set the rotation angle in the pupil.
def get_ypos(self)
Get the y positions of influ functions (lower left corner)
def get_type_pattern(self)
Get the pattern type.
def get_margin_in(self)
Get the margin for inside actuator select (central obstruction)
def set_npp(self, n)
Set the number of elements (?) for KL.
def set_influ(self, influ)
Set the influence function.
def set_coupling(self, c)
set the actuators coupling
def get_influ_res(self)
Get the name of influence fonction resolution in file.
def set_nr(self, n)
Set the number of radial points for KL.
def set_y_name(self, yname)
set the name of y coord of influence fonction in file
def get_pupoffset(self)
Get the pupil offset in meters.
def get_diam_dm(self)
Get the name of dm diameter in file.
def get_influstart(self)
Get the index where to start a new DM pixel shape in the array influpos to each DM pixel.
def set_thresh(self, t)
set the threshold on response for selection
def set_j1(self, j1)
Set the Y-position of the bottom left corner of each influence function.
def get_unitpervolt(self)
Get the Influence function sensitivity.
def set_margin_out(self, n)
set the margin for outside actuator select
def set_diam_dm_proj(self, dp)
set the name of dm diameter projet on puille in file
def set_ncp(self, n)
Set the dimension of grid (?)
def get_xpos(self)
Get the x positions of influ functions (lower left corner)
def get_diam_dm_proj(self)
Get the name of dm diameter projet on puille in file.
def set_push4imat(self, p)
set the nominal voltage for imat
def get_dx(self)
Get the X axis misalignment.
def get_j1(self)
Get the Y-position of the bottom left corner of each influence function.
def set_influstart(self, n)
Set the index where to start a new DM pixel shape in the array influpos to each DM pixel.
def set_type_pattern(self, t)
set the pattern type
def set_puppixoffset(self, off)
Set the pupil offset in pixels.
def get_n2(self)
Get the position of bottom right pixel in the largest support.
def get_cr(self)
Get the radial coordinates in carthesian grid.
def set_margin_in(self, n)
set the margin for inside actuator select (central obstruction)
def set_alt(self, a)
set the conjugaison altitude
def set_pupoffset(self, off)
Set the pupil offset in meters.
def set_unitpervolt(self, u)
set the Influence function sensitivity
def set_i1(self, i1)
Set the X-position of the bottom left corner of each influence function.
def get_x_name(self)
Get the name of x coord of influence fonction in file.
def get_type_kl(self)
Get the type of KL used for computation.
def set_nkl(self, n)
Set the number of KL modes used for computation of covmat in case of minimum variance controller.
def set_azbas(self, r)
Set the azimuthal array of the KL basis.
def set_x_name(self, xname)
set the name of x coord of influence fonction in file
def set_nfunc(self, nfunc)
Set nfunc TODO !!!
def get_ncp(self)
Get the dimension of grid (?)
def get_nr(self)
Get the number of radial points for KL.
def get_influpos(self)
Get the influence functions pixels that contributes to each DM pixel.
def get_coupling(self)
Get the actuators coupling.
def set_cube_name(self, cubename)
set the name of influence cube in hdf5
def get_nfunc(self)
Get nfunc TODO !!!
def get_dy(self)
Get the Y axis misalignment.
def set_diam_dm(self, di)
set the name of dm diameter in file
def set_influpos(self, ip)
Set the influence functions pixels that contributes to each DM pixel.
def set_pzt_extent(self, p)
Set extent of pzt dm in pich unit default = 5.
def get_pzt_extent(self)
Get extent of pzt dm in pich unit default = 5.
def get_thresh(self)
Get the threshold on response for selection.
def get_cp(self)
Get the phi coordinates in carthesian grid.
def get_file_influ_hdf5(self)
Get the name of hdf5 influence file.
def set_influsize(self, s)
set the actuators influsize [pixels]