redback.transient_models.phenomenological_models.exp_rise_powerlaw_decline
- redback.transient_models.phenomenological_models.exp_rise_powerlaw_decline(t, t0, m_peak, tau_rise, alpha, t_peak, **kwargs)[source]
Compute a smooth light-curve model (in magnitudes) with an exponential rise transitioning into a power-law decline, with a smooth (blended) peak. In all filters the shape is determined by the same t0, tau_rise, alpha, and t_peak; only m_peak differs from filter to filter.
For t < t0, the function returns np.nan. For t >= t0, the model is constructed as a blend of:
- Rising phase:
m_rise(t) = m_peak + 1.086 * ((t_peak - t) / tau_rise)
- Declining phase:
m_decline(t) = m_peak + 2.5 * alpha * log10((t - t0)/(t_peak - t0))
A smooth transition is achieved by the switching (weight) function:
weight(t) = 0.5 * [1 + tanh((t - t_peak)/delta)]
so that the final magnitude is:
m(t) = (1 - weight(t)) * m_rise(t) + weight(t) * m_decline(t)
At t = t_peak, weight = 0.5 and both m_rise and m_decline equal m_peak, ensuring a smooth peak.
- Parameters:
t (array_like) – 1D array of times (e.g., in modified Julian days) at which to evaluate the model.
t0 (float) – Start time of the transient event (e.g., explosion), in MJD.
m_peak (float or array_like) – Peak magnitude(s) at t = t_peak. If an array is provided, each element is taken to correspond to a different filter.
tau_rise (float) – Characteristic timescale (in days) for the exponential rise.
alpha (float) – Power-law decay index governing the decline.
t_peak (float) – Time (in MJD) at peak brightness (must satisfy t_peak > t0).
delta (float, optional) – Smoothing parameter (in days) controlling the width of the transition around t_peak. If not provided, defaults to 50% of (t_peak - t0).
- Returns:
m_model – If m_peak is an array (multiple filters), returns a 2D array of shape (n_times, n_filters); if m_peak is a scalar, returns a 1D array (with NaN for t < t0).
- Return type:
ndarray
Examples
Single filter:
>>> t = np.linspace(58990, 59050, 300) >>> model1 = exp_rise_powerlaw_decline(t, t0=59000, m_peak=17.0, tau_rise=3.0, ... alpha=1.5, t_peak=59010)
Multiple filters (e.g., g, r, i bands):
>>> t = np.linspace(58990, 59050, 300) >>> m_peaks = np.array([17.0, 17.5, 18.0]) >>> model_multi = exp_rise_powerlaw_decline(t, t0=59000, m_peak=m_peaks, tau_rise=3.0, ... alpha=1.5, t_peak=59010) >>> print(model_multi.shape) # Expected shape: (300, 3)