COMPASS  5.4.4
End-to-end AO simulation tool using GPU acceleration
PTARGET.py
1 
37 
38 import numpy as np
39 from . import config_setter_utils as csu
40 
41 
44 
45 
47 
48  def __init__(self):
49  self.__apod__apod = False
50  """ boolean for apodizer"""
51  self.__Lambda__Lambda = None
52  """ observation wavelength for each target"""
53  self.__xpos__xpos = None
54  """ x positions on sky (in arcsec) for each target"""
55  self.__ypos__ypos = None
56  """ y positions on sky (in arcsec) for each target"""
57  self.__mag__mag = None
58  """ magnitude for each target"""
59  self.__zerop__zerop = 1.
60  """ target flux for magnitude 0"""
61  self.__dms_seen__dms_seen = None
62  """ index of dms seen by the target"""
63 
64  def get_apod(self):
65  """ Get apodizer flag
66 
67  :return: (bool) : apod
68  """
69  return self.__apod__apod
70 
71  def set_apod(self, l):
72  """ Set apodizer flag
73 
74  :param l: (bool) : apod
75  """
76  self.__apod__apod = csu.enforce_or_cast_bool(l)
77 
78  apod = property(get_apod, set_apod)
79 
80  def get_Lambda(self):
81  """ Get the wavelength of targets
82 
83  :return: (np.ndarray[ndim=2, dtype=np.float32]) : wavelength of targets
84  """
85  return self.__Lambda__Lambda
86 
87  def set_Lambda(self, n):
88  """ Set the wavelength of targets
89 
90  :param n: (np.ndarray[ndim=2, dtype=np.float32]) : wavelength of targets
91  """
92  self.__Lambda__Lambda = csu.enforce_float(n)
93 
94  Lambda = property(get_Lambda, set_Lambda)
95 
96  def get_xpos(self):
97  """ Get the X-position of targets in the field [arcsec]
98 
99  :return: (np.ndarray[ndim=2, dtype=np.float32]) : X position of targets [arcsec]
100  """
101  return self.__xpos__xpos
102 
103  def set_xpos(self, n):
104  """ Set the X-position of targets in the field [arcsec]
105 
106  :param n: (np.ndarray[ndim=2, dtype=np.float32]) : X position of targets [arcsec]
107  """
108  self.__xpos__xpos = csu.enforce_float(n)
109 
110  xpos = property(get_xpos, set_xpos)
111 
112  def get_ypos(self):
113  """ Get the Y-position of targets in the field [arcsec]
114 
115  :return: (np.ndarray[ndim=2, dtype=np.float32]): Y position of targets [arcsec]
116  """
117  return self.__ypos__ypos
118 
119  def set_ypos(self, n):
120  """ Set the Y-position of targets in the field [arcsec]
121 
122  :param n: (np.ndarray[ndim=2, dtype=np.float32]): Y position of targets [arcsec]
123  """
124  self.__ypos__ypos = csu.enforce_float(n)
125 
126  ypos = property(get_ypos, set_ypos)
127 
128  def get_mag(self):
129  """ Get the magnitudes of targets
130 
131  :return: (np.ndarray[ndim=2, dtype=np.float32]) : magnitudes
132  """
133  return self.__mag__mag
134 
135  def set_mag(self, n):
136  """ Set the magnitudes of targets
137 
138  :param n: (np.ndarray[ndim=2, dtype=np.float32]) : magnitudes
139  """
140  self.__mag__mag = csu.enforce_float(n)
141 
142  mag = property(get_mag, set_mag)
143 
144  def get_zerop(self):
145  """ Get the zero point of targets
146 
147  :return: (float) : zero point of targets
148  """
149  return self.__zerop__zerop
150 
151  def set_zerop(self, n):
152  """ Set the zero point of targets
153 
154  :param n: (float) : zero point of targets
155  """
156  self.__zerop__zerop = csu.enforce_float(n)
157 
158  zerop = property(get_zerop, set_zerop)
159 
160  def get_dms_seen(self):
161  """ Get the dms_seen by the targets
162 
163  :return: (np.ndarray[ndim=2, dtype=np.int32]) : index of dms seen
164  """
165  return self.__dms_seen__dms_seen
166 
167  def set_dms_seen(self, n):
168  """ Set the dms_seen by the targets
169 
170  :param n: (np.ndarray[ndim=2, dtype=np.int32]) : index of dms seen
171  """
172  if (isinstance(n, list)):
173  n = np.array(n)
174  self.__dms_seen__dms_seen = csu.enforce_array(n, size=n.size, dtype=np.int32,
175  scalar_expand=True)
176 
177  dms_seen = property(get_dms_seen, set_dms_seen)
P-Class (parametres) Param_target.
Definition: PTARGET.py:46
def set_dms_seen(self, n)
Set the dms_seen by the targets.
Definition: PTARGET.py:171
def set_ypos(self, n)
Set the Y-position of targets in the field [arcsec].
Definition: PTARGET.py:123
def set_zerop(self, n)
Set the zero point of targets.
Definition: PTARGET.py:155
def set_apod(self, l)
Set apodizer flag.
Definition: PTARGET.py:75
def get_dms_seen(self)
Get the dms_seen by the targets.
Definition: PTARGET.py:164
def set_Lambda(self, n)
Set the wavelength of targets.
Definition: PTARGET.py:91
def get_zerop(self)
Get the zero point of targets.
Definition: PTARGET.py:148
def get_apod(self)
Get apodizer flag.
Definition: PTARGET.py:68
def get_Lambda(self)
Get the wavelength of targets.
Definition: PTARGET.py:84
def get_ypos(self)
Get the Y-position of targets in the field [arcsec].
Definition: PTARGET.py:116
def set_xpos(self, n)
Set the X-position of targets in the field [arcsec].
Definition: PTARGET.py:107
def get_xpos(self)
Get the X-position of targets in the field [arcsec].
Definition: PTARGET.py:100
def set_mag(self, n)
Set the magnitudes of targets.
Definition: PTARGET.py:139
def get_mag(self)
Get the magnitudes of targets.
Definition: PTARGET.py:132