snsim.tests.test_generators

Attributes

Classes

FakeGen

Abstract class for basic astrobj generator.

TestGenerators

Module Contents

snsim.tests.test_generators.FlatSource
class snsim.tests.test_generators.FakeGen(params, cosmology, time_range, z_range=None, vpec_dist=None, hosts=None, mw_dust=None, cmb=None, geometry=None)

Bases: snsim.generators.BaseGen

Abstract class for basic astrobj generator.

Init BaseGen class.

Parameters:
  • params (dict) – Basic generator configuration.

  • cosmology (astropy.cosmology) – The cosmological model to use.

  • time_range (tuple) – (tmin, tmax) time range.

  • z_range (tuple, optional) – (zmin, zmax) redshift range, no need to be defined if there is hosts, by default None

  • vpec_dist (dic, optional) –

    PV distrib parameters, by default None

    vpec_dist
    ├── mean_vpec, by default 0.
    └── sig_vpec, by default 0.

  • hosts (snsim.SnHost, optional) – hosts for simulated SN, by default None

  • mw_dust (dic, optional) – Milky Way dust, by default None

  • cmb (dic, optional) –

    CMB dipole parameters, by default None

    cmb
    ├── v_cmb, by default 369.82 km/s
    ├── l_cmb, by default 264.021 deg
    └── b_cmb, by default 48.253 deg

  • geometry (shapely.geometry, optional) – The survey footprint, by default None

Raises:
  • ValueError – If you set PV dist and hosts at the same time.

  • ValueError – If you neither set PV or hosts.

  • ValueError – If no hosts and no z_range.

gen_par(n_obj, basic_par, seed=None)

Abstract method to add random generated parameters specific to the astro object used, called in __call__

Parameters:
class snsim.tests.test_generators.TestGenerators
setup_class()
test_rate()
test_zcdf()