43 from sutraWrap
import StellarCoronagraph
44 from carmaWrap
import context
45 class StellarCoronagraphCompass(GenericCoronagraph):
46 """ Class supervising stellar coronagraph component
49 _spupil: (np.ndarray[ndim=2, dtype=np.float32]): Telescope pupil mask
51 _pupdiam : (int): Number of pixels along the pupil diameter
53 _dim_image :(int): Coronagraphic image dimension
55 _p_corono: (Param_corono): Coronagraph parameters
57 _target: (TargetCompass): Compass Target used as input for the coronagraph
59 _norm_img : (float): Normalization factor for coronagraphic image
61 _norm_psf : (float): Normalization factor for PSF
63 _coronagraph: (SutraCoronagraph): Sutra coronagraph instance
65 _wav_vec: (np.ndarray[ndim=1, dtype=np.float32]): Vector of wavelength
67 _AA_apod_to_fpm: (np.ndarray[ndim=3, dtype=np.complex64]): MFT matrix for focal plane
69 _BB_apod_to_fpm: (np.ndarray[ndim=2, dtype=np.complex64]): MFT matrix for focal plane
71 _norm0_apod_to_fpm: (np.ndarray[ndim=2, dtype=np.complex64]): MFT matrix for focal plane
73 _AA_fpm_to_lyot: (np.ndarray[ndim=3, dtype=np.complex64]): MFT matrix for lyot plane
75 _BB_fpm_to_lyot: (np.ndarray[ndim=2, dtype=np.complex64]): MFT matrix for lyot plane
77 _norm0_fpm_to_lyot: (np.ndarray[ndim=2, dtype=np.complex64]): MFT matrix for lyot plane
79 _AA_lyot_to_image_c: (np.ndarray[ndim=2, dtype=np.complex64]): MFT matrix for image computation (centered on pixel)
81 _BB_lyot_to_image_c: (np.ndarray[ndim=2, dtype=np.complex64]): MFT matrix for psf computation (centered on pixel)
83 _norm0_lyot_to_image_c: (np.ndarray[ndim=2, dtype=np.complex64]): MFT matrix for psf computation (centered on pixel)
85 _AA_lyot_to_image: (np.ndarray[ndim=2, dtype=np.complex64]): MFT matrix for image computation
87 _BB_lyot_to_image: (np.ndarray[ndim=2, dtype=np.complex64]): MFT matrix for psf computation
89 _norm0_lyot_to_image: (np.ndarray[ndim=2, dtype=np.complex64]): MFT matrix for psf computation
91 _indices_pup: (tuple): Tuple of ndarray containing X and Y indices of illuminated
94 def __init__(self, context: context, targetCompass: TargetCompass, p_corono: conf.Param_corono,
95 p_geom: conf.Param_geom):
96 """ Initialize a stellar coronagraph instance
99 context: (CarmaWrap.context): GPU context
101 targetCompass: (TargetCompass): Compass Target used as input for the coronagraph
103 p_corono: (Param_corono): Coronagraph parameters
105 p_geom: (Param_geom): Compass geometry parameters
108 init_coronagraph(p_corono, p_geom.pupdiam)
109 GenericCoronagraph.__init__(self, p_corono, p_geom, targetCompass)
110 self.
_wav_vec_wav_vec = p_corono._wav_vec
114 planes=
'apod_to_fpm')
117 planes=
'fpm_to_lyot')
120 planes=
'lyot_to_image')
123 planes=
'lyot_to_image',
124 center_on_pixel=
True)
129 self.
_p_corono_p_corono._babinet_trick, 0)
132 self._BB_lyot_to_image,
135 self._BB_lyot_to_image_c,
138 self._BB_apod_to_fpm,
141 self._BB_fpm_to_lyot,
146 fpm = np.rollaxis(np.array(self.
_p_corono_p_corono._focal_plane_mask), 0, 3)
147 if self.
_p_corono_p_corono._babinet_trick:
152 def _compute_normalization(self):
153 """ Compute the normalization factor of coronagraphic images
155 self.
_target_target.reset_tar_phase(0)
def get_psf(self, *str expo_type=scons.ExposureType.LE)
Return the psf.
def compute_psf(self, *bool accumulate=True)
Compute the SE psf, and accumulate it in the LE image.
def get_image(self, *str expo_type=scons.ExposureType.LE)
Return the coronagraphic image.
def __init__(self, context context, TargetCompass targetCompass, conf.Param_corono p_corono, conf.Param_geom p_geom)
def _compute_normalization(self)
Parameter classes for COMPASS.
Numerical constants for shesha and config enumerations for safe-typing.
Initialization of a Coronagraph object.