slsim.Util.ParamDistributions package

Submodules

slsim.Util.ParamDistributions.gaussian_mixture_model module

class slsim.Util.ParamDistributions.gaussian_mixture_model.GaussianMixtureModel(means=None, stds=None, weights=None)[source]

Bases: object

A Gaussian Mixture Model (GMM) class.

This class is used to represent a mixture of Gaussian distributions, each of which is defined by its mean, standard deviation and weight.

rvs(size)[source]

Generate random variables from the GMM distribution.

Parameters:

size (int) – The number of random variables to generate.

Returns:

An array of random variables sampled from the GMM distribution.

Return type:

np.array

slsim.Util.ParamDistributions.kext_gext_distributions module

class slsim.Util.ParamDistributions.kext_gext_distributions.LineOfSightDistribution(nonlinear_correction_path=None, no_correction_path=None)[source]

Bases: object

Class to read the joint and no nonlinear distributions from the H5 files.

From the H5 files, the class can retrieve kappa and gamma values from the H5 files based on the source and lens redshifts for the resample of external convergence and shear.

correction_data = None
get_kappa_gamma(z_source, z_lens, use_nonlinear_correction=False)[source]

Retrieve kappa and gamma values from the loaded data based on source and lens redshifts.

Parameters:
  • z_source – Source redshift (zs).

  • z_lens – Lens redshift (zd).

  • use_nonlinear_correction – Boolean to use the nonlinear correction data.

Returns:

Tuple of gamma and kappa values.

no_nonlinear_correction_data = None

Module contents