def test_sigma_s2(self): """ test LOS projected velocity dispersion at 3d ratios (numerical Jeans equation solution vs analytic one) """ light_profile_list = ['HERNQUIST'] r_eff = 0.5 Rs = 0.551 * r_eff kwargs_light = [{ 'Rs': Rs, 'amp': 1. }] # effective half light radius (2d projected) in arcsec # 0.551 * # mass profile mass_profile_list = ['SPP'] theta_E = 1.2 gamma = 1.95 kwargs_mass = [{ 'theta_E': theta_E, 'gamma': gamma }] # Einstein radius (arcsec) and power-law slope # anisotropy profile anisotropy_type = 'OM' r_ani = 0.5 kwargs_anisotropy = {'r_ani': r_ani} # anisotropy radius [arcsec] kwargs_cosmo = {'d_d': 1000, 'd_s': 1500, 'd_ds': 800} kwargs_numerics = { 'interpol_grid_num': 2000, 'log_integration': True, 'max_integrate': 4000, 'min_integrate': 0.001 } kwargs_model = { 'mass_profile_list': mass_profile_list, 'light_profile_list': light_profile_list, 'anisotropy_model': anisotropy_type } analytic_kin = AnalyticKinematics(kwargs_cosmo, **kwargs_numerics) numeric_kin = NumericKinematics(kwargs_model, kwargs_cosmo, **kwargs_numerics) r_list = np.logspace(-2, 1, 10) for r in r_list: for R in np.linspace(start=0, stop=r, num=5): sigma_s2_analytic, I_R = analytic_kin.sigma_s2( r, R, { 'theta_E': theta_E, 'gamma': gamma }, {'r_eff': r_eff}, kwargs_anisotropy) sigma_s2_full_num = numeric_kin.sigma_s2_r( r, R, kwargs_mass, kwargs_light, kwargs_anisotropy) npt.assert_almost_equal(sigma_s2_full_num / sigma_s2_analytic, 1, decimal=2)
def test_sigma_s2(self): kwargs_aperture = { 'center_ra': 0, 'width': 1, 'length': 1, 'angle': 0, 'center_dec': 0, 'aperture_type': 'slit' } kwargs_cosmo = {'d_d': 1000, 'd_s': 1500, 'd_ds': 800} kwargs_psf = {'psf_type': 'GAUSSIAN', 'fwhm': 1} kin = AnalyticKinematics(kwargs_cosmo) kwargs_light = {'r_eff': 1} sigma_s2 = kin.sigma_s2(r=1, R=0.1, kwargs_mass={ 'theta_E': 1, 'gamma': 2 }, kwargs_light=kwargs_light, kwargs_anisotropy={'r_ani': 1}) assert 'a' in kwargs_light