def draw_one_sigma2(self, kwargs_mass, kwargs_light, kwargs_anisotropy, kwargs_aperture, r_eff=1.): """ :param kwargs_mass: :param kwargs_light: :param kwargs_anisotropy: :param kwargs_aperture: :return: """ while True: R = self.lightProfile.draw_light_2d(kwargs_light, r_eff=r_eff) # draw r x, y = util.draw_xy(R) # draw projected R x_, y_ = util.displace_PSF(x, y, self.FWHM) # displace via PSF bool = self.aperture.aperture_select(x_, y_, kwargs_aperture) if bool is True: break sigma2_R = self.sigma2_R(R, kwargs_mass, kwargs_light, kwargs_anisotropy) return sigma2_R
def draw_light(self, kwargs_light): """ :param kwargs_light: keyword argument (list) of the light model :return: 3d radius (if possible), 2d projected radius, x-projected coordinate, y-projected coordinate """ R = self.lightProfile.draw_light_2d(kwargs_light, n=1)[0] x, y = util.draw_xy(R) r = None return r, R, x, y
def _draw_one_sigma2(self, kwargs_mass, kwargs_light, kwargs_anisotropy): """ :param kwargs_mass: mass model parameters (following lenstronomy lens model conventions) :param kwargs_light: deflector light parameters (following lenstronomy light model conventions) :param kwargs_anisotropy: anisotropy parameters, may vary according to anisotropy type chosen. We refer to the Anisotropy() class for details on the parameters. :return: integrated LOS velocity dispersion in angular units for a single draw of the light distribution that falls in the aperture after displacing with the seeing """ while True: R = self.lightProfile.draw_light_2d(kwargs_light, n=1)[0] # draw r in arcsec x, y = util.draw_xy(R) # draw projected R in arcsec x_, y_ = self._psf.displace_psf(x, y) bool = self.aperture.aperture_select(x_, y_) if bool is True: break sigma2_R = self._sigma2_R(R, kwargs_mass, kwargs_light, kwargs_anisotropy) return sigma2_R