ler.lens_galaxy_population.optical_depth
Module for optical depth and lens parameter distribution calculations.
This module provides the OpticalDepth class for computing strong lensing
optical depth, cross-section, sampling velocity dispersion, axis ratio, and other lens galaxy
population parameters. It supports multiple lens models including SIS, SIE,
and EPL + external shear.
Key features:
Optical depth computation for strong gravitational lensing
Velocity dispersion sampling with multiple models
Lens redshift distribution sampling
Cross-section calculations for various lens models
Copyright (C) 2024 Hemantakumar Phurailatpam. Distributed under MIT License.
Module Contents
Classes
Class for computing optical depth and lens galaxy population parameters. |
- class ler.lens_galaxy_population.optical_depth.OpticalDepth(npool=4, z_min=0.0, z_max=10.0, cosmology=None, lens_type='epl_shear_galaxy', lens_functions=None, lens_functions_params=None, lens_priors=None, lens_priors_params=None, directory='./interpolator_json', create_new_interpolator=False, verbose=False)[source]
Class for computing optical depth and lens galaxy population parameters.
This class calculates strong lensing optical depth, velocity dispersion, axis ratio, and other parameters for a lens galaxy population. It supports SIS, SIE, and EPL + external shear lens models with customizable samplers and interpolators for efficient computation.
Key Features:
Multiple lens model support (SIS, SIE, EPL + shear)
Configurable velocity dispersion distributions
Cached interpolators for fast optical depth computation
Flexible parameter sampling with user-defined priors
- Parameters:
- npool
int Number of processors for multiprocessing.
default: 4
- z_min
float Minimum redshift of the lens galaxy population.
default: 0.0
- z_max
float Maximum redshift of the lens galaxy population.
default: 10.0
- cosmology
astropy.cosmologyorNone Cosmology object for distance calculations.
default: LambdaCDM(H0=70, Om0=0.3, Ode0=0.7)
- lens_type
str Type of lens galaxy model.
Options:
‘epl_shear_galaxy’: Elliptical power-law with external shear
‘sie_galaxy’: Singular isothermal ellipsoid
‘sis_galaxy’: Singular isothermal sphere
default: ‘epl_shear_galaxy’
- lens_functions
dictorNone Dictionary with lens-related functions.
default: None (uses defaults for lens_type)
- lens_functions_params
dictorNone Dictionary with parameters for lens-related functions.
default: None
- lens_priors
dictorNone Dictionary of sampler functions for lens parameters.
default: None (uses defaults for lens_type)
- lens_priors_params
dictorNone Dictionary with parameters for the samplers.
default: None
- directory
str Directory where interpolators are saved.
default: ‘./interpolator_json’
- create_new_interpolator
boolordict Whether to create new interpolators.
default: False
- verbose
bool If True, prints additional information.
default: False
- npool
Examples
Basic usage:
>>> from ler.lens_galaxy_population import OpticalDepth >>> od = OpticalDepth() >>> tau = od.optical_depth(zs=np.array([1.0, 2.0]))
- property lens_type[source]
Type of lens galaxy model.
- Returns:
- lens_type
str Lens type (‘epl_shear_galaxy’, ‘sie_galaxy’, or ‘sis_galaxy’).
- lens_type
- property npool[source]
Number of processors for multiprocessing.
- Returns:
- npool
int Number of parallel processors.
- npool
- property z_min[source]
Minimum redshift of the lens galaxy population.
- Returns:
- z_min
float Minimum redshift.
- z_min
- property z_max[source]
Maximum redshift of the lens galaxy population.
- Returns:
- z_max
float Maximum redshift.
- z_max
- property cosmo[source]
Cosmology object for distance calculations.
- Returns:
- cosmo
astropy.cosmology Cosmology object.
- cosmo
- property directory[source]
Directory for interpolator storage.
- Returns:
- directory
str Path to interpolator JSON files.
- directory
- property velocity_dispersion[source]
Velocity dispersion sampler object.
Returns a
FunctionConditioningobject with methods:rvs(size, zl): Sample velocity dispersion valuespdf(sigma, zl): Get probability densityfunction(sigma, zl): Get number density function
- Returns:
- velocity_dispersion
FunctionConditioning Sampler object for velocity dispersion (km/s).
- velocity_dispersion
Examples
>>> from ler.lens_galaxy_population import OpticalDepth >>> od = OpticalDepth() >>> sigma = od.velocity_dispersion(size=100, zl=np.ones(100)*0.5)
- property axis_ratio[source]
Axis ratio sampler object.
Returns a
FunctionConditioningobject with methods:rvs(size, sigma): Sample axis ratio valuespdf(q, sigma): Get probability densityfunction(q, sigma): Get distribution function
- Returns:
- axis_ratio
FunctionConditioning Sampler object for axis ratio.
- axis_ratio
Examples
>>> from ler.lens_galaxy_population import OpticalDepth >>> od = OpticalDepth() >>> q = od.axis_ratio(size=100, sigma=np.ones(100)*200.)
- property axis_rotation_angle[source]
Axis rotation angle sampler object.
Returns a
FunctionConditioningobject with methods:rvs(size): Sample axis rotation anglespdf(phi): Get probability density
- Returns:
- axis_rotation_angle
FunctionConditioning Sampler object for axis rotation angle (rad).
- axis_rotation_angle
Examples
>>> from ler.lens_galaxy_population import OpticalDepth >>> od = OpticalDepth() >>> phi = od.axis_rotation_angle(size=100)
- property density_profile_slope[source]
Density profile slope sampler object.
Returns a
FunctionConditioningobject with methods:rvs(size): Sample density profile slope valuespdf(gamma): Get probability density
- Returns:
- density_profile_slope
FunctionConditioning Sampler object for density profile slope.
- density_profile_slope
Examples
>>> from ler.lens_galaxy_population import OpticalDepth >>> od = OpticalDepth() >>> gamma = od.density_profile_slope(size=100)
- property external_shear1[source]
External shear sampler object (component 1).
Returns a
FunctionConditioningobject with methods:rvs(size): Sample shear component 1 (gamma1)pdf(gamma1): Get probability density
- Returns:
- external_shear1
FunctionConditioning Sampler object for external shear (component 1).
- external_shear1
Examples
>>> from ler.lens_galaxy_population import OpticalDepth >>> od = OpticalDepth() >>> gamma1 = od.external_shear1(size=100)
- property external_shear2[source]
External shear sampler object (component 2).
Returns a
FunctionConditioningobject with methods:rvs(size): Sample shear component 2 (gamma2)pdf(gamma2): Get probability density
- Returns:
- external_shear2
FunctionConditioning Sampler object for external shear (component 2).
- external_shear2
Examples
>>> from ler.lens_galaxy_population import OpticalDepth >>> od = OpticalDepth() >>> gamma2 = od.external_shear2(size=100)
- property cross_section[source]
Lensing cross-section calculator.
Returns a callable that computes lensing cross-section for individual
lensing events. Input parameters depend on lens type:
EPL+shear: zs, zl, sigma, q, phi, gamma, gamma1, gamma2
SIE: zs, zl, sigma, q
SIS: zs, zl, sigma
- Returns:
- cross_section
callable Cross-section function (rad² units).
- cross_section
Examples
>>> from ler.lens_galaxy_population import OpticalDepth >>> od = OpticalDepth() >>> cs = od.cross_section(zs=zs, zl=zl, sigma=sigma, ...)
- property lens_redshift_sl[source]
Strongly lensed lens redshift sampler object.
Returns a
FunctionConditioningobject with methods:rvs(size, zs): Sample lens redshifts given source redshiftspdf(zl, zs): Get probability densityfunction(zl, zs): Get effective lensing cross-section
- Returns:
- lens_redshift_sl
FunctionConditioning Sampler object for strongly lensed lens redshift.
- lens_redshift_sl
Examples
>>> from ler.lens_galaxy_population import OpticalDepth >>> od = OpticalDepth() >>> zl = od.lens_redshift_sl(size=100, zs=np.ones(100)*2.0)
- property lens_redshift[source]
Lens redshift (intrinsic) sampler object.
Returns a
FunctionConditioningobject with methods:rvs(size): Sample lens redshiftspdf(zl): Get probability density
- Returns:
- lens_redshift
FunctionConditioning Sampler object for lens redshift.
- lens_redshift
Examples
>>> from ler.lens_galaxy_population import OpticalDepth >>> od = OpticalDepth() >>> zl = od.lens_redshift(size=100)
- property optical_depth[source]
Strong lensing optical depth calculator.
- Returns:
- optical_depth
FunctionConditioning Function object with .function(zs) method that returns n optical depth for given source redshifts.
- optical_depth
Examples
>>> from ler.lens_galaxy_population import OpticalDepth >>> od = OpticalDepth() >>> tau = od.optical_depth.function(np.array([1.0, 2.0]))
- property zs_sl[source]
Strongly-lensed source redshift sampler object.
- Returns:
- zs_sl
FunctionConditioning Sampler object for source redshift conditioned on strong lensing.
- zs_sl
Notes
The default strongly-lensed source redshift sampler,
strongly_lensed_source_redshift, is implemented inLensGalaxyParameterDistribution. This property exists inOpticalDepthso that derived classes can configure/override the prior using the common lens-prior mechanism.
- property available_lens_priors[source]
Dictionary of available lens parameter samplers and their default parameters.
- Returns:
- available_lens_priors
dict Dictionary with sampler names and default parameters.
- available_lens_priors
- property available_lens_functions[source]
Dictionary of available lens functions and their default parameters.
- Returns:
- available_lens_functions
dict Dictionary with function names and default parameters.
- available_lens_functions
- lens_redshift_strongly_lensed_numerical(size=1000, zs=None, get_attribute=False, **kwargs)[source]
Sample lens redshifts conditioned on strong lensing (numerical method).
This method computes the lens redshift distribution by numerically integrating over the velocity-dispersion number density, lensing cross-section, and differential comoving volume:
\[\frac{d\tau}{dz_l}(z_s) \propto \frac{dV_c}{dz_l}\int d\sigma\, n(\sigma, z_l)\,\sigma_{\rm SL}(\sigma, z_l, z_s).\]- Parameters:
- size
int Number of samples to generate. n default: 1000
- zs
numpy.ndarray Source redshifts.
- get_attribute
bool If True, returns the sampler object instead of samples. n default: False
- **kwargs
dict Additional parameters forwarded from
lens_priors_params(typically merged onto a fresh copy of the sampler defaults listed inavailable_lens_priorsso shared templates are never mutated).- cross_section_epl_shear_interpolation
bool If True, uses
cross_section_epl_shear_interpolation()as the cross-section function (with a lens-type-dependent interpolation grid) during the numerical integration for lens redshift distribution. default: False
- size
- Returns:
- zl
numpy.ndarrayorFunctionConditioning Lens redshift samples or sampler object.
- zl
Examples
>>> from ler.lens_galaxy_population import OpticalDepth >>> od = OpticalDepth() >>> zl = od.lens_redshift(size=100, zs=np.ones(100)*2.0)
- lens_redshift_intrinsic_numerical(size=1000, zs=None, get_attribute=False, **kwargs)[source]
Sample intrinsic lens redshifts (numerical method).
This method computes the intrinsic lens redshift distribution by numerically integrating the velocity-dispersion number density and differential comoving volume.
- Parameters:
- size
int Number of samples to generate.
default: 1000
- zs
numpy.ndarrayorNone Source redshifts (not used, kept for API compatibility).
- get_attribute
bool If True, returns the sampler object instead of samples.
default: False
- size
- Returns:
- zl
numpy.ndarrayorFunctionConditioning Lens redshift samples or sampler object.
- zl
- lens_redshift_strongly_lensed_sis_analytical(size, zs, get_attribute=False, **kwargs)[source]
Sample SIS lens redshifts using Haris et al. (2018) distribution.
- Parameters:
- size
int Number of samples to generate.
- zs
numpy.ndarray Source redshifts.
- get_attribute
bool If True, returns the sampler object instead of samples.
default: False
- **kwargs
dict Additional parameters.
- size
- Returns:
- zl
numpy.ndarrayorFunctionConditioning Lens redshift samples or sampler object.
- zl
Examples
>>> from ler.lens_galaxy_population import OpticalDepth >>> od = OpticalDepth(lens_type='sis_galaxy') >>> zl = od.lens_redshift(size=100, zs=np.ones(100)*2.0)
- gengamma(size, get_attribute=False, **kwargs)[source]
Sample velocity dispersion from generalized gamma distribution.
- Parameters:
- size
int Number of samples to generate.
- get_attribute
bool If True, returns the sampler object instead of samples.
default: False
- **kwargs
dict Additional parameters.
Parameter
Unit
Description
param_name
Name of the parameter
sampler_type
Type of the sample
sigma_min
km/s
minimum velocity dispersion
sigma_max
km/s
maximum velocity dispersion
alpha
dimensionless
Power-law index governing the slope of the distribution at low velocities
beta
dimensionless
Exponential parameter determining the sharpness of the high-velocity cutoff
phistar
h^3 Mpc^-3
Normalization constant representing the comoving number density of galaxy
sigmastar
km/s
Characteristic velocity scale marking the “knee” transition in the VDF
- size
- Returns:
- sigma
numpy.ndarrayorFunctionConditioning Velocity dispersion samples (km/s) or sampler object.
- sigma
Examples
>>> from ler.lens_galaxy_population import OpticalDepth >>> od = OpticalDepth(lens_priors=dict( ... velocity_dispersion="gengamma")) >>> sigma = od.velocity_dispersion(size=100)
- velocity_dispersion_bernardi(size, get_attribute=False, **kwargs)[source]
Sample velocity dispersion from Bernardi et al. (2010) distribution.
Uses inverse transform sampling on the velocity dispersion function.
- Parameters:
- size
int Number of samples to generate.
- get_attribute
bool If True, returns the sampler object instead of samples.
default: False
- **kwargs
dict Additional parameters.
Parameter
Unit
Description
param_name
Name of the parameter
sampler_type
Type of the sample
sigma_min
km/s
minimum velocity dispersion
sigma_max
km/s
maximum velocity dispersion
alpha
dimensionless
Power-law index governing the slope of the distribution at low velocities
beta
dimensionless
Exponential parameter determining the sharpness of the high-velocity cutoff
phistar
h^3 Mpc^-3
Normalization constant representing the comoving number density of galaxy
sigmastar
km/s
Characteristic velocity scale marking the “knee” transition in the VDF
- size
- Returns:
- sigma
numpy.ndarrayorFunctionConditioning Velocity dispersion samples (km/s) or sampler object.
- sigma
Examples
>>> from ler.lens_galaxy_population import OpticalDepth >>> od = OpticalDepth(lens_priors=dict( ... velocity_dispersion="velocity_dispersion_bernardi")) >>> sigma = od.velocity_dispersion(size=100)
- velocity_dispersion_ewoud(size, zl, get_attribute=False, **kwargs)[source]
Sample redshift-dependent velocity dispersion from Wempe et al. (2022).
Uses inverse transform sampling with redshift-dependent velocity dispersion function.
- Parameters:
- size
int Number of samples to generate.
- zl
numpy.ndarray Lens redshifts.
- get_attribute
bool If True, returns the sampler object instead of samples.
default: False
- **kwargs
dict Additional parameters.
Parameter
Unit
Description
param_name
Name of the parameter
sampler_type
Type of the sample
sigma_min
km/s
minimum velocity dispersion
sigma_max
km/s
maximum velocity dispersion
alpha
dimensionless
Power-law index governing the slope of the distribution at low velocities
beta
dimensionless
Exponential parameter determining the sharpness of the high-velocity cutoff
phistar
h^3 Mpc^-3
Normalization constant representing the comoving number density of galaxy
sigmastar
km/s
Characteristic velocity scale marking the “knee” transition in the VDF
- size
- Returns:
- sigma
numpy.ndarrayorFunctionConditioning Velocity dispersion samples (km/s) or sampler object.
- sigma
Examples
>>> from ler.lens_galaxy_population import OpticalDepth >>> od = OpticalDepth() >>> sigma = od.velocity_dispersion(size=100, zl=np.ones(100)*0.5)
- rayleigh(size, sigma, get_attribute=False, **kwargs)[source]
Sample axis ratio from Rayleigh distribution conditioned on velocity dispersion.
- Parameters:
- size
int Number of samples to generate.
- sigma
numpy.ndarray Velocity dispersion of the lens galaxy (km/s).
- get_attribute
bool If True, returns the sampler object instead of samples.
default: False
- **kwargs
dict Additional parameters (param_name, sampler_type, q_min, q_max).
- size
- Returns:
- q
numpy.ndarrayorFunctionConditioning Axis ratio samples or sampler object.
- q
Examples
>>> from ler.lens_galaxy_population import OpticalDepth >>> od = OpticalDepth(lens_priors=dict(axis_ratio="rayleigh")) >>> q = od.axis_ratio(size=100, sigma=np.ones(100)*200.)
- axis_ratio_padilla_strauss(size=1000, get_attribute=False, **kwargs)[source]
Sample axis ratio from Padilla & Strauss (2008) distribution.
- Parameters:
- size
int Number of samples to generate.
default: 1000
- get_attribute
bool If True, returns the sampler object instead of samples.
default: False
- **kwargs
dict Additional parameters (param_name, sampler_type, q_min, q_max).
- size
- Returns:
- q
numpy.ndarrayorFunctionConditioning Axis ratio samples or sampler object.
- q
Examples
>>> from ler.lens_galaxy_population import OpticalDepth >>> od = OpticalDepth(lens_priors=dict(axis_ratio="axis_ratio_padilla_strauss")) >>> q = od.axis_ratio(size=100)
- uniform(size, get_attribute=False, **kwargs)[source]
Sample values from uniform distribution.
- Parameters:
- size
int Number of samples to draw.
- get_attribute
bool If True, return the sampler object instead of samples.
default: False
- **kwargs
dict Model parameters:
x_min: Minimum value, default: 0.0
x_max: Maximum value, default: 1.0
- size
- Returns:
- values
numpy.ndarray Array of uniformly distributed values in range [x_min, x_max].
- values
- constant_values_n_size(size=100, get_attribute=False, **kwargs)[source]
Return array of constant values.
- Parameters:
- size
int Number of values to return.
default: 100
- get_attribute
bool If True, return the sampler object instead of samples.
default: False
- **kwargs
dict Model parameters:
value: Constant value to return, default: 0.0
- size
- Returns:
- values
numpy.ndarray Array of constant values.
- values
- normal(size, get_attribute=False, **kwargs)[source]
Sample with a normal distribution.
- Parameters:
- size
int Number of samples to draw.
- get_attribute
bool If True, return the sampler object instead of samples.
default: False
- **kwargs
dict Model parameters:
mu: Mean of the normal distribution, default: 1.99
sigma: Standard deviation of the normal distribution, default: 0.149
- size
- Returns:
- x
numpy.ndarray Array of values drawn from the normal distribution.
- x
- optical_depth_numerical(zs, get_attribute=False, **kwargs)[source]
Helper to compute optical depth numerically by integrating lens redshift.
- Parameters:
- zs
numpy.ndarray Source redshifts.
- get_attribute
bool If True, returns the function object instead of values.
default: False
- **kwargs
dict Additional parameters.
- zs
- Returns:
- tau
numpy.ndarrayorFunctionConditioning Optical depth values or function object.
- tau
Notes
The optical depth is a cumulative integral of a differential cross-section and is therefore non-negative. When optical depth values are cached via spline interpolation, tiny negative values can appear near boundaries due to numerical interpolation artifacts. This routine clamps such values to 0 by constructing the cached interpolator with
non_negative_function=True.
- compute_einstein_radii(sigma, zl, zs)[source]
Function to compute the Einstein radii of the lens galaxies
- Parameters:
- sigmafloat
velocity dispersion of the lens galaxy
- zlfloat
lens redshifts
- zsfloat
source redshifts
- Returns:
- theta_Efloat
Einstein radii of the lens galaxies in radians. Multiply by
Examples
>>> from ler.lens_galaxy_population import LensGalaxyParameterDistribution >>> lens = LensGalaxyParameterDistribution() >>> sigma = 200.0 >>> zl = 0.5 >>> zs = 1.0 >>> lens.compute_einstein_radii(sigma, zl, zs)
- optical_depth_sis_analytic(zs, get_attribute=False, **kwargs)[source]
Function to compute the strong lensing optical depth (SIS). LambdaCDM(H0=70, Om0=0.3, Ode0=0.7) was used to derive the following equation. This is the analytic version of optical depth from z=0 to z=zs.
- Parameters:
- zs
numpy.ndarray Source redshifts.
- get_attribute
bool If True, returns the function object instead of values. n default: False
- **kwargs
dict Additional parameters.
- zs
- Returns:
- tau
numpy.ndarrayorFunctionConditioning Optical depth values or function object.
- tau
Notes
The analytic SIS optical depth is non-negative. When cached via spline interpolation, tiny negative values can occur at the edges due to interpolation/roundoff. The cached interpolator is therefore created with
non_negative_function=Trueto clamp such artifacts to 0.
- cross_section_sis(zs=None, zl=None, sigma=None, get_attribute=False, **kwargs)[source]
Function to compute the SIS cross-section
- Parameters:
- sigmafloat
velocity dispersion of the lens galaxy
- zlfloat
redshift of the lens galaxy
- zsfloat
redshift of the source galaxy
- Returns:
- cross_sectionfloat
SIS cross-section
Examples
>>> from ler.lens_galaxy_population import OpticalDepth >>> od = OpticalDepth() >>> print(od.cross_section_sis(sigma=200., zl=0.5, zs=1.0))
- cross_section_sie_feixu(zs=None, zl=None, sigma=None, q=None, get_attribute=False, **kwargs)[source]
Function to compute the SIE cross-section from Fei Xu et al. (2021)
- Parameters:
- sigmafloat
velocity dispersion of the lens galaxy
- zlfloat
redshift of the lens galaxy
- zsfloat
redshift of the source galaxy
- Returns:
- cross_sectionfloat
SIE cross-section
Examples
>>> from ler.lens_galaxy_population import OpticalDepth >>> od = OpticalDepth() >>> print(od.cross_section_sie_feixu(sigma=200., zl=0.5, zs=1.0, q=1.0))
- cross_section_epl_shear_numerical(zs, zl, sigma, q, phi, gamma, gamma1, gamma2)[source]
Function to compute the strong lensing cross-section numerically for EPL + external shear lenses.
- Parameters:
- zsnumpy.ndarray
redshift of the source galaxies
- zlnumpy.ndarray
redshift of the lens galaxies
- sigmanumpy.ndarray
velocity dispersion of the lens galaxies
- qnumpy.ndarray
axis ratios of the lens galaxies
- phinumpy.ndarray
axis rotation angles of the lens galaxies in radians
- gammanumpy.ndarray
external shear magnitudes of the lens galaxies
- gamma1numpy.ndarray
external shear component 1 of the lens galaxies
- gamma2numpy.ndarray
external shear component 2 of the lens galaxies
- Returns:
- cross_sectionnumpy.ndarray
strong lensing cross-section of the lens galaxies in square radians
- cross_section_epl_shear_numerical_mp(theta_E, gamma, gamma1, gamma2, q=None, phi=None, e1=None, e2=None, verbose=False, **kwargs)[source]
Function to compute the strong lensing cross-section numerically for EPL + external shear lenses.
- Parameters:
- theta_Enumpy.ndarray
Einstein radii of the lens galaxies in radians
- gammanumpy.ndarray
external shear magnitudes of the lens galaxies
- gamma1numpy.ndarray
external shear component 1 of the lens galaxies
- gamma2numpy.ndarray
external shear component 2 of the lens galaxies
- qnumpy.ndarray
axis ratios of the lens galaxies
- phinumpy.ndarray
axis rotation angles of the lens galaxies in radians
- e1numpy.ndarray
ellipticity component 1 of the lens galaxies
- e2numpy.ndarray
ellipticity component 2 of the lens galaxies
- Returns:
- cross_sectionnumpy.ndarray
strong lensing cross-section of the lens galaxies in square radians
- create_parameter_grid(size_list=[25, 25, 45, 15, 15], spacing_config=None, bounds=None)[source]
Create a parameter grid for lens galaxies.
- Parameters:
- size_listlist
List of sizes for each parameter grid.
- spacing_configdict or None
Optional per-parameter spacing configuration. Keys can include
q,phi,e1,e2,gamma,gamma1,gamma2and values are dictionaries, e.g.{"mode": "two_sided_mixed_grid", "power_law_part": "lower", "spacing_trend": "increasing", "power": 2.5, "value_transition_fraction": 0.6, "num_transition_fraction": 0.3, "auto_match_slope": True}.- boundsdict or None
Pre-computed parameter bounds from
_compute_parameter_bounds. If None, bounds are computed internally.
- Returns:
- zlnumpy.ndarray
Lens redshifts.
- sigmanumpy.ndarray
Velocity dispersions.
- qnumpy.ndarray
Axis ratios.
- cross_section_epl_shear_interpolation_init(file_path, size_list, spacing_config=None, batch_size=50000, bounds=None)[source]
- cross_section_epl_shear_interpolation(zs=None, zl=None, sigma=None, q=None, phi=None, gamma=None, gamma1=None, gamma2=None, get_attribute=False, size_list=[25, 25, 45, 15, 15], spacing_config=None, **kwargs)[source]
Function to compute the cross-section correction factor
- cross_section_epl_shear_njit(zs, zl, sigma, q, phi, gamma, gamma1, gamma2, get_attribute=False, num_th=500, maginf=-100.0, **kwargs)[source]
Compute the lensing cross-section for EPL+shear lens model using Numba njit.
- Parameters:
- zs
floatornumpy.ndarray Source redshift(s).
- zl
floatornumpy.ndarray Lens redshift(s).
- sigma
floatornumpy.ndarray Velocity dispersion(s) in km/s.
- q
floatornumpy.ndarray Axis ratio(s) (b/a).
- phi
floatornumpy.ndarray Axis rotation angle(s) in radians.
- gamma
floatornumpy.ndarray Density profile slope(s).
- gamma1
floatornumpy.ndarray External shear component 1.
- gamma2
floatornumpy.ndarray External shear component 2.
- get_attribute
bool, optional If True, return the interpolator instance instead of the cross-section. Default is False.
- num_th
int, optional Number of theta values to use for the spline interpolation. Default is 500.
- maginf
float, optional Magnitude limit for the cross-section calculation. Default is -100.0.
- **kwargs
Additional keyword arguments to pass to the interpolator.
- zs
- Returns:
- cs_caculator
ler.image_properties.cross_section_njit.CrossSectionNjit The interpolator instance (if get_attribute=True).
- cross_section
floatornumpy.ndarray Lensing cross-section in arcsec^2.
- cs_caculator