hierarc.LensPosterior package

Submodules

hierarc.LensPosterior.anisotropy_config module

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, kwargs_numerics_galkin, anisotropy_model, lens_model_list=None, kwargs_lens_light=None, lens_light_model_list=['HERNQUIST'], MGE_light=False, kwargs_mge_light=None, hernquist_approx=True, sampling_number=1000, num_psf_sampling=100, num_kin_sampling=1000, multi_observations=False, cosmo_fiducial=None, gamma_in_scaling=None, log_m2l_scaling=None, gamma_pl_scaling=None)[source]

Bases: TDCosmography, ImageModelPosterior, KinScalingConfig

This 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, kwargs_numerics_galkin, anisotropy_model, 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=False, kwargs_mge_light=None, hernquist_approx=False, 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)[source]

Bases: KinConstraints

Class 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, kwargs_numerics_galkin, anisotropy_model, 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=False, kwargs_mge_light=None, hernquist_approx=True, kappa_ext=0, kappa_ext_sigma=0, sampling_number=1000, num_psf_sampling=100, num_kin_sampling=1000, multi_observations=False)[source]

Bases: KinConstraints

Class 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: object

Class 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, kwargs_numerics_galkin, anisotropy_model, 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'], lens_model_list=None, MGE_light=False, kwargs_mge_light=None, hernquist_approx=True, sampling_number=1000, num_psf_sampling=100, num_kin_sampling=1000, multi_observations=False, cosmo_fiducial=None, gamma_in_scaling=None, log_m2l_scaling=None, gamma_pl_scaling=None)[source]

Bases: BaseLensConfig

Class that manages constraints from Integral Field Unit spectral observations.

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, 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

  • 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

model_marginalization(num_sample_model=20)[source]
Parameters:

num_sample_model – number of samples drawn from the lens and light model posterior to compute the dimensionless kinematic component J()

Returns:

J() as array for each measurement prediction, covariance matrix in sqrt(J)

Module contents