snsim.salt_utils

Contains function related to SALT model.

Module Contents

Functions

n21_x1_model(z[, seed])

X1 distribution redshift dependant model from Nicolas et al. 2021.

x1_mass_model(host_mass[, seed])

n21_x1_mass_model(z[, host_mass, seed])

cov_x0_to_mb(x0, cov)

Convert x0,x1,c covariance into mB,x1,c covariance.

compute_salt_fit_error(fit_model, cov, band, time_th, zp)

Compute fit error on flux from sncosmo fit covariance x0,x1,c.

snsim.salt_utils.n21_x1_model(z, seed=None)[source]

X1 distribution redshift dependant model from Nicolas et al. 2021.

Parameters:
  • z (numpy.array(float)) – Redshift(s) of the SN.

  • seed (int, opt) – Random seed.

Returns:

X1 – Stretch parameters of supernovae.

Return type:

numpy.array(float)

snsim.salt_utils.x1_mass_model(host_mass, seed=None)[source]
snsim.salt_utils.n21_x1_mass_model(z, host_mass=None, seed=None)[source]
snsim.salt_utils.cov_x0_to_mb(x0, cov)[source]

Convert x0,x1,c covariance into mB,x1,c covariance.

Parameters:
  • x0 (float) – SALT x0 parameter.

  • cov (numpy.array(float, size = (3,3))) – SALT x0, x1, c covariance matrix

Returns:

SALT mb, x1, c covariance matrix.

Return type:

numpy.array(float, size = (3,3))

snsim.salt_utils.compute_salt_fit_error(fit_model, cov, band, time_th, zp, magsys='ab')[source]

Compute fit error on flux from sncosmo fit covariance x0,x1,c.

Parameters:
  • fit_model (sncosmo.Model) – The model used to fit the sn lightcurve.

  • cov (numpy.ndarray(float, size=(3,3))) – sncosmo x0,x1,c covariance matrix from SALT fit.

  • band (str) – The band in which the error is computed.

  • time_th (numpy.ndarray(float)) – Time for which compute the flux error.

  • zp (float) – zeropoint to scale the error.

  • magsys (str) – Magnitude system to use.

Returns:

Flux error for each input time.

Return type:

numpy.ndarray(float)

Notes

Compute theorical fluxerr from fit \(err = \sqrt{COV}\) where \(COV = J^T COV(x0,x1,c) J\) with \(J = (dF/dx0, dF/dx1, dF/dc)\) the jacobian.

\[F_{norm} = \frac{x_0}{1+z} \int_\lambda \left(M_0(\lambda_s, p) + x_1 M_1(\lambda_s, p)\right)\ 10^{-0.4cCL(\lambda_s)}T_b(\lambda) \frac{\lambda}{hc} d\lambda \times \text{NF}\]

where the Norm Factor is \(\text{NF} = 10^{0.4(ZP_{norm} -ZP_{magsys})}\).

We found :

\[\frac{dF}{dx_0} = \frac{F}{x_0}\]
\[\frac{dF}{dx_1} = \frac{x_0}{1+z} \int_\lambda M_1(\lambda_s, p) * 10^{-0.4cCL(\lambda_s)}\ T_b(\lambda)\frac{\lambda}{hc} d\lambda \times \text{NF}\]
\[\frac{dF}{dc} = -\frac{\ln(10)}{2.5}\frac{x_0}{1+z} \int_\lambda \left(M_0(\lambda_s, p) + x_1 M_1(\lambda_s, p)\right)\ CL(\lambda_s)10^{-0.4 c CL(\lambda_s)}T_b(\lambda) \frac{\lambda}{hc} d\lambda \times \text{NF}\]