r"""Composite tidal disruption event SED, following the Van Velzen et al. (2021) ZTF sample."""
from typing import ClassVar
import numpy as np
from astropy import units as u
from uvex_transients.models.core.base import ComposedSpectralModel
from uvex_transients.models.core.parameters import Parameter
from uvex_transients.models.core.priors import NormalPrior, PowerLawPrior
from uvex_transients.models.lightcurves.generic import GREDLightcurve
from uvex_transients.models.spectra.thermal import BlackbodySpectrum
__all__ = ["VanVelzenTDESED"]
[docs]
class VanVelzenTDESED(ComposedSpectralModel):
r"""
A constant-temperature blackbody modulated by a Gaussian-rise, exponential-decay light curve.
.. math::
L_\nu(\nu, t) = L_0 \cdot \ell(t) \cdot \frac{\pi B_\nu(\nu, T)}{\sigma_\mathrm{SB} T^4},
where
.. math::
\ell(t) = \begin{cases}
\exp\left[-\dfrac{(t-t_\mathrm{peak})^2}{2\sigma^2}\right] & t < t_\mathrm{peak} \\[6pt]
\exp\left[-\dfrac{t-t_\mathrm{peak}}{\tau}\right] & t \ge t_\mathrm{peak}
\end{cases}
with :math:`t_\mathrm{peak} = 5\sigma` (:class:`~uvex_transients.models.lightcurves.generic.GREDLightcurve`'s
own convention -- the rise is always exactly 5 Gaussian widths long, not a
separate free parameter). This is a fairly typical parameterization for a
TDE SED :footcite:p:`2021ApJ...908....4V`: a constant-temperature
blackbody photosphere (the :math:`\pi B_\nu(\nu, T)/(\sigma_\mathrm{SB}
T^4)` factor is exactly :class:`~uvex_transients.models.spectra.thermal.BlackbodySpectrum`'s
normalized shape, :math:`\int_0^\infty S(\nu, T)\,d\nu = 1`), so
:math:`L_0` here is literally :math:`L_\mathrm{bol}(t_\mathrm{peak})`.
Composed from :class:`~uvex_transients.models.lightcurves.generic.GREDLightcurve`
(already bolometric -- :math:`L_0 \cdot \ell(t)`) and
:class:`~uvex_transients.models.spectra.thermal.BlackbodySpectrum`; see
:class:`~uvex_transients.models.core.base.ComposedSpectralModel` for how the two
are combined.
The default priors for :math:`\sigma` and :math:`\tau` are informed by the log-normal fits to the
ZTF TDE sample reported by :footcite:t:`2021ApJ...908....4V` (their Section 4.1 / Table 4),
though the values below have since been hand-tuned away from those exact fits and are not
currently a literal reproduction of them. The :math:`T` prior is likewise log-normal, with its mean
and scatter matched to :math:`\log_{10} T` for the 33 TDEs of :footcite:t:`yao2023`. Each of these
is parameterized here via a base-10 log transform on a
:class:`~uvex_transients.models.core.priors.NormalPrior`. The :math:`L_0` prior is instead the
blackbody luminosity function of :footcite:t:`yao2023`, a power law above
:math:`10^{43}\ \mathrm{erg\,s^{-1}}`, normalized explicitly to unit area (see the table below).
.. rubric:: Parameters
The model parameters are summarized below.
.. list-table::
:header-rows: 1
:widths: 18 18 64
* - Parameter
- Symbol
- Description
* - ``amplitude``
- :math:`L_0`
- Peak bolometric luminosity, :math:`L_0 = L_\mathrm{bol}(t_\mathrm{peak})`.
:math:`p(L_0) \propto L_0^{-2.41}` for :math:`L_0 \ge 10^{43}\ \mathrm{erg\,s^{-1}}`
(unbounded above), i.e. :math:`dN/d\log L_0 \propto L_0^{-1.41}`
:footcite:p:`yao2023`, normalized explicitly to unit area.
* - ``sigma_rise``
- :math:`\sigma`
- Gaussian width of the pre-peak rise.
:math:`\log_{10}(\sigma/\mathrm{d}) \sim \mathcal{N}(0.91, 0.25^2)`.
* - ``tau_decline``
- :math:`\tau`
- Exponential decline timescale after peak.
:math:`\log_{10}(\tau/\mathrm{d}) \sim \mathcal{N}(1.7, 0.2^2)`.
* - ``temperature``
- :math:`T`
- Photospheric blackbody temperature.
:math:`\log_{10}(T/\mathrm{K}) \sim \mathcal{N}(4.3, 0.15^2)`.
References
----------
.. footbibliography::
"""
_LIGHTCURVE_CLASS = GREDLightcurve
_SPECTRUM_CLASS = BlackbodySpectrum
_DEFAULT_PARAMETERS: ClassVar[dict[str, Parameter]] = {
# Yao et al. 2023 luminosity function: dN/dlogL ~ L^-1.41 above 1e43 erg/s. Per unit L that is
# a power law of index 1.41 + 1 = 2.41. No transform: the latent variable is L itself.
"amplitude": Parameter(
prior=PowerLawPrior(alpha=2.41, lower=1.0e43, upper=np.inf),
scale=1.0 * u.erg / u.s,
description="Peak bolometric luminosity, L_0 = L_bol(t_peak). p(L_0) ~ L_0^-2.41 for L_0 >= 1e43 erg/s.",
latex=r"L_0",
),
"temperature": Parameter(
prior=NormalPrior(mean=4.3, sigma=0.15),
scale=1.0 * u.K,
transform="log10",
description="Photospheric blackbody temperature. log10(T/K) ~ N(4.3, 0.15^2).",
latex=r"T",
),
"sigma_rise": Parameter(
prior=NormalPrior(mean=0.91, sigma=0.25),
scale=1.0 * u.day,
transform="log10",
description="Gaussian width of the pre-peak rise. log10(sigma/day) ~ N(0.91, 0.25^2).",
latex=r"\sigma",
),
"tau_decline": Parameter(
prior=NormalPrior(mean=1.7, sigma=0.2),
scale=1.0 * u.day,
transform="log10",
description="Exponential decline timescale after peak. log10(tau/day) ~ N(1.7, 0.2^2).",
latex=r"\tau",
),
}