effects.scatter#

This module provides intrinsic color scatter models implemented as propagation effects.

skysurvey.effects.scatter.sine_interp(x_new, fun_x, fun_y)[source]#

Sinus interpolation for intrinsic scattering models.

Parameters:
  • x_new (array) – new x values.

  • fun_x (array) – x values of the function to interpolate.

  • fun_y (array) – y values of the function to interpolate.

Returns:

interpolated values.

Return type:

array

class skysurvey.effects.scatter.ColorScatter_G10(saltsource)[source]#

Bases: PropagationEffect

Guy (2010) SNe Ia non-coherent scattering.

Implementation is done following arxiv:1209.2482.

Parameters:

saltsource (sncosmo.Source) – salt source to use.

classmethod from_saltsource(name='salt2', version=None)[source]#

Shortcut to directly load the color scatter from the salt2 source.

Parameters:
  • name (str) – name of the salt source.

  • version (str) – version of the salt source.

Return type:

ColorScatter_G10

compute_sigma_nodes(rng=None)[source]#

Computes the sigma nodes.

Parameters:

rng (None, int, (Bit)Generator, optional) – seed for the random number generator. (doc adapted from numpy’s np.random.default_rng docstring. See that documentation for details.) If None, an unpredictable entropy will be pulled from the OS. If an int, (>0), it will set the initial BitGenerator state. If a (Bit)Generator, it will be returned as a Generator unaltered.

Returns:

lambda nodes, sigma values

Return type:

(array, array)

propagate(wave, flux)[source]#

Propagate the effect to the flux.

Parameters:
  • wave (array) – wavelengths.

  • flux (array) – fluxes.

Returns:

propagated fluxes.

Return type:

array

class skysurvey.effects.scatter.ColorScatter_C11[source]#

Bases: PropagationEffect

C11 scattering effect for sncosmo.

Use covariance matrix between the vUBVRI bands from N. Chotard thesis.

Implementation is done following arxiv:1209.2482.

propagate(wave, flux, rng=None)[source]#

Propagate the effect to the flux.

Parameters:
  • wave (array) – wavelengths.

  • flux (array) – fluxes.

  • rng (None, int, (Bit)Generator, optional) – seed for the random number generator. (doc adapted from numpy’s np.random.default_rng docstring. See that documentation for details.) If None, an unpredictable entropy will be pulled from the OS. If an int, (>0), it will set the initial BitGenerator state. If a (Bit)Generator, it will be returned as a Generator unaltered.

Returns:

propagated fluxes.

Return type:

array