snsim.astrobj

Contains transients models.

Classes

AstrObj

Basic class for transients.

SNIa

SNIa class. Inherit from AstrObj.

TimeSeries

TimeSeries class.

SNII

SNII class. Inherit from TimeSeries.

SNIIpl

SNII P/L class. Inherit from TimeSeries.

SNIIb

SNIIb class. Inherit from TimeSeries.

SNIIn

SNIIn class. Inherit from TimeSeries.

SNIbc

SNIb/c class. Inherit from TimeSeries.

SNIc

SNIIn class. Inherit from TimeSeries.

SNIb

SNIIn class. Inherit from TimeSeries.

SNIc_BL

SNIIn class. Inherit from TimeSeries.

SNIax

SNiax class.

SNIa91bg

SNia91bg class.

Module Contents

class snsim.astrobj.AstrObj(sim_par, mag_fun=None, effects=None)[source]

Bases: abc.ABC

Basic class for transients.

Init AstrObj class.

Parameters:
  • sim_par (dict) –

    Simulation parameters.

    sim_par
    ├── zcos, cosmological redshift
    ├── zpcmb, CMB dipole redshift contribution
    ├── como_dist, comoving distance of the obj
    ├── vpec, obj peculiar velocity
    ├── ra, obj Right Ascension
    ├── dec, obj Declinaison
    ├── t0, obj peak time
    └── sncosmo par

  • mag_fun (str, optional) – The function used to compute the abs mag, by default None

  • effects (list, optional) –

    sncosmo effects dic, by default None

    effect
    ├── source: sncosmo.effect, sncosmo effect obj
    ├── frame: str ‘obs’ or ‘rest’
    └── name: str, effect name

gen_flux(obs, mod_fcov=False, seed=None)[source]

Generate the flux for given obs.

Parameters:
  • obs (pd.DataFrame) – Observations info.

  • mod_fcov (bool, optional) – Either or not using model scattering, by default False

  • seed (numpy.random.SeedSequence, optional) – numpy random seed, by default None

Returns:

Flux of the AstrObj for given obs.

Return type:

pd.DataFrane

Raises:

ValueError – Raises if mod_fcov is not available for the used model

mag_restframeband_to_amp(mag, band, magsys, amp_param_name='x0')[source]

Get the amplitude correcponding to a rest-frame band magnitude.

Parameters:
  • mag (float) – magnitude

  • band (str) – band used to get the magnitude

  • magsys (str) – magnitude system used

  • amp_param_name (str, optional) – the name of the amplitude parameter for the model, by default ‘x0’

Returns:

The amplitude prameter corresponding to the given mag.

Return type:

float

property source
property zpec

Get peculiar velocity redshift.

property zCMB

Get CMB frame redshift.

property zobs

Get observed redshift.

property mu

Get distance moduli.

property sim_model
property sim_par
class snsim.astrobj.SNIa(sim_par, mag_fun=None, effects=None)[source]

Bases: AstrObj

SNIa class. Inherit from AstrObj.

Init AstrObj class.

Parameters:
  • sim_par (dict) –

    Simulation parameters.

    sim_par
    ├── zcos, cosmological redshift
    ├── zpcmb, CMB dipole redshift contribution
    ├── como_dist, comoving distance of the obj
    ├── vpec, obj peculiar velocity
    ├── ra, obj Right Ascension
    ├── dec, obj Declinaison
    ├── t0, obj peak time
    └── sncosmo par

  • mag_fun (str, optional) – The function used to compute the abs mag, by default None

  • effects (list, optional) –

    sncosmo effects dic, by default None

    effect
    ├── source: sncosmo.effect, sncosmo effect obj
    ├── frame: str ‘obs’ or ‘rest’
    └── name: str, effect name

static SALTTripp(M0, alpha, beta, x1, c, coh_sct)[source]
class snsim.astrobj.TimeSeries(sim_par, mag_fun=None, effects=None)[source]

Bases: AstrObj

TimeSeries class.

Init AstrObj class.

Parameters:
  • sim_par (dict) –

    Simulation parameters.

    sim_par
    ├── zcos, cosmological redshift
    ├── zpcmb, CMB dipole redshift contribution
    ├── como_dist, comoving distance of the obj
    ├── vpec, obj peculiar velocity
    ├── ra, obj Right Ascension
    ├── dec, obj Declinaison
    ├── t0, obj peak time
    └── sncosmo par

  • mag_fun (str, optional) – The function used to compute the abs mag, by default None

  • effects (list, optional) –

    sncosmo effects dic, by default None

    effect
    ├── source: sncosmo.effect, sncosmo effect obj
    ├── frame: str ‘obs’ or ‘rest’
    └── name: str, effect name

class snsim.astrobj.SNII(sim_par, mag_fun=None, effects=None)[source]

Bases: TimeSeries

SNII class. Inherit from TimeSeries.

Init AstrObj class.

Parameters:
  • sim_par (dict) –

    Simulation parameters.

    sim_par
    ├── zcos, cosmological redshift
    ├── zpcmb, CMB dipole redshift contribution
    ├── como_dist, comoving distance of the obj
    ├── vpec, obj peculiar velocity
    ├── ra, obj Right Ascension
    ├── dec, obj Declinaison
    ├── t0, obj peak time
    └── sncosmo par

  • mag_fun (str, optional) – The function used to compute the abs mag, by default None

  • effects (list, optional) –

    sncosmo effects dic, by default None

    effect
    ├── source: sncosmo.effect, sncosmo effect obj
    ├── frame: str ‘obs’ or ‘rest’
    └── name: str, effect name

class snsim.astrobj.SNIIpl(sim_par, mag_fun=None, effects=None)[source]

Bases: TimeSeries

SNII P/L class. Inherit from TimeSeries.

Init AstrObj class.

Parameters:
  • sim_par (dict) –

    Simulation parameters.

    sim_par
    ├── zcos, cosmological redshift
    ├── zpcmb, CMB dipole redshift contribution
    ├── como_dist, comoving distance of the obj
    ├── vpec, obj peculiar velocity
    ├── ra, obj Right Ascension
    ├── dec, obj Declinaison
    ├── t0, obj peak time
    └── sncosmo par

  • mag_fun (str, optional) – The function used to compute the abs mag, by default None

  • effects (list, optional) –

    sncosmo effects dic, by default None

    effect
    ├── source: sncosmo.effect, sncosmo effect obj
    ├── frame: str ‘obs’ or ‘rest’
    └── name: str, effect name

class snsim.astrobj.SNIIb(sim_par, mag_fun=None, effects=None)[source]

Bases: TimeSeries

SNIIb class. Inherit from TimeSeries.

Init AstrObj class.

Parameters:
  • sim_par (dict) –

    Simulation parameters.

    sim_par
    ├── zcos, cosmological redshift
    ├── zpcmb, CMB dipole redshift contribution
    ├── como_dist, comoving distance of the obj
    ├── vpec, obj peculiar velocity
    ├── ra, obj Right Ascension
    ├── dec, obj Declinaison
    ├── t0, obj peak time
    └── sncosmo par

  • mag_fun (str, optional) – The function used to compute the abs mag, by default None

  • effects (list, optional) –

    sncosmo effects dic, by default None

    effect
    ├── source: sncosmo.effect, sncosmo effect obj
    ├── frame: str ‘obs’ or ‘rest’
    └── name: str, effect name

class snsim.astrobj.SNIIn(sim_par, mag_fun=None, effects=None)[source]

Bases: TimeSeries

SNIIn class. Inherit from TimeSeries.

Init AstrObj class.

Parameters:
  • sim_par (dict) –

    Simulation parameters.

    sim_par
    ├── zcos, cosmological redshift
    ├── zpcmb, CMB dipole redshift contribution
    ├── como_dist, comoving distance of the obj
    ├── vpec, obj peculiar velocity
    ├── ra, obj Right Ascension
    ├── dec, obj Declinaison
    ├── t0, obj peak time
    └── sncosmo par

  • mag_fun (str, optional) – The function used to compute the abs mag, by default None

  • effects (list, optional) –

    sncosmo effects dic, by default None

    effect
    ├── source: sncosmo.effect, sncosmo effect obj
    ├── frame: str ‘obs’ or ‘rest’
    └── name: str, effect name

class snsim.astrobj.SNIbc(sim_par, mag_fun=None, effects=None)[source]

Bases: TimeSeries

SNIb/c class. Inherit from TimeSeries.

Init AstrObj class.

Parameters:
  • sim_par (dict) –

    Simulation parameters.

    sim_par
    ├── zcos, cosmological redshift
    ├── zpcmb, CMB dipole redshift contribution
    ├── como_dist, comoving distance of the obj
    ├── vpec, obj peculiar velocity
    ├── ra, obj Right Ascension
    ├── dec, obj Declinaison
    ├── t0, obj peak time
    └── sncosmo par

  • mag_fun (str, optional) – The function used to compute the abs mag, by default None

  • effects (list, optional) –

    sncosmo effects dic, by default None

    effect
    ├── source: sncosmo.effect, sncosmo effect obj
    ├── frame: str ‘obs’ or ‘rest’
    └── name: str, effect name

class snsim.astrobj.SNIc(sim_par, mag_fun=None, effects=None)[source]

Bases: TimeSeries

SNIIn class. Inherit from TimeSeries.

Init AstrObj class.

Parameters:
  • sim_par (dict) –

    Simulation parameters.

    sim_par
    ├── zcos, cosmological redshift
    ├── zpcmb, CMB dipole redshift contribution
    ├── como_dist, comoving distance of the obj
    ├── vpec, obj peculiar velocity
    ├── ra, obj Right Ascension
    ├── dec, obj Declinaison
    ├── t0, obj peak time
    └── sncosmo par

  • mag_fun (str, optional) – The function used to compute the abs mag, by default None

  • effects (list, optional) –

    sncosmo effects dic, by default None

    effect
    ├── source: sncosmo.effect, sncosmo effect obj
    ├── frame: str ‘obs’ or ‘rest’
    └── name: str, effect name

class snsim.astrobj.SNIb(sim_par, mag_fun=None, effects=None)[source]

Bases: TimeSeries

SNIIn class. Inherit from TimeSeries.

Init AstrObj class.

Parameters:
  • sim_par (dict) –

    Simulation parameters.

    sim_par
    ├── zcos, cosmological redshift
    ├── zpcmb, CMB dipole redshift contribution
    ├── como_dist, comoving distance of the obj
    ├── vpec, obj peculiar velocity
    ├── ra, obj Right Ascension
    ├── dec, obj Declinaison
    ├── t0, obj peak time
    └── sncosmo par

  • mag_fun (str, optional) – The function used to compute the abs mag, by default None

  • effects (list, optional) –

    sncosmo effects dic, by default None

    effect
    ├── source: sncosmo.effect, sncosmo effect obj
    ├── frame: str ‘obs’ or ‘rest’
    └── name: str, effect name

class snsim.astrobj.SNIc_BL(sim_par, mag_fun=None, effects=None)[source]

Bases: TimeSeries

SNIIn class. Inherit from TimeSeries.

Init AstrObj class.

Parameters:
  • sim_par (dict) –

    Simulation parameters.

    sim_par
    ├── zcos, cosmological redshift
    ├── zpcmb, CMB dipole redshift contribution
    ├── como_dist, comoving distance of the obj
    ├── vpec, obj peculiar velocity
    ├── ra, obj Right Ascension
    ├── dec, obj Declinaison
    ├── t0, obj peak time
    └── sncosmo par

  • mag_fun (str, optional) – The function used to compute the abs mag, by default None

  • effects (list, optional) –

    sncosmo effects dic, by default None

    effect
    ├── source: sncosmo.effect, sncosmo effect obj
    ├── frame: str ‘obs’ or ‘rest’
    └── name: str, effect name

class snsim.astrobj.SNIax(sim_par, mag_fun=None, effects=None)[source]

Bases: AstrObj

SNiax class.

Parameters:
  • sn_par (dict) –

    Parameters of the object.

    same as BasicAstrObj parameters
    └── mag_sct, coherent mag scattering.

  • sim_model (sncosmo.Model) – sncosmo Model to use.

  • model_par (dict) –

    General model parameters.

    same as BasicAstrObj model_par
    └── used model parameters

  • class. (Init AstrObj)

:param| sim_par
├── zcos, cosmological redshift
├── zpcmb, CMB dipole redshift contribution
├── como_dist, comoving distance of the obj
├── vpec, obj peculiar velocity
├── ra, obj Right Ascension
├── dec, obj Declinaison
├── t0, obj peak time
└── sncosmo par

:type : param sim_par: Simulation parameters. :param : :type : type sim_par: dict :param : :type : param mag_fun: The function used to compute the abs mag, by default None :param : :type : type mag_fun: str, optional :param : | effect

├── source: sncosmo.effect, sncosmo effect obj
├── frame: str ‘obs’ or ‘rest’
└── name: str, effect name

:type : param effects: sncosmo effects dic, by default None :param : :type : type effects: list, optional

class snsim.astrobj.SNIa91bg(sim_par, mag_fun=None, effects=None)[source]

Bases: AstrObj

SNia91bg class.

Parameters:
  • sn_par (dict) –

    Parameters of the object.

    same as BasicAstrObj parameters
    └── mag_sct, coherent mag scattering.

  • sim_model (sncosmo.Model) – sncosmo Model to use.

  • model_par (dict) –

    General model parameters.

    same as BasicAstrObj model_par
    ├── M0, absolute magnitude
    ├── sigM, sigma of coherent scattering
    └── used model parameters

  • class. (Init AstrObj)

:param| sim_par
├── zcos, cosmological redshift
├── zpcmb, CMB dipole redshift contribution
├── como_dist, comoving distance of the obj
├── vpec, obj peculiar velocity
├── ra, obj Right Ascension
├── dec, obj Declinaison
├── t0, obj peak time
└── sncosmo par

:type : param sim_par: Simulation parameters. :param : :type : type sim_par: dict :param : :type : param mag_fun: The function used to compute the abs mag, by default None :param : :type : type mag_fun: str, optional :param : | effect

├── source: sncosmo.effect, sncosmo effect obj
├── frame: str ‘obs’ or ‘rest’
└── name: str, effect name

:type : param effects: sncosmo effects dic, by default None :param : :type : type effects: list, optional