ler.utils.cosmological_coversions

Module Contents

Functions

generate_mixed_grid(x_min, x_max, resolution[, ...])

Generalized mixed spacing grid generator. Safely handles negative ranges.

luminosity_distance([z, z_min, z_max, cosmo, ...])

Function to create a lookup table for the luminosity distance wrt redshift.

differential_comoving_volume([z, z_min, z_max, cosmo, ...])

comoving_distance([z, z_min, z_max, cosmo, directory, ...])

angular_diameter_distance([z, z_min, z_max, cosmo, ...])

angular_diameter_distance_z1z2([z1, z2, z_min, z_max, ...])

ler.utils.cosmological_coversions.generate_mixed_grid(x_min, x_max, resolution, power_law_part='lower', spacing_trend='increasing', power=2.3, value_transition_fraction=0.6, num_transition_fraction=0.8, auto_match_slope=True)[source]

Generalized mixed spacing grid generator. Safely handles negative ranges.

Parameters:
x_min, x_maxfloat

The physical domain boundaries (can be negative, crossing zero, etc.).

power_law_partstr

‘lower’ to apply power-law to the first segment. ‘upper’ to apply power-law to the second segment.

spacing_trendstr

‘increasing’: Step sizes grow as x increases. ‘decreasing’: Step sizes shrink as x increases.

powerfloat

Exponent (>= 1.0) to control curvature. Overridden if auto_match_slope=True.

auto_match_slopebool

If True, analytically calculates the required power AND trend to guarantee a smooth transition without a kink.

Returns:
numpy.ndarray

The generated grid points.

Examples

from ler.utils.cosmological_conversions import generate_mixed_grid

resolution=20 # linear+power-law with power-law in the upper segment and decreasing step sizes x = generate_mixed_grid(

x_min=0.0, x_max=10.0, resolution=resolution, power_law_part=’upper’, spacing_trend=’decreasing’, # Forces largest steps near z_trans power=2.5, value_transition_fraction=0.6, num_transition_fraction=0.3, auto_match_slope=True # We accept the kink to control the exact power

) # powerlaw+linear with power-law in the lower segment and increasing step sizes x = generate_mixed_grid(

x_min=0.0, x_max=10.0, resolution=resolution, power_law_part=’lower’, spacing_trend=’increasing’, # Forces largest steps near z_trans power=2.5, value_transition_fraction=0.3, num_transition_fraction=0.6, auto_match_slope=True # We accept the kink to control the exact power

)

ler.utils.cosmological_coversions.luminosity_distance(z=None, z_min=0.001, z_max=10.0, cosmo=LambdaCDM(H0=70, Om0=0.3, Ode0=0.7, Tcmb0=0.0, Neff=3.04, m_nu=None, Ob0=0.0), directory='./interpolator_json', create_new=False, resolution=500, get_attribute=True)[source]

Function to create a lookup table for the luminosity distance wrt redshift.

Parameters:
znumpy.ndarray or float

Source redshifts

z_minfloat

Minimum redshift of the source population

z_maxfloat

Maximum redshift of the source population

Attributes:
z_to_luminosity_distanceler.utils.FunctionConditioning

Object of FunctionConditioning class containing the luminosity distance wrt redshift

ler.utils.cosmological_coversions.differential_comoving_volume(z=None, z_min=0.001, z_max=10.0, cosmo=LambdaCDM(H0=70, Om0=0.3, Ode0=0.7, Tcmb0=0.0, Neff=3.04, m_nu=None, Ob0=0.0), directory='./interpolator_json', create_new=False, resolution=500, get_attribute=True)[source]
ler.utils.cosmological_coversions.comoving_distance(z=None, z_min=0.001, z_max=10.0, cosmo=LambdaCDM(H0=70, Om0=0.3, Ode0=0.7, Tcmb0=0.0, Neff=3.04, m_nu=None, Ob0=0.0), directory='./interpolator_json', create_new=False, resolution=500, get_attribute=True)[source]
ler.utils.cosmological_coversions.angular_diameter_distance(z=None, z_min=0.001, z_max=10.0, cosmo=LambdaCDM(H0=70, Om0=0.3, Ode0=0.7, Tcmb0=0.0, Neff=3.04, m_nu=None, Ob0=0.0), directory='./interpolator_json', create_new=False, resolution=500, get_attribute=True)[source]
ler.utils.cosmological_coversions.angular_diameter_distance_z1z2(z1=None, z2=None, z_min=0.001, z_max=10.0, cosmo=LambdaCDM(H0=70, Om0=0.3, Ode0=0.7, Tcmb0=0.0, Neff=3.04, m_nu=None, Ob0=0.0), directory='./interpolator_json', create_new=False, resolution=500, get_attribute=True)[source]