src.superphot_plus.data_generation.make_fake_spp_data

Module Contents

Functions

trunc_gauss(quantile, clip_a, clip_b, mean, std)

Truncated Gaussian distribution.

create_prior(cube[, priors])

Creates prior for dynesty, where each side of the "cube"

ztf_noise_model(mag, band[, snr_range_g, snr_range_r])

A very, very simple noise model which assumes the dimmest magnitude is at SNR = 1,

create_clean_models(nmodels[, num_times, priors])

Generate 'clean' (noiseless) models from the prior

create_ztf_model([plot])

Generate realisitic-ish ZTF light curves from the Superphot+ prior.

Attributes

DEFAULT_MAX_FLUX

DEFAULT_MAX_FLUX = 1.0[source]
trunc_gauss(quantile, clip_a, clip_b, mean, std)[source]

Truncated Gaussian distribution.

Parameters:
  • quantile (float) – The quantile at which to evaluate the ppf. Should be a value between 0 and 1.

  • clip_a (float) – Lower clip value.

  • clip_b (float) – Upper clip value.

  • mean (float) – Mean of the distribution.

  • std (float) – Standard deviation of the distribution.

Returns:

Percent point function of the truncated Gaussian.

Return type:

scipy.stats.truncnorm.ppf

create_prior(cube, priors=Survey.ZTF().priors)[source]

Creates prior for dynesty, where each side of the “cube” is a value sampled between 0 and 1 representing each parameter. Slightly altered from ztf_transient_fit.py

Parameters:

cube (np.ndarray) – Array of parameters.

Returns:

Updated array of parameters.

Return type:

np.ndarray

ztf_noise_model(mag, band, snr_range_g=None, snr_range_r=None)[source]

A very, very simple noise model which assumes the dimmest magnitude is at SNR = 1, and the brightest mag is at SNR = 10.

Parameters:
  • mag (np.ndarray) – Observed magnitudes.

  • band (np.ndarray) – Observed bands (g or r).

  • snr_range_g (tuple) – Range of signal-to-noise ratios desired in g-band. Defaults to [1, 10]

  • snr_range_r (tuple) – Range of signal-to-noise ratios desired in r-band. Defaults to [1, 10]

Returns:

snr – Signal-to-noise ratios (SNR) of the observations.

Return type:

np.ndarray

create_clean_models(nmodels, num_times=100, priors=Survey.ZTF().priors)[source]

Generate ‘clean’ (noiseless) models from the prior

Parameters:
  • nmodels (int) – The number of models you want to generate.

  • num_times (int, optional) – The number of timesteps to use. Default = 100

  • bands (list, optional) – The ordered list of bands to use. Default = [‘r’, ‘g’]

  • ref_band (str, optional) – The reference band. Default = ‘r’

Returns:

  • params (array-like of numpy arrays) – The array of parameters used to generate each model.

  • lcs (array-like of numpy arrays) – The array of individual light curves for each model generated.

create_ztf_model(plot=False)[source]

Generate realisitic-ish ZTF light curves from the Superphot+ prior.

Parameters:

plot (bool) – Whether resulting light curve is plotted and saved. Defaults to False.

Returns:

  • params (np.ndarray) – Set of parameters used to generate model.

  • tdata (np.ndarray) – Time values of each datapoint.

  • filter_data (np.ndarray) – Filter corresponding to each datapoint.

  • dirty_model (np.ndarray) – Dirty flux values at each time value.

  • sigmas (np.ndarray) – Uncertainties of each dirty flux value.