simulate_snia
Attributes
Functions
|
Create a SNIA source/host pair with characteristics from an OpSim. |
|
Load the passband from files and register with sncosmo. |
|
Process a single random SN realization. |
|
Test that we can sample and create SN Ia simulation using the salt3 model. |
Module Contents
- construct_snia_source(oversampled_observations, zpdf)[source]
Create a SNIA source/host pair with characteristics from an OpSim.
- load_and_register_passband(passbands_dir, to_use)[source]
Load the passband from files and register with sncosmo.
- Parameters:
passbands_dir (str) – The directory containing the passband files to use.
to_use (list) – A list of the passbands to use. Example: [“g”, “r”]
- Returns:
passbands – The loaded and processed PassbandGroup.
- Return type:
- draw_single_random_sn(source, opsim, passbands, state=None, rng_info=None)[source]
Process a single random SN realization.
- Parameters:
source (BasePhysicalModel) – The BasePhysicalModel to use for the flux computation.
opsim (OpSim) – The OpSim for the simulations
passbands (PassbandGroup) – The passbands to use in generating the observations.
state (GraphState) – The sample values to use. If None resamples the state.
rng_info (numpy.random._generator.Generator, optional) – A given numpy random number generator to use for this computation. If not provided, the function uses the default random number generator.
- Returns:
res – A dictionary of useful information about the run.
- Return type:
dict
- run_snia_end2end(oversampled_observations, passbands_dir, solid_angle=0.0001, nsample=1, check_sncosmo=False, rng_info=None)[source]
Test that we can sample and create SN Ia simulation using the salt3 model.
- Parameters:
oversampled_observations (OpSim) – The opsim data to use.
passbands_dir (str) – The name of the directory holding the passband information.
solid_angle (float) – Solid angle for calculating number of SN.
nsample (int) – The number of samples to test. Default: 1
check_sncosmo (bool) – Run the simulation a second time directly with sncosmo and compare the answers. This should only be turned on for testing. Default: False
rng_info (numpy.random._generator.Generator, optional) – A given numpy random number generator to use for this computation. If not provided, the function uses the default random number generator.
- Returns:
res_list (dict) – A dictionary of lists of sampling and result information.
passbands (PassbandGroup) – The passbands used.