hierarc.LensPosterior package¶
Submodules¶
hierarc.LensPosterior.base_config module¶
- class hierarc.LensPosterior.base_config.BaseLensConfig(z_lens, z_source, theta_E, theta_E_error, gamma, gamma_error, r_eff, r_eff_error, kwargs_aperture, kwargs_seeing, anisotropy_model, kwargs_numerics_galkin=None, axial_symmetry='spherical', kinematics_backend='jampy', lens_model_list=None, kwargs_lens_light=None, lens_light_model_list=['HERNQUIST'], MGE_light=None, MGE_mass=None, kwargs_mge_light=None, kwargs_mge_mass=None, sampling_number=1000, num_psf_sampling=100, num_kin_sampling=1000, multi_observations=False, multi_light_profile=False, cosmo_fiducial=None, gamma_in_scaling=None, log_m2l_scaling=None, gamma_pl_scaling=None, q_intrinsic_scaling=None)[source]¶
Bases:
TDCosmography,ImageModelPosterior,KinScalingConfigThis class contains and manages the base configurations of the lens posteriors and makes sure that they are universally applied consistently through the different likelihood definitions.
hierarc.LensPosterior.ddt_kin_constraints module¶
- class hierarc.LensPosterior.ddt_kin_constraints.DdtKinConstraints(z_lens, z_source, ddt_samples, ddt_weights, theta_E, theta_E_error, gamma, gamma_error, r_eff, r_eff_error, sigma_v_measured, kwargs_aperture, kwargs_seeing, anisotropy_model, kwargs_numerics_galkin=None, axial_symmetry='spherical', kinematics_backend='jampy', q_total_mass=None, sigma_v_error_independent=None, sigma_v_error_covariant=None, sigma_v_error_cov_matrix=None, kwargs_lens_light=None, lens_light_model_list=['HERNQUIST'], MGE_light=None, MGE_mass=None, kwargs_mge_light=None, kwargs_mge_mass=None, kappa_ext=0, kappa_ext_sigma=0, sampling_number=1000, num_psf_sampling=100, num_kin_sampling=1000, multi_observations=False, multi_light_profile=False, gamma_pl_scaling=None, q_intrinsic_scaling=None)[source]¶
Bases:
KinConstraintsClass for sampling Ds/Dds posteriors from imaging data and kinematic constraints with additional constraints on the time-delay distance Ddt.
- hierarchy_configuration(num_sample_model=20)[source]¶
Routine to configure the likelihood to be used in the hierarchical sampling. In particular, a default configuration is set to compute the Gaussian approximation of Ds/Dds by sampling the posterior and the estimate of the variance of the sample. The anisotropy scaling is then performed. Different anisotropy models are supported.
- Parameters:
num_sample_model – number of samples drawn from the lens and light model posterior to compute the dimensionless kinematic component J()
- Returns:
keyword arguments
hierarc.LensPosterior.ddt_kin_gauss_constraints module¶
- class hierarc.LensPosterior.ddt_kin_gauss_constraints.DdtGaussKinConstraints(z_lens, z_source, ddt_mean, ddt_sigma, theta_E, theta_E_error, gamma, gamma_error, r_eff, r_eff_error, sigma_v_measured, kwargs_aperture, kwargs_seeing, anisotropy_model, kwargs_numerics_galkin=None, axial_symmetry='spherical', kinematics_backend='jampy', q_total_mass=None, sigma_v_error_independent=None, sigma_v_error_covariant=None, sigma_v_error_cov_matrix=None, kwargs_lens_light=None, lens_light_model_list=['HERNQUIST'], MGE_light=None, MGE_mass=None, kwargs_mge_light=None, kwargs_mge_mass=None, kappa_ext=0, kappa_ext_sigma=0, sampling_number=1000, num_psf_sampling=100, num_kin_sampling=1000, multi_observations=False, gamma_pl_scaling=None, q_intrinsic_scaling=None)[source]¶
Bases:
KinConstraintsClass for sampling Ds/Dds posteriors from imaging data and kinematic constraints with additional constraints on the time-delay distance Ddt.
- hierarchy_configuration(num_sample_model=20)[source]¶
Routine to configure the likelihood to be used in the hierarchical sampling. In particular, a default configuration is set to compute the Gaussian approximation of Ds/Dds by sampling the posterior and the estimate of the variance of the sample. The anisotropy scaling is then performed. Different anisotropy models are supported.
- Parameters:
num_sample_model – number of samples drawn from the lens and light model posterior to compute the dimensionless kinematic component J()
- Returns:
keyword arguments
hierarc.LensPosterior.imaging_constraints module¶
- class hierarc.LensPosterior.imaging_constraints.ImageModelPosterior(theta_E, theta_E_error, gamma, gamma_error, r_eff, r_eff_error)[source]¶
Bases:
objectClass to manage lens and light model posteriors inferred from imaging data.
- draw_lens(gamma_pl=None, no_error=False)[source]¶
- Parameters:
no_error – bool, if True, does not render from the uncertainty but uses the mean values instead
gamma_pl (float or None) – power law slope, if None, draws from measurement uncertainty, otherwise takes at fixed value
- Returns:
theta_E, gamma, r_eff, delta_r_eff
hierarc.LensPosterior.kin_constraints module¶
- class hierarc.LensPosterior.kin_constraints.KinConstraints(z_lens, z_source, theta_E, theta_E_error, gamma, gamma_error, r_eff, r_eff_error, sigma_v_measured, kwargs_aperture, kwargs_seeing, anisotropy_model, kwargs_numerics_galkin=None, axial_symmetry='spherical', kinematics_backend='jampy', q_total_mass=None, sigma_v_error_independent=None, sigma_v_error_covariant=None, sigma_v_error_cov_matrix=None, kwargs_lens_light=None, lens_light_model_list=None, lens_model_list=None, MGE_light=None, MGE_mass=None, kwargs_mge_light=None, kwargs_mge_mass=None, sampling_number=1000, num_psf_sampling=100, num_kin_sampling=1000, multi_observations=False, multi_light_profile=False, cosmo_fiducial=None, gamma_in_scaling=None, log_m2l_scaling=None, gamma_pl_scaling=None, q_intrinsic_scaling=None)[source]¶
Bases:
BaseLensConfigClass that manages constraints from Integral Field Unit spectral observations.
using axisymmetric Jeans modeling (JAM, Cappellari 2008) with JamPy to compute the dimensionless kinematic component J()
- anisotropy_scaling()[source]¶
- Returns:
anisotropy scaling grid along the axes defined by ani_param_array
- property error_cov_measurement¶
Error covariance matrix of the measured velocity dispersion data points This is either calculated from the diagonal ‘sigma_v_error_independent’ and the off- diagonal ‘sigma_v_error_covariant’ terms, or directly from the ‘sigma_v_error_cov_matrix’ if provided.
- Returns:
nxn matrix of the error covariances in the velocity dispersion measurements (km/s)^2
- hierarchy_configuration(num_sample_model=20)[source]¶
Routine to configure the likelihood to be used in the hierarchical sampling. In particular, a default configuration is set to compute the Gaussian approximation of Ds/Dds by sampling the posterior and the estimate of the variance of the sample. The anisotropy scaling is then performed. Different anisotropy models are supported.
- Parameters:
num_sample_model – number of samples drawn from the lens and light model posterior to compute the dimensionless kinematic component J()
- Returns:
keyword arguments
- j_kin_draw(kwargs_anisotropy, gamma_pl=None, q_intrinsic=1.0, no_error=False)[source]¶
One simple sampling realization of the dimensionless kinematics of the model.
- Parameters:
kwargs_anisotropy – keyword argument of anisotropy setting
gamma_pl (float or None) – power law slope, if None, draws from measurement uncertainty, otherwise takes at fixed value
q_intrinsic – intrinsic axis ratio of the light profile to compute the inclination angle
no_error – bool, if True, does not render from the uncertainty but uses the mean values instead
- Returns:
dimensionless kinematic component J() Birrer et al. 2016, 2019
hierarc.LensPosterior.kin_constraints_composite module¶
- class hierarc.LensPosterior.kin_constraints_composite.KinConstraintsComposite(z_lens, z_source, gamma_in_array, log_m2l_array, alpha_Rs_array, r_s_angle_array, theta_E, theta_E_error, gamma, gamma_error, r_eff, r_eff_error, sigma_v_measured, kwargs_aperture, kwargs_seeing, anisotropy_model, kwargs_numerics_galkin=None, axial_symmetry='spherical', kinematics_backend='jampy', q_total_mass=None, gamma_in_prior_mean=None, gamma_in_prior_std=None, q_intrinsic_scaling=None, sigma_v_error_independent=None, sigma_v_error_covariant=None, sigma_v_error_cov_matrix=None, kwargs_lens_light=None, lens_light_model_list=None, MGE_mass=None, kwargs_mge_light=None, kwargs_mge_mass=None, sampling_number=1000, num_psf_sampling=100, num_kin_sampling=1000, multi_observations=False, rho0_array=None, kappa_s_array=None, r_s_array=None, is_m2l_population_level=True)[source]¶
Bases:
KinConstraints- anisotropy_scaling()[source]¶
- Returns:
anisotropy scaling grid along the axes defined by ani_param_array
- draw_lens(no_error=False)[source]¶
Draws a lens model from the posterior.
- Parameters:
no_error – bool, if True, does not render from the uncertainty but uses the mean values instead
- get_kappa_s_r_s_angle(rho_s, r_scale)[source]¶
Computes the surface mass density of the NFW halo at the scale radius.
- Parameters:
rho_s – halo mass normalization in M_sun / Mpc^3
r_scale – halo scale radius in arc seconds
- Returns:
surface mass density divided by the critical density
- hierarchy_configuration(num_sample_model=20)[source]¶
Routine to configure the likelihood to be used in the hierarchical sampling. In particular, a default configuration is set to compute the Gaussian approximation of Ds/Dds by sampling the posterior and the estimate of the variance of the sample. The anisotropy scaling is then performed. Different anisotropy models are supported.
- Parameters:
num_sample_model – number of samples drawn from the lens and light model posterior to compute the dimensionless kinematic component J()
- Returns:
keyword arguments
- j_kin_draw_composite(kwargs_anisotropy, gamma_in, log_m2l, q_intrinsic=1.0, no_error=False)[source]¶
One simple sampling realization of the dimensionless kinematics of the model.
- Parameters:
kwargs_anisotropy – keyword argument of anisotropy setting
gamma_in – power-law slope of the mass model
log_m2l – log10(mass-to-light ratio) of the stellar component
q_intrinsic – intrinsic axis ratio of the light profile to compute the inclination angle
no_error – bool, if True, does not render from the uncertainty but uses the mean values instead
- Returns:
dimensionless kinematic component J() Birrer et al. 2016, 2019
- j_kin_draw_composite_m2l(kwargs_anisotropy, gamma_in, q_intrinsic=1.0, no_error=False)[source]¶
Similar function to j_kin_draw_composite, but now drawing from log_m2l distribution.
- Parameters:
kwargs_anisotropy – keyword argument of anisotropy setting
gamma_in – power-law slope of the mass model
q_intrinsic – intrinsic axis ratio of the light profile to compute the inclination angle
no_error – bool, if True, does not render from the uncertainty but uses the mean values instead
- Returns:
dimensionless kinematic component J() Birrer et al. 2016, 2019
hierarc.LensPosterior.kin_scaling_config module¶
- class hierarc.LensPosterior.kin_scaling_config.KinScalingConfig(anisotropy_model, r_eff, gamma_in_scaling=None, log_m2l_scaling=None, gamma_pl_scaling=None, q_intrinsic_scaling=None, gamma_pl_mean=None)[source]¶
Bases:
KinScalingParamManagerClass to manage the anisotropy model and parameters for the Posterior processing.
- anisotropy_kwargs(a_ani=None, beta_inf=None)[source]¶
- Parameters:
a_ani – anisotropy parameter
beta_inf – anisotropy at infinity (only used for ‘GOM’ model)
- Returns:
list of anisotropy keyword arguments for GalKin module
- property kin_scaling_param_array¶
- Returns:
numpy array of kinematic scaling parameter values to be explored, list of 1D arrays
- property kwargs_anisotropy_base¶
- Returns:
keyword arguments of base anisotropy model configuration
- property kwargs_deprojection_base¶
- Returns:
keyword arguments of axisymmetric JAM parameters that are getting interpolated
- property kwargs_lens_base¶
- Returns:
keyword arguments of lens model parameters that are getting interpolated
- property param_name_list¶
List of parameters in same order as interpolated.
- Returns: