sncosmo.realize_lcs

sncosmo.realize_lcs(observations, model, params, thresh=None, trim_observations=False, scatter=True)[source]

Realize data for a set of SNe given a set of observations.

Parameters:
observationsTable or ndarray

Table of observations. Must contain the following column names: band, time, zp, zpsys, gain, skynoise.

modelsncosmo.Model

The model to use in the simulation.

paramslist (or generator) of dict

List of parameters to feed to the model for realizing each light curve.

threshfloat, optional

If given, light curves are skipped (not returned) if none of the data points have signal-to-noise greater than thresh.

trim_observationsbool, optional

If True, only observations with times between model.mintime() and model.maxtime() are included in result table for each SN. Default is False.

scatterbool, optional

If True, the flux value of the realized data is calculated by adding a random number drawn from a Normal Distribution with a standard deviation equal to the fluxerror of the observation to the bandflux value of the observation calculated from model. Default is True.

Returns:
snelist of Table

Table of realized data for each item in params.

Notes

skynoise is the image background contribution to the flux measurement error (in units corresponding to the specified zeropoint and zeropoint system). To get the error on a given measurement, skynoise is added in quadrature to the photon noise from the source.

It is left up to the user to calculate skynoise as they see fit as the details depend on how photometry is done and possibly how the PSF is is modeled. As a simple example, assuming a Gaussian PSF, and perfect PSF photometry, skynoise would be 4 * pi * sigma_PSF * sigma_pixel where sigma_PSF is the standard deviation of the PSF in pixels and sigma_pixel is the background noise in a single pixel in counts.