def test_time_delays(self): z_lens = 0.5 z_source = 1.5 kwargs_options = { 'lens_model_list': ['SPEP'], 'point_source_model_list': ['LENSED_POSITION'] } e1, e2 = param_util.phi_q2_ellipticity(0, 0.7) kwargs_lens = [{'theta_E': 1, 'gamma': 2, 'e1': e1, 'e2': e2}] kwargs_else = [{'ra_image': [-1, 0, 1], 'dec_image': [0, 0, 0]}] from astropy.cosmology import FlatLambdaCDM cosmo = FlatLambdaCDM(H0=70, Om0=0.3, Ob0=0.05) lensProp = LensProp(z_lens, z_source, kwargs_options, cosmo=cosmo) delays = lensProp.time_delays(kwargs_lens, kwargs_ps=kwargs_else, kappa_ext=0) npt.assert_almost_equal(delays[0], -31.387590264501007, decimal=8) npt.assert_almost_equal(delays[1], 0, decimal=8) npt.assert_almost_equal(delays[2], -31.387590264501007, decimal=8) kappa_ext = 0.1 delays_kappa = lensProp.time_delays(kwargs_lens, kwargs_ps=kwargs_else, kappa_ext=kappa_ext) npt.assert_almost_equal(delays_kappa / (1. - kappa_ext), delays, decimal=8)
def test_time_delays(self): z_lens = 0.5 z_source = 1.5 kwargs_options = { 'lens_model_list': ['SPEP'], 'point_source_model_list': ['LENSED_POSITION'] } kwargs_lens = [{'theta_E': 1, 'gamma': 2, 'q': 0.7, 'phi_G': 0}] kwargs_else = [{'ra_image': [-1, 0, 1], 'dec_image': [0, 0, 0]}] lensProp = LensProp(z_lens, z_source, kwargs_options) delays = lensProp.time_delays(kwargs_lens, kwargs_ps=kwargs_else, kappa_ext=0) npt.assert_almost_equal(delays[0], -31.710641699405745, decimal=8) npt.assert_almost_equal(delays[1], 0, decimal=8) npt.assert_almost_equal(delays[2], -31.710641699405745, decimal=8)