uvex_transients.models.core.lightcurve_metrics#

Reduce sampled light curves to numbers: a peak, and the time to decline from it.

The functions here work on arrays, a time grid t of shape (T,) and the luminosities L of N draws on it, shape (N, T), from whatever source: an SED evaluated over parameter draws (see ~uvex_transients.models.core.base.SpectralModel.eval_band_luminosity), a bolometric curve, or data. They know nothing about SEDs or bands.

The helpers at the end, first_true_index and crossing_coordinate, are the shared core of finding where a curve first crosses a level and interpolating the crossing between two samples. The detection-horizon calculation uses them too, to find the redshift at which a population’s peak magnitude crosses a limit.

Functions

crossing_coordinate(x_before, x_after, ...)

Interpolate, linearly, where a curve reaches a level between two samples.

decline_time(t, luminosity[, fraction])

Measure the time from the peak until the luminosity first falls to a fraction of it.

first_true_index(condition)

Find the first sample of each row at which a condition holds.

peak_luminosity(t, luminosity)

Reduce each light curve to its peak.

resolve_time_grid(t_rest, t_min, t_max, n_time)

Turn the user's time-grid arguments into rest-frame times in seconds.