lightcurvelynx.astro_utils.snia_utils
Classes
A class that contains the pdf of the SALT x1 parameter given the hostmass |
|
A class for sampling from the HostmassX1Distr. |
|
A wrapper class for the _x0_from_distmod() function. |
|
A wrapper class for the _distmod_from_redshift() function. |
|
A class for gernerating SN Coordinates given host coordinates and physical separations. |
Functions
|
SN Ia volumetric rate. |
|
Calculate the number of SNe Ia in each redshift bin based on rates. |
Module Contents
- snia_volumetric_rates(redshift, r0=2.27e-05, alpha=1.7)[source]
SN Ia volumetric rate. r_v(z) = r0 * (1+z)^alpha (SNe Ia yr^-1 Mpc^-3 h_70^3) The default values are from Frohmaier et al. (2019). r0 = 2.27+/-0.19e-5 alpha = 1.7+/-0.21
- Parameters:
redshift (float or numpy.ndarray) – The redshift of the supernova
r0 (float) – The rate function parameter r0. Default is 2.27e-5.
alpha (float) – The rate function parameter alpha. Default is 1.7
- Returns:
rate_vol – The volumetric rate of the supernova given the redshift
- Return type:
float or numpy.ndarray
- num_snia_per_redshift_bin(zmin=0.001, zmax=10, znbins=20, solid_angle=None, H0=73.0, Omega_m=0.3, vol_rate_function=snia_volumetric_rates)[source]
Calculate the number of SNe Ia in each redshift bin based on rates.
Calculated using:
r_v(z) = dN/dz V = comoving volume T = length of survey in years N = int r_v(z)dz * dV * dT
- Parameters:
zmin (float) – Min redshift value for calculation.
zmax (float) – Max redshift value for calculation.
znbins (int) – Number of redshift bins for calculating SNe Ia numbers.
solid_angle (float) – Solid angle for calculating the number of SNe (in sr).
H0 (float) – The Hubble Constant.
Omega_m (float) – The matter density.
vol_rate_function (Callable) – The function that defines the volumetric rate. Default is snia_volumetric_rates.
- Returns:
num_sn (numpy.ndarray) – Number of SNe Ia in each zbin per year.
z_mean (numpy.ndarray) – Mean value for each redshift bin.
- class HostmassX1Distr(hostmass)[source]
A class that contains the pdf of the SALT x1 parameter given the hostmass
- Parameters:
hostmass (float) – The hostmass value in units of log10(M/M_solar).
- class HostmassX1Func(hostmass, **kwargs)[source]
Bases:
lightcurvelynx.math_nodes.scipy_random.NumericalInversePolynomialFuncA class for sampling from the HostmassX1Distr.
- Parameters:
hostmass (function or constant) – The function or constant providing the hostmass value in units of log10(M/M_solar).
**kwargs (dict, optional) – Any additional keyword arguments.
- compute(graph_state, rng_info=None, **kwargs)[source]
Sample from one of the two distributions depending on hostmass.
- Parameters:
graph_state (GraphState) – An object mapping graph parameters to their values. This object is modified in place as it is sampled.
rng_info (numpy.random._generator.Generator or None, optional) – A given numpy random number generator to use for this computation. If not provided, the function uses the node’s random number generator.
**kwargs (dict, optional) – Additional function arguments.
- Returns:
results – The result of the computation. This return value is provided so that testing functions can easily access the results.
- Return type:
any
- class X0FromDistMod(distmod, x1, c, alpha, beta, m_abs, **kwargs)[source]
Bases:
lightcurvelynx.base_models.FunctionNodeA wrapper class for the _x0_from_distmod() function.
- Parameters:
distmod (function or constant) – The function or constant providing the distance modulus value.
x1 (function or constant) – The function or constant providing the x1 value.
c (function or constant) – The function or constant providing the c value.
alpha (function or constant) – The function or constant providing the alpha value.
beta (function or constant) – The function or constant providing the beta value.
m_abs (function or constant) – The function or constant providing the m_abs value.
**kwargs (dict, optional) – Any additional keyword arguments.
- class DistModFromRedshift(redshift, H0=73.0, Omega_m=0.3, **kwargs)[source]
Bases:
lightcurvelynx.base_models.FunctionNodeA wrapper class for the _distmod_from_redshift() function.
- Parameters:
redshift (function or constant) – The function or constant providing the redshift value.
H0 (constant) – The Hubble constant.
Omega_m (constant) – The matter density Omega_m.
**kwargs (dict, optional) – Any additional keyword arguments.
- class SNCoordGivenPhysicalSep(host_ra, host_dec, physical_sep_kpc, redshift, *, H0=73.0, Omega_m=0.3, pos_angle=None, **kwargs)[source]
Bases:
lightcurvelynx.base_models.FunctionNodeA class for gernerating SN Coordinates given host coordinates and physical separations.
- Parameters:
host_ra (function or constant) – Host galaxy RA in degree.
host_dec (function or constant) – Host galaxy DEC in degree.
physical_sep_kpc (function or constant) – The physical separation between host and SN in kpc.
redshift (function or constant) – The function or constant providing the redshift value.
H0 (constant) – The Hubble constant.
Omega_m (constant) – The matter density Omega_m.
pos_angle (parameter or None) – The position angle for the SN location relative to the host galaxy (in radians). If None, a random position angle is generated for each sample.
**kwargs (dict, optional) – Any additional keyword arguments.