betaFeedback

WorksPhysics and Astronomy

A comprehensive simulation framework for multi-modal kilonova observations from all-sky surveys

Abstract

Current all-sky surveys such as Vera Rubin's Legacy Survey of Space and Time and the Zwicky Transient Facility (ZTF) promise a wealth of scientific gains that are contained in the millions of astrophysical transient candidates produced each night. Kilonovae, one such transient of interest, will be challenging to identify in the alert stream and will require efficient artificial intelligence models to parse the large, real-time influx of data. In order to build these large models, comprehensive multimodal datasets are necessary for training. Due to a lack of numerous kilonova observations, we propose kilonova-multimodal-emulator\texttt{kilonova-multimodal-emulator} – a simulation pipeline for realistic, multimodal kilonova observations comprised of photometry, spectra, and images. We demonstrate this pipeline for ZTF-type observations, based on historical cadence and limiting magnitude information from the Bright Transient Survey (BTS) and using the latest radiative transfer kilonova models to produce a comprehensive dataset meant for the training of large artificial intelligence model.

Introduction

The multi-messenger detection of the kilonova AT2017gfo ([96, 3] (Coulter et al. 2017)) and GRB GRB170817A ([3, 43, 92]), alongside gravitational-waves (GWs) from the binary neutron star (BNS) merger GW170817 ([4]) revealed these events as sites of rr-process nucleosynthesis via observation of heavy elements that power the kilonova emission ([64, 74, 54] (L.-X. Li & B. Paczynski 1998)). This discovery has led to great growth in the field of multi-messenger astronomy and scientific interest in additional observations. Kilonovae are short-lived astrophysical transients which may accompany neutron star mergers, specifically BNS or neutron star-black hole (NSBH) events. The joint detection of GW170817, AT2017gfo, and GRB170817A led to advances in nuclear astrophysics ([72, 96, 55, 54, 106]), cosmology ([4, 49, 29, 34, 26]), and tests of general relativity ([36, 16, 31]). Future observations promise additional advancements.

Kilonovae make challenging targets for observations, as they are short-lived and may be relatively faint. In addition, GW sky localizations for promising neutron star mergers can span large sky localizations, specifically on the order of ≈100−10,000\approx100 - 10{,}000 deg2^{2} ([90, 37, 38, 46, 107, 94, 95, 20, 35, 28, 61]). Alongside gravitational-wave follow-up, it is possible to identify kilonovae associated with sGRBs (N. R. Tanvir et al. 2013; S. Ascenzi et al. 2019; Z.-P. Jin et al. 2020), long GRBs [83, 104, 66], or serendipitously through survey operations [10, 7, 9]. In this work, we will focus on serendipitous survey observations.

There are numerous current and future telescopes that carry out wide-field surveys and participate in multi-messenger searches, such as the Panoramic Survey Telescope and Rapid Response System (Pan-STARRS) [75], Asteroid Terrestrial-impact Last Alert System (ATLAS) [103], the Zwicky Transient Facility (ZTF) [18, 45, 6], BlackGEM [23], Vera Rubin Observatory [51], the Nancy Grace Roman Space Telescope [11], ULTRASAT (Y. Shvartzvald et al. 2024), and Ultraviolet Explorer (UVEX) [63].

In the absence of abundant observational data for kilonovae, models are necessary to simulate numerous kilonova observations across the parameter space. To generate photometry, or light curves, we employ a pair of models: i) POSSIS, the time-dependent, three-dimensional Monte Carlo radiative transfer code [25] and ii) the Los Alamos National Laboratory (LANL) TP2 model, which is a two-component, axisymmetric kilonova model consisting of toroidal dynamical ejecta and a peanut-shaped wind component (R. T. Wollaeger et al. 2021). These models are used to produce a grid of simulated kilonova light curves across the parameter space, from which a machine learning surrogate model is trained. This model allows for the simulation of models for arbitrary parameter values, as well as speeds up the calculation of the light curves and reduces the computational cost of simulation. Images and spectroscopic data will be generated to accompany this photometric data, with images simulated using realistic Zwicky Transient Facility (ZTF) point-spread functions (PSFs).

There are existing efforts to create time-domain astronomy datasets for training AI models, such as the PLAsTiCC [102, 58] and ELAsTiCC [76] time-series classification challenges. The PLAsTiCC and ELAsTiCC datasets contain a wide variety of time-domain signals, including supernovae, kilonovae, TDEs, active galactic nuclei (AGN), and many more. Designed as classification challenges, these datasets simulate realistic Vera C. Rubin Legacy of Space and Time Survey (LSST) photometric observations of the many transients of interest. In comparison, our dataset will be multi-modal, composed of spectra, photometry, and images. In this paper we will focus on ZTF observations encompassing all three modalities, but we have future plans to include LSST observations. The other key difference is we generate observations of kilonovae only for the scope of this paper; but those models are easily replaceable with the models for your source class of choice. Our simulations are intended not for a classification challenge to separate diverse classes of astrophysical sources, but instead for training an analysis architecture capable of identification and parameter estimation of a specific source class: in this case, kilonovae.

With the LSST all-sky survey, Vera C. Rubin Observatory [51] is ushering in a new era of multi-messenger astronomy: one that will see millions of alerts a night. AI and data science tools will be imperative to sort through the overwhelming number of transients to identify rare science-rich targets such as kilonovae. These AI tools will need to be trained on comprehensive and robust datasets, which this work will provide.

We devise a framework for the simulation of realistic observations from all-sky surveys, such as those carried out by the ZTF. Specifically, we will simulate kilonova observations, but this pipeline can be used for generating mock datasets for other transient types as well by substituting the underlying models. Due to an abundance of real archival observations, we will focus on simulating ZTF data, but with informed cadence, limiting magnitude, and other survey specific distributions, analogous simulations of kilonovae that would be observed by Vera C. Rubin could be carried out. For a comprehensive set of possible kilonova parameters, we will generate spectra, light curves, and images for our simulated kilonovae. The rest of this section demonstrates how each of those three observations are simulated.

DATA GENERATION: SPECTRA

Spectroscopy carries information that the light curve alone does not. The time-dependent continuum shape, the strong color redistribution caused by line blanketing, and the wavelength dependence of host-galaxy contamination are all easier to represent in the spectral domain than through broadband fluxes alone. We generate a full observer-frame spectral sequence from the same kilonova SED family used below for the photometric simulations, evaluate that sequence at a sky position drawn from the host-associated galaxy pool used later for the image simulations, and, when desired, pass the result through a low-resolution instrument model. The spectroscopic layer is built in three stages: projection of the intrinsic kilonova SED to the observer frame, addition of the local host-galaxy spectrum at the selected position, and forward modeling through a spectrograph response.

Kilonova spectral sequence

We adopt the LANL spectral models presented by R. T. Wollaeger et al. (2021), computed with the Monte Carlo radiative-transfer code SuperNu ([111, 110]). The LANLTP2 library describes two-component, axisymmetric ejecta consisting of a lanthanide-rich toroidal dynamical component and a peanut-shaped wind with higher electron fraction, Ye=0.27Y_{\mathrm{e}} = 0.27. It samples the dynamical and wind masses, their characteristic expansion velocities, and the viewing direction. The same radiative-transfer family underlies the photometric simulations in the following section. The spectra and light curves therefore describe the same intrinsic emission at different levels of spectral resolution.

Spectral emulator

The LANLTP2 simulations sample a finite set of locations in a continuous physical parameter space. Repeating the Monte Carlo transport calculation for every synthetic event would make the construction of a large machine-learning dataset impractical. Fast surrogates for expensive spectral calculations have proved useful in several areas of astrophysics. In stellar and galaxy spectroscopy, the Starfish and Speculator frameworks compress synthetic spectral libraries into reduced representations and interpolate their coefficients with Gaussian processes or neural networks ([32, 8]). Neural networks have also reproduced spectra from the TARDIS supernova radiative-transfer code with percent-level accuracy and a reduction of several orders of magnitude in evaluation time (W. E. Kerzendorf et al. 2021).

Kilonova-specific studies have used conditional variational autoencoders to emulate radiative-transfer spectra ([71]), Gaussian-process and adaptive-learning methods for light-curve interpolation ([87]), and random forests to interpolate the time-dependent LANL spectra ([86]). Spectra generated with a kilonova surrogate have subsequently supported amortized parameter inference for AT2017gfo on timescales of seconds ([33]). These studies establish the practical value of treating the emergent spectrum as a structured function of the ejecta parameters. Our emulator combines a coordinate-conditioned nonlinear predictor, a wavelength-domain neural operator, and a reduced-order correction of the remaining errors. This construction retains the correlated evolution across wavelength, time, and viewing direction while providing the throughput required for population-scale data generation. A query to the emulator is specified by

x=(log⁡10MdM⊙,vdc,log⁡10MwM⊙,vwc,log⁡10trfday,μ),μ≡∣cos⁡ι∣.(1)\mathbf{x} = \left( \log_{10}\frac{M_{\mathrm{d}}}{M_{\odot}}, \frac{v_{\mathrm{d}}}{c}, \log_{10}\frac{M_{\mathrm{w}}}{M_{\odot}}, \frac{v_{\mathrm{w}}}{c}, \log_{10}\frac{t_{\mathrm{rf}}}{\mathrm{day}}, \mu\right), \qquad\mu\equiv\lvert\cos\iota\rvert. \tag*{(1)}

where the subscripts d and w denote the dynamical and wind ejecta components. Reflection symmetry about the equatorial plane allows the angular coordinate to be folded to 0≤μ≤10 \le\mu\le1. The logarithmic coordinates for mass and time accommodate the several orders of magnitude covered by the diffusion and expansion timescales. Before entering the neural network, each component of x\mathbf{x} is standardized to a dimensionless interval centered on zero. The training representation contains 66 rest-frame epochs from 0.125 to 34.90 days, 27 folded viewing directions, and 1024 logarithmically spaced wavelength bins from approximately 0.1 to 12.8 μm\mu\mathrm{m}.

We represent each simulated directional spectrum by its bolometric luminosity and a normalized distribution of energy over the wavelength bins. If fλ,jf_{\lambda,j} is the flux density in wavelength bin jj, with bin width Δλj\Delta\lambda_j, the spectral target is

pj=fλ,jΔλj∑kfλ,kΔλk,pj≥0,∑jpj=1.(2)p_j = \frac{f_{\lambda,j}\Delta\lambda_j}{\sum_k f_{\lambda,k}\Delta\lambda_k}, \qquad p_j \ge0, \qquad\sum_j p_j = 1. \tag*{(2)}

The network predicts a vector of logits z\mathbf{z} and a standardized value of ℓL=log⁡10Lbol\ell_L = \log_{10} L_{\mathrm{bol}}. A softmax transformation, p^j=exp⁡zj/∑kexp⁡zk\widehat{p}_j = \exp z_j / \sum_k \exp z_k, imposes positivity and unit normalization. The flux density at the reference distance is reconstructed through

f^λ,j,10 pc=10ℓ^L4π(10 pc)2p^jΔλj.(3)\widehat{f}_{\lambda,j,10\,\mathrm{pc}} = \frac{10^{\widehat{\ell}_L}}{4\pi(10\,\mathrm{pc})^2}\frac{\widehat{p}_j}{\Delta\lambda_j}. \tag*{(3)}

This representation gives the continuum shape and the overall luminosity separate numerical scales during optimization. Equation (3) restores their physical coupling at inference time and makes the wavelength integral of the reconstructed spectrum consistent with the predicted bolometric luminosity.

The first component of the emulator is a nonlinear predictor of z\mathbf{z} and ℓL\ell_L. It combines a wavelength-local branch with a global latent branch. Both branches use Fourier features of the normalized physical coordinates, which improve the representation of rapidly varying functions by low-dimensional coordinate networks ([99]). For a scalar coordinate ss, the feature map has the form

ΦK(s)=[s,{sin⁡(π2ks),cos⁡(π2ks)}k=0K−1].(4)\Phi_K(s) = \left[ s, \left\{ \sin(\pi2^k s), \cos(\pi2^k s) \right\}_{k=0}^{K-1} \right]. \tag*{(4)}

The local branch also embeds the logarithmic wavelength coordinate and propagates it through feature-wise linear modulation layers, following the general conditioning construction introduced by E. Perez et al. [81]. If c(x)c(\mathbf{x}) is the encoded physical condition and hj(l)\mathbf{h}^{(l)}_j is the hidden representation of wavelength bin jj, one layer applies

hj(l+1)=σ[Wlhj(l)⊙(1+0.1γl(c))+0.1βl(c)](5)\mathbf{h}^{(l+1)}_j = \sigma\left[\mathbf{W}_l\mathbf{h}^{(l)}_j \odot(1+0.1\boldsymbol{\gamma}_l(c)) + 0.1\boldsymbol{\beta}_l(c)\right] \tag*{(5)}

where σ\sigma is the SiLU activation and γl\boldsymbol{\gamma}_l and βl\boldsymbol{\beta}_l are learned functions of the ejecta parameters, time, and viewing direction. This branch resolves wavelength-dependent changes in the broad opacity structure. The global branch adopts a latent-query construction related to Perceiver IO (A. Jaegle et al. [52]). It converts the six physical inputs into parameter tokens, allows a set of learned latent vectors to attend to those tokens, and then uses the latent representation as the context for wavelength queries. It carries information between widely separated wavelength regions and represents the redistribution of energy across the full spectral energy distribution. Learned scalar gates combine the local and global spectral logits and combine their luminosity predictions for every physical query.

A conditioned spectral operator refines this initial prediction. The operator receives the standardized log probability and the logarithmic wavelength coordinate. Six residual blocks combine a dilated depthwise convolution with a global Fourier convolution. The Fourier contribution to one block can be written as

G(h)=F−1[WkF(h)k]k=0Kop−1(6)\mathcal{G}(\mathbf{h}) = \mathcal{F}^{-1}\left[\mathbf{W}_k\mathcal{F}(\mathbf{h})_k\right]_{k=0}^{K_{\rm op}-1} \tag*{(6)}

where F\mathcal{F} denotes the discrete Fourier transform along wavelength, Wk\mathbf{W}_k is a learned complex channel-mixing matrix, and the implementation retains Kop=48K_{\rm op}=48 modes. The dilated convolution responds to localized curvature and broad blended features. The Fourier term transmits corrections across the wavelength range. Feature-wise modulation by x\mathbf{x} conditions every operator block on the physical state of the ejecta.

The learned Fourier convolution follows the neural-operator strategy of representing nonlocal interactions through a truncated set of spectral modes ([62] (Z. Li et al. 2021)). This approach has produced accurate function-valued surrogates for a broad class of parameterized physical systems. Comparative studies also show that the relative performance of operator architectures depends on the geometry, noise level, characteristic scales, and evaluation metric of the problem ([98] (L. Lu et al. 2022)). We therefore retain the local dilated convolution together with the global Fourier pathway and assess the resulting spectra with separate luminosity, shape, multiscale, temporal, angular, and upper-tail diagnostics.

The neural predictor captures most of the spectral variation, and a reduced-order model is applied to its remaining errors. The combination of a proper orthogonal decomposition with a learned map from physical parameters to modal coefficients follows established non-intrusive reduced-order modeling methods ([48]). Here the decomposition acts on the residual cube after the nonlinear prediction. Its modes consequently represent coherent error patterns that remain across wavelength, time, and viewing direction. For every training calculation nn, we assemble the complete residual cube

Rn(ta,μb,λj)=log⁡[pn(ta,μb,λj)+ϵ]−log⁡[pn(0)(ta,μb,λj)+ϵ],(7)R_n(t_a,\mu_b,\lambda_j) = \log\left[p_n(t_a,\mu_b,\lambda_j)+\epsilon\right] - \log\left[p_n^{(0)}(t_a,\mu_b,\lambda_j)+\epsilon\right], \tag*{(7)}

where pn(0)p_n^{(0)} is the neural prediction and ϵ=10−7\epsilon=10^{-7} controls numerical behavior in negligible-flux bins. The residuals are clipped at finite amplitude and centered over wavelength. We flatten each time, angle, and wavelength cube into one vector and compute its proper orthogonal decomposition, which is a truncated singular-value decomposition of the collection of residual cubes. Retaining R=160R=160 spectral modes gives

Rn(t,μ,λ)≃∑r=1Rar(ϑn)Ur(t,μ,λ),(8)R_n(t,\mu,\lambda) \simeq\sum_{r=1}^{R} a_r(\boldsymbol{\vartheta}_n)U_r(t,\mu,\lambda), \tag*{(8)}

with

ϑ=(log⁡10MdM⊙,vdc,log⁡10MwM⊙,vwc).(9)\boldsymbol{\vartheta}=\left(\log_{10}\frac{M_{\rm d}}{M_\odot},\frac{v_{\rm d}}{c},\log_{10}\frac{M_{\rm w}}{M_\odot},\frac{v_{\rm w}}{c}\right). \tag*{(9)}

Each mode UrU_r spans the entire wavelength, time, and viewing-angle domain. The coefficient ara_r belongs to one physical ejecta calculation and has no independent time or angular index. This construction preserves the correlated temporal and angular evolution found by the radiative-transfer calculation. At inference time, the stored modes are interpolated bilinearly in log⁡10t\log_{10}t and μ\mu, after which the predicted coefficients reconstruct the residual spectrum at the requested epoch and line of sight. A separate rank 48 decomposition applies the same construction to the standardized luminosity residual.

We obtain the residual coefficients from two complementary interpolants over ϑ\boldsymbol{\vartheta}. The neural interpolant first maps each normalized ejecta coordinate to Chebyshev polynomials. The recurrence

T0(q)=1,T1(q)=q,Tm+1(q)=2qTm(q)−Tm−1(q)(10)\begin{aligned} T_0(q) &= 1,\qquad T_1(q)=q,\\ T_{m+1}(q) &= 2qT_m(q)-T_{m-1}(q) \tag*{(10)} \end{aligned}

is evaluated through degree six, and the resulting features are processed by a multilayer perceptron with separate heads for the spectral and luminosity coefficients. Chebyshev features provide a well-conditioned polynomial description of smooth trends across the bounded mass and velocity domain. The second interpolant is kernel regression. For normalized ejecta coordinates q\mathbf{q} and q′\mathbf{q}', we define the anisotropic distance

r2(q,q′)=∑m=14(qm−qm′)2ℓm2.(11)r^2(\mathbf{q},\mathbf{q}') = \sum_{m=1}^{4} \frac{(q_m-q'_m)^2}{\ell_m^2}. \tag*{(11)}

The two residual models retained in the final emulator use Matérn covariance functions

k3/2(r)=(1+3r)e−3r.(12)k_{3/2}(r) = \left(1+\sqrt{3}r\right)e^{-\sqrt{3}r}. \tag*{(12)}
k5/2(r)=(1+5r+5r23)e−5r.(13)k_{5/2}(r) = \left(1+\sqrt{5}r+\frac{5r^2}{3}\right)e^{-\sqrt{5}r}. \tag*{(13)}

For a matrix A\mathbf{A} of known POD coefficients at the training nodes Q\mathbf{Q}, the kernel prediction is

a^ker(q)=k(q,Q)[K(Q,Q)+ηI]−1A.(14)\widehat{\mathbf{a}}_{\mathrm{ker}}(\mathbf{q}) = \mathbf{k}(\mathbf{q},\mathbf{Q})\left[\mathbf{K}(\mathbf{Q},\mathbf{Q})+\eta\mathbf{I}\right]^{-1}\mathbf{A}. \tag*{(14)}

The length scales ℓm\ell_m, ridge parameter η\eta, and neural to kernel weight are selected using predictions in which the target physical simulation is excluded from the coefficient fit. This cross-fitted procedure also estimates a multiplicative shrinkage for each mode. Modes that reconstruct training residuals accurately but interpolate poorly receive smaller amplitudes.

The final model contains two independently fitted residual corrections, one using a Matérn 5/2 covariance and one using a Matérn 3/2 covariance. Their normalized spectral predictions, pj(1)p_j^{(1)} and pj(2)p_j^{(2)}, are combined through a smooth gate that depends on the physical query and wavelength,

bj(x)=sigmoid⁡[logit⁡(b0)+stanh⁡gj(x)],(15)b_j(\mathbf{x}) = \operatorname{sigmoid}\left[\operatorname{logit}(b_0)+s\tanh g_j(\mathbf{x})\right], \tag*{(15)}
p~j=[1−bj(x)]pj(1)+bj(x)pj(2),p^j=p~j∑kp~k.(16)\widetilde{p}_j = [1-b_j(\mathbf{x})]p_j^{(1)}+b_j(\mathbf{x})p_j^{(2)},\qquad\widehat{p}_j=\frac{\widetilde{p}_j}{\sum_k\widetilde{p}_k}. \tag*{(16)}

The bounded correction around the initial mixture b0=0.4b_0=0.4 limits rapid changes in the gate. A smoothness penalty along wavelength further regularizes bjb_j. The luminosity output uses a fixed convex combination of the two luminosity predictions followed by a small conditioned correction. The normalization in Equation (16) gives a positive spectral distribution for every query in the interpolation domain.

The loss function is defined in the same normalized energy coordinates used by the emulator. This choice allows errors in spectral shape to be measured independently of errors in total luminosity, while additional terms couple the two quantities in physical flux.

Let nn index the BB spectra in a mini batch, let qnj=p^njq_{nj}=\widehat{p}_{nj}, and define the standardized luminosity target

yn=ℓL,n−ℓ‾LsL,δyn=y^n−yn,rL,n=10sLδyn,(17)y_n=\frac{\ell_{L,n}-\overline{\ell}_L}{s_L},\qquad\delta y_n=\widehat{y}_n-y_n,\qquad r_{L,n}=10^{s_L\delta y_n}, \tag*{(17)}

where sL=0.91999s_L=0.91999 dex is the standard deviation used to standardize log⁡10Lbol\log_{10} L_{\mathrm{bol}}. Thus rL,n=L^bol,n/Lbol,nr_{L,n}=\widehat{L}_{\mathrm{bol},n}/L_{\mathrm{bol},n}. We use the smooth L1 function

ρβ(u)={u2/(2β),∣u∣≤β,∣u∣−β/2,∣u∣>β,(18)\rho_\beta(u)= \begin{cases} u^2/(2\beta), & |u|\le\beta,\\ |u|-\beta/2, & |u|>\beta, \end{cases} \tag*{(18)}

which is quadratic near zero and linear for a large residual. The main log spectral term is

Llog⁡p=1B∑n=1B∑jpnjϵp0.5(ln⁡qnj−ln⁡pnjϵ)∑jpnjϵ.(19)\mathcal{L}_{\log p}=\frac{1}{B}\sum_{n=1}^{B}\frac{\sum_j\sqrt{p_{nj}^{\epsilon}}p_{0.5}\left(\ln q_{nj}-\ln p_{nj}^{\epsilon}\right)}{\sum_j\sqrt{p_{nj}^{\epsilon}}}. \tag*{(19)}

Here pnjϵ=max⁡(pnj,10−12)p_{nj}^{\epsilon}=\max(p_{nj},10^{-12}). The softmax gives qnj>0q_{nj}>0, so only the simulated target requires a numerical floor. Weighting by pnj\sqrt{p_{nj}} retains sensitivity to the wings of the spectral energy distribution without allowing nearly empty wavelength bins to dominate the logarithmic residual.

Three complementary distances constrain the normalized energy distribution. For an individual spectrum they are

Eshape,n=∑j∣qnj−pnj∣,(20)E_{\mathrm{shape},n}=\sum_j|q_{nj}-p_{nj}|, \tag*{(20)}
Hn2=12∑j(qnj−pnj)2,(21)H_n^2=\frac{1}{2}\sum_j\left(\sqrt{q_{nj}}-\sqrt{p_{nj}}\right)^2, \tag*{(21)}
ECDF,n=1Nλ∑j∣∑k≤j(qnk−pnk)∣.(22)E_{\mathrm{CDF},n}=\frac{1}{N_\lambda}\sum_j\left|\sum_{k\le j}(q_{nk}-p_{nk})\right|. \tag*{(22)}

The L1 distance EshapeE_{\mathrm{shape}} measures the total fraction of spectral energy assigned to the wrong wavelength bins. The Hellinger distance gives a bounded comparison that remains stable when either distribution approaches zero. The cumulative term measures the amount and distance of energy transport along the ordered wavelength axis. A broad peak shifted coherently in wavelength therefore incurs a cumulative penalty even when its local residual is distributed over many bins.

The luminosity and spectral shape are joined through two flux losses. The first operates on the logarithmic flux ratio,

Llog⁡F=1B∑n∑jpnjϵp0.1[log⁡10(qnjpnjϵ)+sLδyn]∑jpnjϵ.(23)\mathcal{L}_{\log F}=\frac{1}{B}\sum_n\frac{\sum_j\sqrt{p_{nj}^{\epsilon}}p_{0.1}\left[\log_{10}\left(\frac{q_{nj}}{p_{nj}^{\epsilon}}\right)+s_L\delta y_n\right]}{\sum_j\sqrt{p_{nj}^{\epsilon}}}. \tag*{(23)}

and the second is the integrated physical flux error

Eflux,n=∑j∣rL,nqnj−pnj∣.(24)E_{\mathrm{flux},n}=\sum_j\left|r_{L,n}q_{nj}-p_{nj}\right|. \tag*{(24)}

Equation (24) is also used as a validation statistic in Equation (87). The central part of the training objective is

Lcentral=Llog⁡p+2.5⟨Eshape⟩+0.5⟨H2⟩+⟨ECDF⟩+0.7⟨(δy)2⟩+0.5Llog⁡F+2⟨Eflux⟩,(25)\mathcal{L}_{\mathrm{central}}=\mathcal{L}_{\log p}+2.5\langle E_{\mathrm{shape}}\rangle+0.5\langle H^2\rangle+\langle E_{\mathrm{CDF}}\rangle +0.7\langle(\delta y)^2\rangle+0.5\mathcal{L}_{\log F}+2\langle E_{\mathrm{flux}}\rangle, \tag*{(25)}

where angle brackets denote an average over the mini batch. The separate luminosity term fixes the normalization accurately, while the two joint terms prevent compensating errors in luminosity and normalized shape from producing an apparently favorable loss.

The broad features in LANLTP2 spectra span a range of wavelength scales. We therefore aggregate adjacent wavelength bins in blocks of 4, 16, and 64 bins and compute the L1 distance between the predicted and target block probabilities at each resolution. Their mean defines Lms\mathcal{L}_{\mathrm{ms}}. We also form a six level, unnormalized Haar decomposition. At each level, the detail coefficient is the difference between the probability in the left and right halves of a neighboring pair, while their sum is passed to the next level. The mean L1 error in these detail coefficients defines Lwav\mathcal{L}_{\mathrm{wav}}. The first and second finite difference operators along logarithmic wavelength are denoted by D1D_1 and D2D_2. We write their residuals as

Δr,nj=Drln⁡qnj−Drln⁡pnje,r∈{1,2}.(26)\Delta_{r,nj}=D_r\ln q_{nj}-D_r\ln p^{e}_{nj},\qquad r\in\{1,2\}. \tag*{(26)}

The associated losses are

LDr=1B∑n∑jwnj(r)ρ0.25(Δr,nj)∑jwnj(r).(27)\mathcal{L}_{D_r}=\frac{1}{B}\sum_n\frac{\sum_j w_{nj}^{(r)}\rho_{0.25}(\Delta_{r,nj})}{\sum_j w_{nj}^{(r)}}. \tag*{(27)}

where wnj(1)=pn,j+1+pnjw_{nj}^{(1)}=\sqrt{p_{n,j+1}+p_{nj}} and wnj(2)=pn,j+1w_{nj}^{(2)}=\sqrt{p_{n,j+1}}. The resulting structural term is

Lstructure=0.25Lms+0.5Lwav+0.1LD1+0.05LD2.(28)\mathcal{L}_{\mathrm{structure}}=0.25\mathcal{L}_{\mathrm{ms}}+0.5\mathcal{L}_{\mathrm{wav}}+0.1\mathcal{L}_{D_1}+0.05\mathcal{L}_{D_2}. \tag*{(28)}

The multiscale and wavelet terms constrain the energy contained in broad spectral regions. The finite differences constrain the locations and widths of blended opacity features in log flux.

Each training item contains neighboring epochs and the complete set of folded viewing directions for one ejecta configuration. We apply the weighted smooth L1 construction in Equation (27) to adjacent differences of ln⁡p\ln p along time and viewing direction, giving Lt,p\mathcal{L}_{t,p} and Lμ,p\mathcal{L}_{\mu,p}. Smooth L1 losses on the corresponding adjacent differences of standardized log luminosity give Lt,L\mathcal{L}_{t,L} and Lμ,L\mathcal{L}_{\mu,L}. Their contribution is

Lsequence=0.2(Lt,p+Lμ,p)+0.1(Lt,L+Lμ,L).(29)\mathcal{L}_{\mathrm{sequence}}=0.2\left(\mathcal{L}_{t,p}+\mathcal{L}_{\mu,p}\right)+0.1\left(\mathcal{L}_{t,L}+\mathcal{L}_{\mu,L}\right). \tag*{(29)}

differences of standardized log luminosity give Lt,L\mathcal{L}_{t,L} and Lμ,L\mathcal{L}_{\mu,L}. Their contribution is

Lsequence=0.2(Lt,p+Lμ,p)+0.1(Lt,L+Lμ,L).(30)\mathcal{L}_{\mathrm{sequence}}=0.2\left(\mathcal{L}_{t,p}+\mathcal{L}_{\mu,p}\right)+0.1\left(\mathcal{L}_{t,L}+\mathcal{L}_{\mu,L}\right). \tag*{(30)}

This term constrains changes between neighboring spectra from the same transport calculation. It is particularly useful during the rapid early color evolution and near lines of sight for which the projected column of lanthanide-rich material changes quickly. At the midpoint between each pair of neighboring angular coordinates, we also evaluate the per spectrum loss against the arithmetic midpoint of the two target distributions and luminosities. We denote this interpolation constraint by Lmid\mathcal{L}_{\mathrm{mid}}.

A mean loss can give little leverage to a small population of difficult spectra. We therefore use an empirical upper-tail mean, closely related to conditional value at risk ([89]), together with a smooth entropic-risk term. For an error vector e1,…,eBe_1,\ldots,e_B, these quantities are

CVaR⁡0.075(e)=1K∑n∈TKen,K=⌈0.075B⌉,\operatorname{CVaR}_{0.075}(e)=\frac{1}{K}\sum_{n\in\mathcal{T}_K}e_n,\qquad K=\lceil0.075B\rceil,
R22(e)=122ln⁡[1B∑n=1Bexp⁡(22en)].(31)\mathcal{R}_{22}(e)=\frac{1}{22}\ln\left[\frac{1}{B}\sum_{n=1}^{B}\exp(22e_n)\right]. \tag*{(31)}

where TK\mathcal{T}_K contains the KK largest errors in the mini batch. The tail contribution used in training is

Ltail=CVaR⁡0.075(Eshape)+CVaR⁡0.075(Eflux)+0.2CVaR⁡0.075(∣δy∣)+0.2R22(Eshape).(32)\mathcal{L}_{\mathrm{tail}}=\operatorname{CVaR}_{0.075}(E_{\mathrm{shape}})+\operatorname{CVaR}_{0.075}(E_{\mathrm{flux}}) +0.2\operatorname{CVaR}_{0.075}(|\delta y|)+0.2\mathcal{R}_{22}(E_{\mathrm{shape}}). \tag*{(32)}

The empirical tail means act directly on the least accurate spectra in each mini batch. The differentiable entropic term distributes additional weight continuously toward larger shape errors. Early spectra with t≤0.355t\leq0.355 d and models with vej≤0.08cv_{\mathrm{ej}}\leq0.08c are also sampled more frequently, since these regimes show faster spectral evolution and larger reconstruction errors. Each condition increases the unnormalized sampling weight by 60%, and both increments are retained where the conditions overlap.

For the wavelength dependent mixture in Equation (16), we define Lgate=⟨∣bj+1−bj∣⟩\mathcal{L}_{\mathrm{gate}}=\langle|b_{j+1}-b_j|\rangle. The complete objective is

L=Lcentral+Lstructure+Lsequence+Ltail+0.05Lgate+0.05Lmid.(33)\mathcal{L}=\mathcal{L}_{\mathrm{central}}+\mathcal{L}_{\mathrm{structure}}+\mathcal{L}_{\mathrm{sequence}} +\mathcal{L}_{\mathrm{tail}}+0.05\mathcal{L}_{\mathrm{gate}}+0.05\mathcal{L}_{\mathrm{mid}}. \tag*{(33)}

All coefficients in Equation (33) and its constituent terms are the values used for the reported emulator. The two residual models are first optimized separately with this objective. During the final combination fit their parameters remain fixed, and optimization updates the spectral gate and the small conditioned luminosity correction. This prevents the combination stage from degrading either component while it learns where each residual interpolation is more accurate.

The design of the emulator reflects the scale hierarchy of spectra from expanding kilonova ejecta. The large velocity gradient Doppler broadens and overlaps the dense forest of bound-bound transitions, producing wide troughs, shoulders, and peaks in the emergent spectrum. The local branch and dilated convolutions resolve the wavelength dependence of these features. The multiscale Fourier operator and the global latent branch carry information between the optical and infrared portions of the spectrum, where radioactive heating, photon diffusion, line blanketing, and the evolving ionization state redistribute the escaping energy as the ejecta expand.

Viewing direction changes the relative columns of the lanthanide-rich dynamical ejecta and the higher electron fraction wind along the line of sight. It consequently changes the luminosity and color together, with the strongest angular variation occurring where the projected obscuration changes rapidly. The complete residual cubes retain these correlations across wavelength, time, and angle within every POD mode. Across the four ejecta parameters, the Chebyshev network supplies a stable global approximation over the bounded fitting domain. The Matérn 5/2 interpolant represents smoother coefficient variation, while the Matérn 3/2 interpolant permits more rapid local changes. Their conditioned mixture allows the preferred degree of smoothness to vary with physical state and wavelength. Finally, the normalized probability representation enforces positivity and bolometric consistency, and the flux terms in the objective reconnect that representation to the physical luminosity scale used in the observer-frame projection.

Projection to the observer frame

Let

fλ,10 pcKN(trf,λrf;ϑ,ι)(34)f^{\mathrm{KN}}_{\lambda,10\,\mathrm{pc}}(t_{\mathrm{rf}},\lambda_{\mathrm{rf}};\boldsymbol{\vartheta},\iota) \tag*{(34)}

denote the rest-frame kilonova spectral flux density at a reference distance of 10 pc, for intrinsic model parameters ϑ\boldsymbol{\vartheta} and viewing angle ι\iota. Here ϑ\boldsymbol{\vartheta} collects the ejecta quantities that index the radiative-transfer model, while ι\iota fixes the line of sight through the axisymmetric ejecta. The 10 pc normalization isolates the spectral shape and temporal evolution from the later choice of source distance.

Let T0T_0 be the merger time and τ=T−T0\tau= T-T_0 the observer-frame time since merger. For an event observed at redshift zz, the rest-frame and observer-frame variables are related by

λobs=(1+z)λrf,trf=τ1+z,(35)\lambda_{\mathrm{obs}}=(1+z)\lambda_{\mathrm{rf}},\qquad t_{\mathrm{rf}}=\frac{\tau}{1+z}, \tag*{(35)}

so the observer samples a redshifted and time-dilated version of the same intrinsic sequence. The observer-frame spectrum is therefore

fλ,obsKN(τ,λobs)=fλ,10 pcKN(τ1+z,λobs1+z;ϑ,ι)1+z(10 pcDL)2,(36)f^{\mathrm{KN}}_{\lambda,\mathrm{obs}}(\tau,\lambda_{\mathrm{obs}})=\frac{f^{\mathrm{KN}}_{\lambda,10\,\mathrm{pc}}\left(\frac{\tau}{1+z},\frac{\lambda_{\mathrm{obs}}}{1+z};\boldsymbol{\vartheta},\iota\right)}{1+z}\left(\frac{10\ \mathrm{pc}}{D_L}\right)^2, \tag*{(36)}

with DLD_L the adopted luminosity distance. The inverse-square term gives the geometric dimming. The extra (1+z)−1(1+z)^{-1} enters because fλf_\lambda is defined per unit wavelength, so stretching the wavelength interval by (1+z)(1+z) reduces the observed flux density by the same factor.

Host-galaxy contamination

The extracted spectrum includes light from the kilonova and its host. Once a host galaxy and an offset within that host have been selected, the transient is assigned a definite sky position (α⋆,δ⋆)(\alpha_\star,\delta_\star), and the local galaxy spectrum must be estimated at that same position. The contaminating spectrum varies between the center of a dusty star-forming host and a faint outer arm or tidal feature. We use archival Pan-STARRS1 grizy imaging [27] and reconstruct the local galaxy spectrum with the chromatic scene-modeling approach introduced by HyperGal [67], using CIGALE as the galaxy SED-fitting engine [24].

Around (α⋆,δ⋆)(\alpha_\star,\delta_\star) we define a set of local spatial elements pp, each carrying a five-band photometric measurement Fp,bF_{p,b} and its uncertainty for b∈{g,r,i,z,y}b\in\{g,r,i,z,y\}. The images are registered to a common astrometric grid, and the fluxes are measured on a common spatial footprint so that the five values describe the same part of the galaxy. For a trial CIGALE spectrum Sp(m)(λ)S_p^{(m)}(\lambda), synthetic photometry in band bb is obtained from the Pan-STARRS1 response Tb(λ)T_b(\lambda). In a photon-counting convention this model flux is proportional to

Fp,b(m)=∫Sp(m)(λ)Tb(λ)λ dλ∫Tb(λ)λ dλ.(37)F_{p,b}^{(m)}=\frac{\int S_p^{(m)}(\lambda)T_b(\lambda)\lambda\,\mathrm{d}\lambda}{\int T_b(\lambda)\lambda\,\mathrm{d}\lambda}. \tag*{(37)}

The normalization and the physical SED parameters are constrained jointly by the five measured fluxes. The model library includes stellar-population evolution, star-formation history, nebular emission, and attenuation by dust. Each model receives a likelihood proportional to exp⁡(−χm2/2)\exp(-\chi_m^2/2), with

χm2=∑b(Fp,b−Fp,b(m))2σp,b2.(38)\chi_m^2=\sum_b\frac{\left(F_{p,b}-F_{p,b}^{(m)}\right)^2}{\sigma_{p,b}^2}. \tag*{(38)}

This construction uses CIGALE as a physically constrained interpolation from five broad bands to a continuous spectrum. Degeneracies among detailed stellar populations remain when only five-band photometry is available, and the adopted SED library sets the range of local spectra supported by the fit.

The result is a best-fitting observed-frame galaxy spectrum Sp(λ)S_p(\lambda) for each retained spatial element. In practice, only spatial elements with sufficiently constrained multiband photometry are assigned independent SED fits. This avoids forcing arbitrary colors onto low-signal outskirts where the data do not support a meaningful local spectral reconstruction.

The contaminating host spectrum entering the transient extraction is then obtained by combining those local spectra with a kernel centered on the transient position,

H(λ)=∑pwpSp(λ).(39)H(\lambda) = \sum_p w_p S_p(\lambda). \tag*{(39)}

The weights wpw_p describe how much galaxy light from neighboring spatial elements contributes to the extracted transient spectrum. For seeing-limited follow-up, a natural choice is a Gaussian kernel,

wp=exp⁡(−rp22σsee2),σsee=FWHM22ln⁡2,(40)w_p = \exp\left(-\frac{r_p^2}{2\sigma_{\mathrm{see}}^2}\right), \qquad\sigma_{\mathrm{see}} = \frac{\mathrm{FWHM}}{2\sqrt{2\ln2}}, \tag*{(40)}

where rpr_p is the projected distance between the transient position and the center of spatial element pp.

The extraction weights also include the spatial-element area and the normalization appropriate to the adopted aperture. They therefore preserve the amount of host light entering the transient extraction, and their sum follows the aperture normalization. The same spatial kernel is applied at every wavelength before any instrument response is imposed. Spatial changes in color and line strength are retained through the individual Sp(λ)S_p(\lambda), while the seeing kernel determines how those spectra mix at the selected position. The local fit includes regions with adequate multiband signal, for which the photometry supports a meaningful local spectral reconstruction.

Since H(λ)H(\lambda) is reconstructed directly from observed Pan-STARRS1 photometry, it is already an observer-frame spectrum.

The high-resolution host-contaminated sequence generated by the emulator is therefore

fλtot(τ,λ)=fλ,obsKN(τ,λ)+H(λ).(41)f_{\lambda}^{\mathrm{tot}}(\tau,\lambda) = f_{\lambda,\mathrm{obs}}^{\mathrm{KN}}(\tau,\lambda) + H(\lambda). \tag*{(41)}

The host term is fixed in wavelength for a given sky position, while the kilonova continuum changes rapidly with time. A useful diagnostic is the host fraction,

ϕH(τ,λ)=∣H(λ)∣∣fλtot(τ,λ)∣,(42)\phi_H(\tau,\lambda) = \frac{\lvert H(\lambda)\rvert}{\lvert f_{\lambda}^{\mathrm{tot}}(\tau,\lambda)\rvert}, \tag*{(42)}

which makes explicit that host contamination is both chromatic and phase dependent. Early in the evolution the kilonova may dominate the optical continuum, while at later phases the same extraction can become host dominated across much of the observed wavelength range. Figure 1 shows this progression for an injection position in NGC 772, a nearby spiral at DL≃37.1 MpcD_L \simeq37.1\,\mathrm{Mpc} drawn from the same host pool used for the image simulations, using a relatively low-inclination kilonova realization with ι≃19∘\iota\simeq19^\circ.

Figure 1. Example of the spectroscopic data-generation chain at an injection position in NGC 772, at a projected offset of ≃42.9′′\simeq42.9^{\prime\prime} from the galaxy center. Panel (a) shows the archival Pan-STARRS1 grizy cutouts centered on the selected sky position; these images provide the five-band measurements used by CIGALE to reconstruct the local host-galaxy spectrum entering Eq. (39). Panel (b) shows the transient sequence alone from the same SuperNu model family adopted for the photometric simulations, with viewing angle ι≃19∘\iota\simeq19^\circ, plotted in the native rest-frame 10 pc fλf_\lambda normalization of the model grid. Panel (c) shows the corresponding observer-frame sequence after projection to the NGC 772 distance DL=37.1D_L = 37.1 Mpc and addition of the reconstructed local host spectrum, with both terms combined directly in the same fλf_\lambda units; the dashed black curve gives the host term by itself. The displayed phases run from 0.125 to 4.76 days after merger and are ordered from top to bottom from earlier to later times. The plotted spectra are displaced vertically by about 0.7 dex between successive epochs for clarity, with a slightly larger separation between the first two rest-frame phases. The local host continuum and narrow emission features are already evident during the first day, and by a few days after merger they dominate a large fraction of the optical-to-near-infrared wavelength range shown here. Panel (d) shows the flux-calibrated, host-subtracted SEDM-like realization of the 0.5 d source for a 900 s exposure at X=1.2X = 1.2. The blue step curve is one noisy realization, the black curve is its noiseless reduced expectation, and the shaded band gives the reported 1σ1\sigma uncertainty.

Instrumental response and observational effects: SEDM example

The spectrum in Equation (41) retains the wavelength sampling of the kilonova model and the local host reconstruction. For panel (d) of Figure 1, we project this incident scene to the data level of a flux-calibrated, one-dimensional spectrum from the Spectral Energy Distribution Machine (SEDM). SEDM is a low-resolution integral-field spectrograph on the Palomar 60-inch telescope, designed for rapid transient classification at R∼100R \sim100 ([22]). Its automated reduction produces calibrated spectra on a 220-bin optical wavelength grid ([84]), while HyperGal models the point source and the spatially resolved host contribution within the SEDM cube ([67]).

We apply the instrumental line-spread function separately to the kilonova and host spectra and integrate the result over each finite SEDM wavelength bin. For a component q∈{KN,H}q \in\{\mathrm{KN},H\},

fˉkq=∑jMkj(R)fλ,jq,FWHM(λj)=λjR,(43)\bar{f}_k^q = \sum_j M_{kj}(R) f_{\lambda,j}^q, \qquad\mathrm{FWHM}(\lambda_j) = \frac{\lambda_j}{R}, \tag*{(43)}

where jj and kk index the input and output bins, respectively, and MkjM_{kj} is the response matrix obtained by integrating a normalized Gaussian line-spread function over both bins. We use R=100R = 100 and a real SEDM wavelength grid covering approximately 3700 to 9300 Å. The model spectrum has 2 Å sampling, which adequately samples the narrowest instrumental FWHM of 37 Å. The reduced-spectrum mean and one stochastic realization are

μk=(fˉkKN+ηHHˉk)[1+δcal,k+δtel,k],\mu_k = \left(\bar{f}_k^{\mathrm{KN}} + \eta_H \bar{H}_k\right)\left[1+\delta_{\mathrm{cal},k}+\delta_{\mathrm{tel},k}\right],
f^k=μk+σkϵk.(44)\hat{f}_k = \mu_k + \sigma_k \epsilon_k. \tag*{(44)}

Here ηH\eta_H is the fraction of the projected host spectrum Hˉk\bar{H}_k remaining after scene subtraction. The terms δcal,k\delta_{\mathrm{cal},k} and δtel,k\delta_{\mathrm{tel},k} describe smooth spectrophotometric residuals and residual O2\mathrm{O}_2 and H2O\mathrm{H}_2\mathrm{O} absorption, with the telluric templates evaluated using the pysedm airmass dependence. The reported uncertainty σk\sigma_k, the valid-bin mask, the observation-wide scale aa, and the short-range correlation of the zero-centered, unit-variance Student-tt deviate ϵk\epsilon_k are drawn from an empirical reduced-spectrum model. We calibrated that model using the pipeline-reported uncertainties and close-repeat differences from 2,988 nominal-quality SEDM spectra selected from the ZTF SN Ia DR2 and accessed through ZTFcosmo (M. Rigault et al. [85]). The fit uses uncertainty products and source-cancelled repeat differences, so it does not transfer Type Ia template residuals to the kilonova spectrum.

In our example, the projected 0.5 d kilonova has r=17.20r = 17.20 AB mag. We adopt texp=900t_{\mathrm{exp}} = 900 s, following the P60/SEDM exposure guide,1 and evaluate the telluric residuals at X=1.2X = 1.2. We set ηH=0\eta_{\mathrm{H}} = 0 to represent successful subtraction of the HyperGal host model from the extracted mean. The incident host remains in the uncertainty calculation because its photons contribute to the local background.

DATA GENERATION: LIGHT CURVES

Photometric observations, commonly referred to as light curves when plotted over time, are an important tool for transient classification. The characteristics of kilonovae include a rise on the timescale of ∼\simday, where the light curve peaks and then fades quite rapidly, at a rate of ∼\simmag/day. This makes them fleeting targets for surveys and targeted follow-up alike. In order to generate realistic kilonova light curves observed by ZTF, we will utilize informed distributions of limiting magnitudes and survey cadence, alongside physics-informed light curve models, to generate light curves as they would be seen by ZTF. For the purposes of this paper we will focus on the LANL TP2 model, a two-component 2D axisymmetric kilonova model comprised of a toroidal (T) dynamical ejecta component and a spherical (S) wind component (R. T. Wollaeger et al. 2021), but one also can use the time-dependent, three-dimensional Monte Carlo radiative transfer code POSSIS (M. Bulla [25]) for generating mock data with this pipeline.

Our final product will be a finite set of discrete photometric observations and upper limits across three ZTF bands:

D={(tk,bk,mk,σk,mlim,k)}k=1K,(45)\mathcal{D} = \left\{(t_k, b_k, m_k, \sigma_k, m_{\mathrm{lim},k})\right\}_{k=1}^{K}, \tag*{(45)}

where tkt_k is the observation time (MJD), bk∈{g,r,i}b_k \in\{g,r,i\} is the band, mkm_k is the reported magnitude (equal to the limiting magnitude for nondetections), σk\sigma_k is the reported magnitude uncertainty (infinite or a sentinel value for nondetections), and mlim,km_{\mathrm{lim},k} is the single-epoch limiting magnitude.

Radiative-transfer model grid and low-rank surrogate

We generate intrinsic light curves from the LANLTP2 radiative-transfer model family (R. T. Wollaeger et al. 2021). These axisymmetric models describe a toroidal dynamical-ejecta component and a peanut-shaped wind component, with the wind composition fixed to the model’s Ye=0.27Y_{\mathrm{e}} = 0.27 prescription. For the photometric surrogate, we define the intrinsic parameter vector ϑ∈Θ⊂R5\boldsymbol{\vartheta} \in\Theta\subset\mathbb{R}^{5} as

ϑ=(log⁡10MdM⊙,vdc,log⁡10MwM⊙,vwc,ι),(46)\boldsymbol{\vartheta} = \left(\log_{10}\frac{M_{\mathrm{d}}}{M_{\odot}}, \frac{v_{\mathrm{d}}}{c}, \log_{10}\frac{M_{\mathrm{w}}}{M_{\odot}}, \frac{v_{\mathrm{w}}}{c}, \iota\right), \tag*{(46)}

where MdM_{\mathrm{d}} and vdv_{\mathrm{d}} are the mass and characteristic expansion velocity of the dynamical ejecta, MwM_{\mathrm{w}} and vwv_{\mathrm{w}} describe the wind, and ι\iota is the viewing angle measured from the symmetry axis. The ejecta morphology and composition remain fixed within this model family; the surrogate interpolates across the masses, velocities, and viewing directions represented by the simulations.

The radiative-transfer library provides rest-frame absolute AB magnitudes in each band b∈Bb \in\mathcal{B}, evaluated at discrete parameter configurations {ϑ(n)}n=1Ngrid\{\boldsymbol{\vartheta}^{(n)}\}_{n=1}^{N_{\mathrm{grid}}} and a fixed rest-frame time grid {tj}j=1J⊂[tmin⁡,tmax⁡]\{t_j\}_{j=1}^{J} \subset[t_{\min}, t_{\max}]:

Mb(n)(tj)≡Mb(tj;ϑ(n)).(47)M_b^{(n)}(t_j) \equiv M_b(t_j; \boldsymbol{\vartheta}^{(n)}). \tag*{(47)}

Radiative transfer simulations are prohibitive in time and computational expense when used for kilonova template generation within a parameter estimation pipeline. We therefore compress the model grid into a low-dimensional representation via a truncated singular-value decomposition (SVD), performed independently for each band (P. T. H. Pang et al. [78]). This model can then quickly and cheaply simulate kilonova light curves from arbitrary parameters, allowing for the construction of large datasets suitable for training a machine learning architecture. Example simulated light curves from the surrogate model can be seen in Figure 2.

Figure 2. Example model light-curve families in ZTF grigri bands as a function of the mass of the wind ejecta log⁡10Mej,wind\log_{10} M_{\mathrm{ej,wind}}, an intrinsic parameter. Other intrinsic and extrinsic injection parameters are fixed and consistent with AT2017gfo as inferred by the maximum likelihood estimate from B. L. King et al. [60] for the LANLTP2 model. Curves are shown as apparent AB magnitudes.

For a fixed band bb, define the matrix Yb∈RNgrid×J\mathbf{Y}_b \in\mathbb{R}^{N_{\mathrm{grid}} \times J} with entries (Yb)nj=Mb(tj;ϑ(n))(\mathbf{Y}_b)_{nj} = M_b(t_j; \boldsymbol{\vartheta}^{(n)}). We apply an affine rescaling in time to improve conditioning,

Y~b(:,j)=Yb(:,j)−αb,jβb,j,βb,j>0,(48)\widetilde{\mathbf{Y}}_b(:,j) = \frac{\mathbf{Y}_b(:,j) - \alpha_{b,j}}{\beta_{b,j}}, \qquad\beta_{b,j} > 0, \tag*{(48)}

where αb,j\alpha_{b,j} and βb,j\beta_{b,j} are deterministic normalization constants computed from the grid (e.g., time-wise minima

and ranges, or means and standard deviations). We then compute the SVD

Y~b=UbSbVb⊤,(49)\widetilde{\mathbf{Y}}_b = \mathbf{U}_b \mathbf{S}_b \mathbf{V}_b^\top, \tag*{(49)}

and retain the first KbK_b components, with Kb≪JK_b \ll J. Writing Vb,K∈RJ×Kb\mathbf{V}_{b,K} \in\mathbb{R}^{J \times K_b} for the retained right-singular vectors and cb(n)∈RKb\mathbf{c}_b^{(n)} \in\mathbb{R}^{K_b} for the corresponding coefficient vector of the nn-th grid point, we obtain the approximation

M~b(tj;ϑ(n))≈∑ℓ=1Kbcb,ℓ(n)ϕb,ℓ(tj),ϕb,ℓ(tj)≡(Vb,K)jℓ.(50)\widetilde{M}_b(t_j; \boldsymbol{\vartheta}^{(n)}) \approx\sum_{\ell=1}^{K_b} c_{b,\ell}^{(n)} \phi_{b,\ell}(t_j), \qquad\phi_{b,\ell}(t_j) \equiv(\mathbf{V}_{b,K})_{j\ell}. \tag*{(50)}

In continuous time, we interpret ϕb,ℓ(t)\phi_{b,\ell}(t) as basis functions obtained by interpolating ϕb,ℓ(tj)\phi_{b,\ell}(t_j) over t∈[tmin⁡,tmax⁡]t \in[t_{\min}, t_{\max}]. The surrogate model then takes the form

Mb(t;ϑ)≈αb(t)+βb(t)∑ℓ=1Kbcb,ℓ(ϑ)ϕb,ℓ(t),(51)M_b(t; \boldsymbol{\vartheta}) \approx\alpha_b(t) + \beta_b(t) \sum_{\ell=1}^{K_b} c_{b,\ell}(\boldsymbol{\vartheta}) \phi_{b,\ell}(t), \tag*{(51)}

where αb(t)\alpha_b(t) and βb(t)\beta_b(t) are the continuous-time counterparts of the normalization in Eq. (48). The remaining task is to predict the coefficient map ϑ↦cb(ϑ)\boldsymbol{\vartheta} \mapsto\mathbf{c}_b(\boldsymbol{\vartheta}) at arbitrary ϑ\boldsymbol{\vartheta} within the region spanned by the grid. We learn this map by training a regression model Rb:Θ→RKb\mathcal{R}_b : \Theta\to\mathbb{R}^{K_b} on the paired set {(ϑ(n),cb(n))}\{(\boldsymbol{\vartheta}^{(n)}, \mathbf{c}_b^{(n)})\}, yielding

cb(ϑ)≈Rb(ϑ).(52)\mathbf{c}_b(\boldsymbol{\vartheta}) \approx\mathcal{R}_b(\boldsymbol{\vartheta}). \tag*{(52)}

Equation (50) then defines a fast, differentiable approximation to the radiative-transfer light curve in each band. While our implementation also tracks bolometric luminosity using an analogous low-rank representation, the dataset used for the present work is defined by the band-limited magnitudes Mb(t;ϑ)M_b(t; \boldsymbol{\vartheta}) for b∈{g,r,i}b \in\{g, r, i\}.

Extrinsic parameters and observer-frame ``truth'' light curves

Each synthetic event is further specified by a set of extrinsic (observer-dependent) parameters,

ξ≡(dL,z,E,T0),(53)\boldsymbol{\xi} \equiv(d_L, z, E, T_0), \tag*{(53)}

where dLd_L is luminosity distance, zz is redshift, E≡E(B−V)E \equiv E(B - V) is color excess, and T0T_0 is the trigger time (MJD) that anchors the event to the survey timeline. We adopt a physically motivated prior in which distances are sampled uniformly in proper volume within [Dmin⁡,Dmax⁡][D_{\min}, D_{\max}],

p(dL)=3dL2Dmax⁡3−Dmin⁡3,dL∈[Dmin⁡,Dmax⁡],(54)p(d_L) = \frac{3d_L^2}{D_{\max}^3 - D_{\min}^3}, \qquad d_L \in[D_{\min}, D_{\max}], \tag*{(54)}

and the redshift is deterministically assigned by inverting the cosmological luminosity-distance relation dL(z)d_L(z) under a fixed background cosmology, i.e. z=z(dL)z = z(d_L). We draw EE from a modest-support distribution and draw T0T_0 uniformly over a survey time window [Tmin⁡,Tmax⁡][T_{\min}, T_{\max}], so that events occur at random phases with respect to the survey cadence.

Given (ϑ,ξ)(\boldsymbol{\vartheta}, \boldsymbol{\xi}), we define a continuous-time observer-frame “truth” magnitude in each band. Let τ≡T−T0\tau\equiv T - T_0 denote observer-frame time since trigger. Cosmological time dilation implies that the corresponding rest-frame time is τ/(1+z)\tau/(1 + z). We therefore evaluate the surrogate in rest-frame time and then apply distance dimming, extinction, and a conventional (1+z)(1 + z) photometric factor consistent with mapping rest-frame spectral-density conventions into observed AB magnitudes when detailed K-corrections are neglected at low redshift. Collecting these effects, we define

mbtrue(τ;ϑ,ξ)=Mb(τ1+z;ϑ)+μ(dL)+Ab(E,z)+Δb(z),(55)m_b^{\mathrm{true}}(\tau; \boldsymbol{\vartheta}, \boldsymbol{\xi}) = M_b\left(\frac{\tau}{1 + z}; \boldsymbol{\vartheta}\right) + \mu(d_L) + A_b(E, z) + \Delta_b(z), \tag*{(55)}

where μ(dL)\mu(d_L) is the distance modulus,

μ(dL)=5log⁡10(dL[Mpc])+25,(56)\mu(d_L) = 5 \log_{10}(d_L[\mathrm{Mpc}]) + 25, \tag*{(56)}

Ab(E,z)A_b(E, z) is the band-dependent dust attenuation in magnitudes computed from an extinction law evaluated at the appropriate effective wavelength (including the shift of the effective rest wavelength by 1+z1 + z), and Δb(z)\Delta_b(z) denotes the adopted small redshift-dependent magnitude correction term. Therefore, equation (54) defines a smooth, noise-free apparent-magnitude curve on τ∈[tmin⁡,tmax⁡]\tau\in[t_{\min}, t_{\max}].

At fixed intrinsic and extrinsic parameters, the surrogate produces a deterministic light curve. We optionally apply data augmentation by adding small magnitude perturbations before sampling the curve at the survey epochs. On the dense observer-frame time grid {τj}\{\tau_j\}, we define

mb,jdense=mbtrue(τj;ϑ,ξ)+ϵb,j,ϵb,j∼N(0,σmodel2).(57)m_{b,j}^{\mathrm{dense}} = m_b^{\mathrm{true}}(\tau_j; \boldsymbol{\vartheta}, \boldsymbol{\xi}) + \epsilon_{b,j}, \qquad\epsilon_{b,j} \sim\mathcal{N}(0, \sigma_{\mathrm{model}}^2). \tag*{(57)}

In this prescription, the perturbations are independent across bands and dense-grid epochs. They broaden the distribution of generated light curves around each surrogate prediction, allowing downstream models to encounter small departures from the exact templates during training. The parameter σmodel\sigma_{\mathrm{model}} controls the augmentation amplitude and is separate from the photometric measurement uncertainty assigned later to each survey visit. The augmentation changes the generated magnitudes at fixed ejecta parameters; the physical parameter domain remains the one covered by the radiative-transfer library. Independent Gaussian perturbations provide a simple prescription for local variation around the templates, although physical changes in ejecta properties can produce correlated changes across time and wavelength. Setting σmodel=0\sigma_{\mathrm{model}} = 0 recovers the unperturbed surrogate light curve.

Data-driven survey sampling: cadence, depth, and band switching

The mapping from a smooth light curve mbdense(τ)m_b^{\mathrm{dense}}(\tau) to a discrete dataset D\mathcal{D} is a central step in producing survey-realistic simulated observations. We represent this mapping as a stochastic observation operator that generates a sequence of visits {(tk,bk,mlim,k)}\{(t_k, b_k, m_{\mathrm{lim},k})\}, where tkt_k is the observer-frame epoch, bkb_k is the observed band, and mlim,km_{\mathrm{lim},k} is the single-epoch limiting magnitude. Rather than imposing an idealized regular cadence or a fixed survey depth, the distributions entering this operator are inferred from historical ZTF observations. We follow the data-driven survey-modeling approach of N. Sravan et al. [97], with the ZTF Phase II implementation described by R. W. Kiendrebeogo et al. [59]. In this construction, the routine public-survey cadence and the separately modeled ii-band cadence are represented empirically, while the variation in single-epoch depth is likewise drawn from distributions measured from ZTF observations. The cadence and limiting-magnitude distributions used in our forward model are shown in Figure 3.

Figure 3. Survey-model components used to construct the synthetic ZTF observations. Left: empirical inter-visit spacing distributions for the public g/rg/r survey cadence and the separately modeled ii-band revisit cadence. Middle: single-epoch 5σ5\sigma limiting-magnitude distributions measured from the public-program observations, shown separately in gg, rr, and ii. Right: single-epoch 5σ5\sigma limiting-magnitude distributions for 300 s ToO observations in gg and rr.

We generate visit times directly in the observer frame. For each simulated event, the first observation occurs at a randomly sampled offset τstart>0\tau_{\mathrm{start}} > 0 after merger. Subsequent epochs are generated by drawing revisit intervals from kernel-density estimates of the empirical ZTF cadence distributions. Following N. Sravan et al. [97]; R. W. Kiendrebeogo et al. [59], the routine public-survey cadence and the ii-band revisit cadence are modeled separately. The observing filter is associated with the sampled visit sequence rather than drawn independently at every epoch, preserving the empirical relationship between visit timing and filter sequence

survey cadence and the ii-band revisit cadence are modeled separately. The observing filter is associated with the sampled visit sequence rather than drawn independently at every epoch, preserving the empirical relationship between visit timing and filter sequence present in the survey history. This procedure reproduces the broad and irregular distribution of ZTF sampling intervals, including closely separated observations and longer gaps between successive visits, without reducing the survey to a single characteristic cadence.

For simulations that include rapid follow-up, we augment the baseline survey sampling with a target-of-opportunity (ToO) component motivated by historical ZTF follow-up of gravitational-wave events. These observations are treated separately from the routine survey cadence and use the corresponding longer-exposure configurations. In particular, the survey model includes 300 s gg- and rr-band observations representative of the ZTF gravitational-wave follow-up strategy described by R. W. Kiendrebeogo et al. [59]. The resulting observation process can therefore combine routine survey sampling with a distinct early-time follow-up component while retaining the same underlying physical kilonova realization.

Once the visit times and bands have been generated, each observation is assigned a limiting magnitude mlim,km_{\mathrm{lim},k} drawn from an empirical, band-dependent depth distribution. The observed ZTF distributions for cadence and limiting magnitude are shown in Figure 3. We model this quantity stochastically rather than assigning a single characteristic ZTF depth because the sensitivity of individual exposures varies substantially with observing conditions. The distributions used here are derived from historical ZTF measurements and are constructed separately for the relevant survey components and filters. For the ToO component, the limiting-magnitude distribution is conditioned on the longer exposure configuration. These empirical distributions are shown in the middle and right panels of Figure 3. The resulting survey realization is

S(ξ)={(tk,bk,mlim,k)}k=1K,(58)S(\boldsymbol{\xi}) = \left\{(t_k,b_k,m_{\mathrm{lim},k})\right\}_{k=1}^{K}, \tag*{(58)}

with tk∈[T0+tmin⁡,T0+tmax⁡]t_k \in[T_0+t_{\min},T_0+t_{\max}].

Given SS, we evaluate the dense-time magnitudes by interpolation. Let τk=tk−T0\tau_k=t_k-T_0. We assign the noiseless apparent magnitude at each visit as

mk⋆=mbkdense(τk),(59)m_k^\star= m_{b_k}^{\mathrm{dense}}(\tau_k), \tag*{(59)}

where the right-hand side is obtained by interpolating the dense grid {(τj,mb,jdense)}\left\{(\tau_j,m_{b,j}^{\mathrm{dense}})\right\}.

Photometric uncertainties, detections, and upper limits

We model reported uncertainties using a magnitude-dependent, band-dependent distribution calibrated to survey photometry. Specifically, for each band bb we fit a flexible parametric family to the conditional distribution p(σm∣m,b)p(\sigma_m \mid m,b). In practice we discretize magnitude into bins [mℓ,mℓ+1)[m_\ell,m_{\ell+1}) and, in each bin, represent the distribution of reported magnitude errors by a skew-normal (or similarly flexible) law with parameters that vary with bb and bin index. We denote the resulting conditional law abstractly by

σk∼p(σm∣mk⋆,bk),(60)\sigma_k \sim p(\sigma_m \mid m_k^\star,b_k), \tag*{(60)}

optionally augmented by an error floor added in quadrature to represent irreducible calibration systematics.

The detection model is then expressed in terms of the limiting magnitude mlim,km_{\mathrm{lim},k}. If the source is fainter than the limiting magnitude, we treat the visit as a nondetection and record it as upper limit by setting σk\sigma_k to infinity:

if mk⋆>mlim,k⇒mk=mlim,k,σk=∞.(61)\text{if }m_k^\star> m_{\mathrm{lim},k}\quad\Rightarrow\quad m_k=m_{\mathrm{lim},k},\qquad\sigma_k=\infty. \tag*{(61)}

If the source is brighter than the limiting magnitude, we treat the visit as a detection and draw a noisy magnitude measurement. In magnitude space we adopt a Gaussian perturbation,

if mk⋆≤mlim,k⇒mk∼N(mk⋆,σk2),(62)\text{if }m_k^\star\le m_{\mathrm{lim},k}\quad\Rightarrow\quad m_k\sim\mathcal{N}(m_k^\star,\sigma_k^2), \tag*{(62)}

with σk\sigma_k drawn from Eq. (60). The use of a Gaussian in magnitudes is an approximation to flux-space noise that is accurate at moderate-to-high signal-to-noise; the survey-calibrated distribution for σk\sigma_k partially absorbs deviations from this idealization.

Figure 4 shows the empirical magnitude-dependent uncertainty model used in this step. The typical reported uncertainty increases toward fainter magnitudes, while the finite width of the conditional distributions retains the observed scatter in photometric precision at fixed source brightness. Modeling p(σm∣m,b)p(\sigma_m \mid m,b) in this way allows the simulation to reproduce the heteroscedastic character of ZTF photometry.

Figure 4. Empirical ZTF photometric uncertainty model: reported magnitude uncertainty σm\sigma_m versus true magnitude for grigri. The solid curves trace the median σm\sigma_m; shaded regions enclose the central 68% probability mass of the conditional distribution in Eq. (60).

This construction yields a mixed dataset of detections and nondetections. If one wishes to write the implied likelihood for the entire light curve given (ϑ,ξ)(\vartheta,\boldsymbol{\xi}), it factorizes over visits into a product of Gaussian terms for detections and survival terms for censored observations. Denoting by Idet\mathcal{I}_{\mathrm{det}} and Ilim\mathcal{I}_{\mathrm{lim}} the index sets of detections and limits, respectively, we may write schematically

p(D∣ϑ,ξ)=∏k∈IdetN(mk∣mbktrue(τk),σk2)×∏k∈IlimP(m>mlim,k∣mbktrue(τk)).(63)p(D \mid\vartheta,\xi)=\prod_{k\in\mathcal{I}_{\mathrm{det}}}\mathcal{N}\left(m_k\mid m_{b_k}^{\mathrm{true}}(\tau_k),\sigma_k^2\right) \times\prod_{k\in\mathcal{I}_{\mathrm{lim}}}\mathbb{P}\left(m>m_{\mathrm{lim},k}\mid m_{b_k}^{\mathrm{true}}(\tau_k)\right). \tag*{(63)}

where the second factor represents censoring at the limiting magnitude. The stored representation in Eq. (45) is thus a compact encoding of a censored heteroscedastic time series, aligned to the survey cadence.

The combined effect of the survey forward model is illustrated in Figure 5 using an AT2017gfo-like realization from the LANLTP2 model family. We adopt the maximum-likelihood parameters inferred by B. L. King et al. [60], with a dynamical-ejecta mass Md=0.040 M⊙M_{\mathrm{d}}=0.040\,M_{\odot} and velocity vd=0.27cv_{\mathrm{d}}=0.27c, a wind-ejecta mass Mw=0.028 M⊙M_{\mathrm{w}}=0.028\,M_{\odot} and velocity vw=0.07cv_{\mathrm{w}}=0.07c, and a viewing angle ι=0.75\iota=0.75 rad. The central realization is placed at a luminosity distance DL=44D_{\mathrm{L}}=44 Mpc. The solid curves show the resulting continuous observer-frame grigri light curves, while the survey forward model converts them into a sparse set of detections and upper limits with epochs, filters, limiting depths, and photometric uncertainties sampled from the empirical ZTF model. The lower panel shows the residuals mtrue−mobsm_{\mathrm{true}}-m_{\mathrm{obs}} for detected observations. Thus, even for a fixed underlying kilonova realization, different realizations of the observation operator produce different measured light curves, allowing the simulated dataset to capture the observational variability encountered by downstream classification and inference models.

Figure 5. Example injected kilonova light curve (solid lines) and ZTF-like survey sampling (markers) in gri bands. Upper limits are shown as open inverted triangles. Bottom panel shows residuals mtrue−mobsm_{\mathrm{true}} - m_{\mathrm{obs}} for detections. Intrinsic and extrinsic injection parameters are consistent with AT2017gfo as inferred by the maximum likelihood estimate from B. L. King et al. [60] for the LANLTP2 model.

Dataset realization and interface to image-level injections

Repeating the procedure above for NinjN_{\mathrm{inj}} independent draws (ϑi,ξi)(\vartheta_i,\xi_i) yields a Monte Carlo dataset

T={(ϑi,ξi,Di)}i=1Ninj.(64)\mathcal{T}=\left\{(\vartheta_i,\xi_i,D_i)\right\}_{i=1}^{N_{\mathrm{inj}}}. \tag*{(64)}

Each element DiD_i consists of a realistic mixture of detections and upper limits across multiple bands, with times and depths that mimic the empirical survey sampling.

DATA GENERATION: IMAGES

We now turn to the image-level component of the simulation. The input to this stage is an unresolved transient at sky position (α⋆,δ⋆)(\alpha_{\star},\delta_{\star}) with an observer-frame apparent magnitude me,⋆m_{\mathrm{e},\star} specified for one or more survey epochs ee. The goal is to generate realistic ZTF image products for those epochs by inserting the transient directly into archival science images and pairing the result with the corresponding archival reference images. In this construction the transient is the only synthetic ingredient. The host-galaxy light, crowding, sky background, detector artifacts, and the full diversity of the survey imaging are all inherited from real ZTF data products ([18, 45, 73]). We see an example of the final product in Figure 7.

Figure 7. From a simulated kilonova realization to a multiband image sequence. The upper panel shows an AT2017gfo-like ZTF realization from the LANLTP2 model family, evaluated at the adopted literature distance of NGC 1614, D=64D = 64 Mpc. Filled points with error bars denote simulated detections, open downward triangles denote simulated upper limits, and the solid curves show the underlying model light curves used to set the injected fluxes. Open squares mark the specific sampled visits used in the image construction below. The three image rows show, respectively, gg-, rr-, and ii-band aligned reference stamps in the first column followed by injected science stamps at those selected visits, all at a fixed off-nuclear sky position relative to the host. This example illustrates how a single simulated kilonova realization is converted into a temporally ordered, filter-resolved set of realistic science/reference postage-stamp pairs while preserving the true host-galaxy morphology and sky background of the survey data.

We also retain the reference image as an explicit product rather than collapsing the problem immediately to image subtraction. At each epoch we therefore construct a science/reference pair,

Ie≡(Ie,injsci,I~eref),(65)\mathcal{I}_e\equiv\left(\mathbf{I}^{\mathrm{sci}}_{e,\mathrm{inj}},\widetilde{\mathbf{I}}^{\mathrm{ref}}_e\right), \tag*{(65)}

where ee labels a specific archival exposure, Ie,injsci\mathbf{I}^{\mathrm{sci}}_{e,\mathrm{inj}} is the science image after transient injection, and I~eref\widetilde{\mathbf{I}}^{\mathrm{ref}}_e is the corresponding archival reference image after alignment to the science-image frame. This operator is completely general. It can be used for any unresolved transient, independent of how the apparent magnitudes were generated. Kilonova specificity enters only through the astrophysical prior used to choose the host environment and source location, together with the externally supplied light curve mb(t)m_b(t).

Single-epoch science/reference stamps construction

Consider an archival ZTF science exposure ee, observed at time tet_e in filter be∈{g,r,i}b_e\in\{g,r,i\}, together with its archival reference image for the same field, detector quadrant, and filter. This is the same basic setting used in survey pipelines and in image-level transient simulations more generally, where synthetic point sources are overlaid on real survey images and interpreted relative to a static reference scene in order to assess detection and measurement performance ([18, 45, 73, 56, 44, 57, 58]). The reference image is first aligned to the science exposure and placed on the same flux scale:

I~eref=seRe[Ieref],se≡10(Zesci−Zeref)/2.5,(66)\tilde{I}^{\mathrm{ref}}_e = s_e \mathcal{R}_e\left[I^{\mathrm{ref}}_e\right], \qquad s_e \equiv10^{(Z_e^{\mathrm{sci}}-Z_e^{\mathrm{ref}})/2.5}, \tag*{(66)}

where Re\mathcal{R}_e denotes the alignment of the reference image to the science frame, and ZesciZ_e^{\mathrm{sci}} and ZerefZ_e^{\mathrm{ref}} are the corresponding photometric zero points. After this step the reference image represents the static scene as it would be measured in the science-image astrometric and photometric system.

The transient itself is represented by the exposure-specific science-image PSF. We normalize that PSF to unit sum and shift it to the exact source position, so that the injected amplitude is controlled entirely by the source flux and the source is not artificially snapped to the nearest pixel center. The apparent AB magnitude me,⋆m_{e,\star} prescribed for epoch ee is converted to image-space flux through the science-image zero point:

Feinj=10−0.4(me,⋆−Zesci).(67)F^{\mathrm{inj}}_e = 10^{-0.4(m_{e,\star}-Z_e^{\mathrm{sci})}.} \tag*{(67)}

The injected science image is then

Ie,injsci[u,v]=Iesci[u,v]+FeinjP^e,⋆[u−u⋆,v−v⋆],(68)I^{\mathrm{sci}}_{e,\mathrm{inj}}[u,v] = I^{\mathrm{sci}}_e[u,v] + F^{\mathrm{inj}}_e \hat{P}_{e,\star}[u-u_\star,v-v_\star], \tag*{(68)}

where P^e,⋆\hat{P}_{e,\star} denotes the shifted, normalized PSF. Optional source Poisson noise and detector read noise can be added at this stage, but the dominant background, host structure, and crowding are already present in the archival science image. The reference image is not modified, because the injected transient is absent by construction from the static template.

For downstream use, the aligned science/reference pair is cropped to a fixed square stamp:

(Sesci,Seref)=(CL[Ie,injsci;ce],CL[I~eref;ce]).(69)\left(S^{\mathrm{sci}}_e,S^{\mathrm{ref}}_e\right)=\left(C_L\left[I^{\mathrm{sci}}_{e,\mathrm{inj}};\boldsymbol{c}_e\right],C_L\left[\tilde{I}^{\mathrm{ref}}_e;\boldsymbol{c}_e\right]\right). \tag*{(69)}

In our standard products L=63L=63 pixels, and ce\boldsymbol{c}_e is usually chosen to be the injected source position so that the transient remains centered across epochs. Figure 6 illustrates the single-epoch construction. The archival science exposure is shown before and after injection, together with the reference image aligned to the science-image astrometric frame and photometric scale. The lower panels show the resulting 63×6363 \times63-pixel science and reference stamps and the normalized science-image PSF used to place the transient. The injected source occupies a fixed position relative to the host, while the surrounding galaxy structure, neighboring sources, and background are inherited from the archival exposure.

Single-epoch construction of one host-associated, matched ZTF science/reference postage-stamp pair

Figure 6. Single-epoch construction of one host-associated, matched ZTF science/reference postage-stamp pair. Panel (a) shows the selected archival science exposure before injection. The circular marker identifies the host center, the gold vector represents the sampled projected offset (R,ϕ)(R,\phi), and its endpoint defines the injection coordinates (α⋆,δ⋆)(\alpha_\star,\delta_\star). The compass and 20-arcsec scale are derived from the science-image astrometric solution. Panel (b) shows the same exposure after adding the shifted, unit-normalized exposure PSF with the flux implied by the prescribed AB magnitude, Ie,injsci=Iesci+10−0.4(me,⋆−Zesci)P~e,⋆I^{\mathrm{sci}}_{e,\mathrm{inj}}=I^{\mathrm{sci}}_e+10^{-0.4(m_{e,\star}-Z^{\mathrm{sci}}_e)}\widetilde{P}_{e,\star}. Panel (c) shows the corresponding archival reference after astrometric alignment and transfer to the science-image flux scale, I~eref=seRe[Ieref]\widetilde{I}^{\mathrm{ref}}_e=s_e\mathcal{R}_e[I^{\mathrm{ref}}_e], where se=10(Zesci−Zeref)/2.5s_e=10^{(Z^{\mathrm{sci}}_e-Z^{\mathrm{ref}}_e)/2.5}; the transient is added only to the science exposure. In panels (b) and (c), the crosshair marks the common sky coordinate and the white square marks the common 63×6363\times63-pixel crop. Panel (d) displays the normalized exposure PSF used for the injection, with intensity shown relative to its maximum. Panel (e) contains the resulting 63×6363\times63-pixel science and reference stamps, both centered at (α⋆,δ⋆)(\alpha_\star,\delta_\star).

Host-associated kilonova postage-stamp pairs

To specialize the generic operator above to kilonovae, we must specify how the transient is placed relative to a host galaxy. Let the candidate host set be

H={Hi}i=1Nhost(70)\mathcal{H}=\{H_i\}_{i=1}^{N_{\mathrm{host}}} \tag*{(70)}

with each entry HiH_i containing at minimum a sky position (αi,δi)(\alpha_i,\delta_i), a distance or redshift, and whatever host descriptors are available for the astrophysical population model under consideration. The general problem is to assign a prior probability that a kilonova-producing compact-binary merger occurs in host HiH_i. In practice this is most naturally expressed through a non-negative host weight wiw_i that encodes the relative prior expectation that host HiH_i contributes to the merger population, in the same spirit that host-galaxy properties are used to interpret compact-merger environments and rates [65, 91, 41, 77]. The corresponding discrete host prior is then

p(Hi)=wi∑j=1Nhostwj.(71)p(H_i)=\frac{w_i}{\sum_{j=1}^{N_{\mathrm{host}}}w_j}. \tag*{(71)}

The detailed construction of wiw_i is intentionally left open at this stage. Depending on the application, it may reflect stellar population arguments, star-formation history, morphology, environment, or any externally puted proxy for merger likelihood. If a host-weight column is supplied directly, it can be used as is; if only a filtered host list is available, the simulation reduces to sampling from that list with the desired weights. The essential point is simply that the host prior carries the astrophysical information, while the image operator remains independent of how those weights were derived.

Conditional on the selected host, the transient is assigned a projected galactocentric offset. Let RR denote the projected physical offset in the host plane and let ϕ\phi denote the corresponding azimuthal angle. A convenient general placement model is

p(R,ϕ∣Hi)=pR(R∣Hi) pϕ(ϕ∣Hi),(72)p(R,\phi\mid H_i) = p_R(R \mid H_i)\,p_\phi(\phi\mid H_i), \tag*{(72)}

with the radial term pR(R∣Hi)p_R(R \mid H_i) describing the projected offset distribution and the angular term pϕ(ϕ∣Hi)p_\phi(\phi\mid H_i) describing the azimuthal placement. This is the natural form when one wants to calibrate the radial part directly against observed projected offsets, as is commonly done for short-Gamma Ray Burst (GRB) host studies [39, 41, 19]. Unless one has a physically motivated anisotropic prior tied to the host morphology, the angular distribution is taken to be isotropic,

pϕ(ϕ∣Hi)=12π,0≤ϕ<2π.(73)p_\phi(\phi\mid H_i) = \frac{1}{2\pi}, \qquad0 \le\phi< 2\pi. \tag*{(73)}

Once RR and ϕ\phi have been drawn, the injected sky position follows from the angular-diameter distance to the host:

Δϑi=RDA(zi),(74)\Delta\vartheta_i = \frac{R}{D_A(z_i)}, \tag*{(74)}

which is an excellent approximation in the small-angle regime relevant to galaxy-scale offsets. Introducing local tangent-plane coordinates (Δξi,Δηi)(\Delta\xi_i,\Delta\eta_i),

Δξi=Δϑicos⁡ϕ,Δηi=Δϑisin⁡ϕ,(75)\Delta\xi_i = \Delta\vartheta_i \cos\phi,\qquad\Delta\eta_i = \Delta\vartheta_i \sin\phi, \tag*{(75)}

the corresponding celestial-coordinate increments are

Δαi=Δξicos⁡δi,Δδi=Δηi,(76)\Delta\alpha_i = \frac{\Delta\xi_i}{\cos\delta_i},\qquad\Delta\delta_i = \Delta\eta_i, \tag*{(76)}

so that the transient position is

α⋆=αi+Δαi,δ⋆=δi+Δδi.(77)\alpha_\star= \alpha_i + \Delta\alpha_i,\qquad\delta_\star= \delta_i + \Delta\delta_i. \tag*{(77)}

The factor of cos⁡δi\cos\delta_i is the usual conversion between a tangent-plane longitudinal displacement and a change in right ascension. In the nearby limit this reduces to the familiar small-angle relation Δϑ≃R/D\Delta\vartheta\simeq R/D.

Once the tuple (Hi,R,ϕ)(H_i,R,\phi) has been realized, the image-generation machinery requires only three ingredients: the sky position (α⋆,δ⋆)(\alpha_\star,\delta_\star), the exposure metadata (te,be,Zesci,…)(t_e,b_e,Z^{\mathrm{sci}}_e,\ldots), and the prescribed magnitude me,⋆m_{e,\star} at that epoch. The pipeline queries the archive at the injected sky position, identifies science and reference products in the requested filters and time range, and then applies the single-epoch construction of Eqs. (66)–(68). In this sense, the kilonova specificity is entirely contained in the host prior, the offset prior, and the supplied apparent-magnitude law.

Building a multi-band triplet sequence from a model light curve

We construct a temporal image sequence by applying the single-epoch injection operator repeatedly to the same simulated event. The host, projected offset, and transient sky position are fixed throughout the sequence. At each selected visit, the injected flux is prescribed by the continuous observer-frame light curve in the corresponding filter. The magnitude-to-flux conversion uses the zero point of the archival science exposure, and the source is placed using that exposure’s PSF. The resulting sequence therefore combines the temporal and color evolution of one kilonova realization with the exposure-dependent imaging conditions present in the archival data.

The underlying model magnitude determines the injected source amplitude. The detection flag and limiting magnitude remain attributes of the photometric observation model. An epoch classified as a nondetection can therefore still have an associated injected image, in which the transient contributes flux below the adopted photometric threshold. Retaining such epochs allows downstream image models to encounter the fading source and its host environment even when the photometric product contains only an upper limit.

Each selected epoch yields an aligned science/reference stamp pair, accompanied by its time, filter, and exposure metadata. The reference stamp supplies the static comparison scene, while the injected science stamp contains the evolving transient. Keeping the source position fixed across epochs preserves the association between the light curve and the local host environment; using the exposure-specific PSF and photometric calibration preserves the imaging conditions of each archival observation.

Figure 7 illustrates this construction for an AT2017gfo-like LANTIP2 realization placed at an off-nuclear position in NGC 1614, using the adopted host distance of 64 Mpc. The upper panel shows the underlying gri light curves together with simulated detections and upper limits. The lower rows display injected science stamps in each filter at their corresponding phases, with time measured relative to the first ZTF visit. The transient is prominent around maximum light and becomes progressively less visible as it fades, while the host remains present in every stamp.

VALIDATION

Images

The validation measurements are performed with forced PSF photometry at the known injected position. For an epoch ee, let

Deinj≡Ie,injsci−Iesci(78)\mathbf{D}^{\mathrm{inj}}_e \equiv\mathbf{I}^{\mathrm{sci}}_{e,\mathrm{inj}}-\mathbf{I}^{\mathrm{sci}}_e \tag*{(78)}

denote the image containing only the injected component. By construction, Eq. (78) removes the static host-galaxy light and sky realization already present in the archival science image, so that the recovery test isolates the photometric fidelity of the injection operator itself.

At the fixed source position (x⋆,y⋆)(x_\star,y_\star), we adopt the same sub-pixel shifted, unit-normalized PSF model Pe,⋆(u,v)P_{e,\star}(u,v) used in the forward injection step. The forced-photometric flux estimate is then obtained as the weighted least-squares amplitude of that PSF model on the injected-only image,

F^e=∑u,vPe,⋆(u,v)Deinj(u,v)Ve−1(u,v)∑u,vPe,⋆2(u,v)Ve−1(u,v),(79)\widehat{F}_e = \frac{\sum_{u,v} P_{e,\star}(u,v)D^{\mathrm{inj}}_e(u,v)V_e^{-1}(u,v)}{\sum_{u,v}P_{e,\star}^2(u,v)V_e^{-1}(u,v)}, \tag*{(79)}

where Ve(u,v)V_e(u,v) is the per-pixel variance model over the fitting stamp. Equation (78) is the usual maximum-likelihood estimator for the amplitude of a known PSF template under independent Gaussian pixel noise. The corresponding formal flux variance is

σF^e2=[∑u,vPe,⋆2(u,v)Ve−1(u,v)]−1,(80)\sigma^2_{\widehat{F}_e}=\left[\sum_{u,v}P_{e,\star}^2(u,v)V_e^{-1}(u,v)\right]^{-1}, \tag*{(80)}

and the associated signal-to-noise ratio is SNRe=F^e/σF^e\mathrm{SNR}_e=\widehat{F}_e/\sigma_{\widehat{F}_e}. In the present validation implementation we do not propagate a full empirical variance plane through the injected-only image, so the recovery step adopts a constant variance Ve(u,v)=σ^e,bkg2V_e(u,v)=\widehat{\sigma}_{e,\mathrm{bkg}}^2, where σ^e,bkg\widehat{\sigma}_{e,\mathrm{bkg}} is estimated robustly from the local background of Deinj\mathbf{D}^{\mathrm{inj}}_e through a median-absolute-deviation scale estimator.

Whenever F^e>0\widehat{F}_e>0, the recovered magnitude is obtained by mapping the fitted flux back through the science-image zero point,

me,rec=Zesci−2.5log⁡10F^e,(81)m_{e,\mathrm{rec}}=Z^{\mathrm{sci}}_e-2.5\log_{10}\widehat{F}_e, \tag*{(81)}

with the usual small-error propagation

σm,e≃2.5ln⁡10σF^eF^e.(82)\sigma_{m,e}\simeq\frac{2.5}{\ln10}\frac{\sigma_{\widehat{F}_e}}{\widehat{F}_e}. \tag*{(82)}

The validation residuals quoted below are therefore direct tests of whether the forward image injection and the backward forced-photometric recovery return consistent fluxes when evaluated on the same real survey images.

Injection recovery on real science images

Our first test checks the image-generation operator against itself. We draw host/exposure configurations from the same archive query used in production, evaluate the science-image PSF at the injection position, and place point sources with apparent magnitudes sampled continuously over 18≤minj≤2218\leq m_{\mathrm{inj}}\leq22 mag. Recovery is then carried out with the forced-photometric estimator of Eqs. (79)–(81) on the injected-only image of Eq. (78). This tests the magnitude-to-flux conversion, the sub-pixel PSF placement, the local stamp extraction, and the behavior of the injected source on top of the real sky and host-galaxy background.

We adopt a Short-GRB-informed nearby-host selection for performing the injections. The most direct empirical guide to the environments of binary-neutron-star mergers is the observed short-GRB host population. Short-GRB hosts span both star-forming and quiescent galaxies (W.-f. Fong et al. [40]; A. E. Nugent et al. [77]); this immediately argues against restricting kilonova image generation to a single morphological class. Their projected offsets are likewise not confined to galaxy centers. The median projected offset is 4.5 kpc in the sample of W. Fong & E. Berger [39], while the larger compilation of W.-f. Fong et al. [41] gives median projected offsets of 4.9 kpc for the robust host-association sample and 7.9 kpc for the full sample. In both cases there is a substantial large-offset tail, including events beyond 10 kpc and apparently hostless systems (E. Berger [19]; W. Fong & E. Berger [39]; W.-f. Fong et al. [41]). These measurements motivate both the host prior and the offset prior used for kilonova image generation.

For this sample, we assemble a compact proposal catalog of 64 nearby galaxies spanning 31.1≤DL≤85.431.1\leq D_L\leq85.4 Mpc. Each entry has a measured sky position and distance or redshift, together with usable archival ZTF science and reference imaging in gg and rr. The set includes spirals, disturbed star-forming systems, merger remnants, and quiescent early-type galaxies, thereby retaining the broad host diversity measured for short-GRB hosts. This catalog provides an explicit finite set on which Eq. (71) can be evaluated. The NGC 1614 realization shown in Figure 7 is one worked member of this set. Its role is to demonstrate the complete host-associated image construction; population studies can replace this proposal set and its weights without changing the image operator.

To place the transient within those hosts, we adopt an offset distribution chosen to reproduce the two most salient projected-offset diagnostics of the observed short-GRB population: a median offset near 5 kpc and an appreciable large-offset tail. We represent these constraints with the two-component mixture

pR(R)=(1−ftail) LN(R;ln⁡Rmed,σln⁡R)+ftailptail(R),(83)p_R(R) = (1-f_{\mathrm{tail}})\,\mathcal{LN}(R;\ln R_{\mathrm{med}},\sigma_{\ln R})+f_{\mathrm{tail}}p_{\mathrm{tail}}(R), \tag*{(83)}

where LN(R;ln⁡Rmed,σln⁡R)\mathcal{LN}(R;\ln R_{\mathrm{med}},\sigma_{\ln R}) is the lognormal density with median RmedR_{\mathrm{med}}, and the tail component is taken to be log-uniform,

ptail(R)={[Rln⁡(Rmax⁡/Rmin⁡)]−1,Rmin⁡≤R≤Rmax⁡,0,otherwise.(84)p_{\mathrm{tail}}(R) = \begin{cases} [R\ln(R_{\max}/R_{\min})]^{-1}, & R_{\min}\le R\le R_{\max},\\ 0, & \text{otherwise}. \end{cases} \tag*{(84)}

In order to match the short-GRB offset phenomenology, we take

Rmed=4.2 kpc,σln⁡R=0.55,ftail=0.20,Rmin⁡=10 kpc,Rmax⁡=30 kpc,(85)\begin{aligned} R_{\mathrm{med}} &= 4.2\ \mathrm{kpc}, & \sigma_{\ln R} &= 0.55, & f_{\mathrm{tail}} &= 0.20,\\ R_{\min} &= 10\ \mathrm{kpc}, & R_{\max} &= 30\ \mathrm{kpc}, \tag*{(85)} \end{aligned}

which yields an overall population median of approximately 5.0 kpc and P(R>10 kpc)≃0.246P(R > 10\ \mathrm{kpc}) \simeq0.246.

With this selection of hosts, the validation sample contains 2,304 injections distributed across 64 host fields. For each host, we use one real science exposure in each of gg, rr, and ii, and inject 12 sources spanning the adopted magnitude interval into every filter image. The resulting sample therefore contains 768 realizations per filter. Figure 8(c) shows the residuals in each band, Δm=mrec−minj\Delta m = m_{\mathrm{rec}} - m_{\mathrm{inj}}, as a function of injected magnitude. The colored curves trace the running median in each band, and the shaded regions enclose the 16th–84th percentiles. Over the full sample, we find median ∣Δm∣=0.023|\Delta m| = 0.023 mag and RMS(Δm)=0.051(\Delta m) = 0.051 mag. For injections brighter than 20 mag, the recovery remains tight, with median ∣Δm∣=0.015|\Delta m| = 0.015 mag and RMS⁡(Δm)=0.025\operatorname{RMS}(\Delta m) = 0.025 mag. The scatter grows toward the faint end, reaching median ∣Δm∣=0.060|\Delta m| = 0.060 mag for 21≤minj≤2221 \le m_{\rm inj} \le22 mag. The gg and rr curves remain close to zero through most of the magnitude range, while the ii-band envelope is visibly broader, with median ∣Δm∣=0.036|\Delta m| = 0.036 mag and RMS⁡(Δm)=0.063\operatorname{RMS}(\Delta m) = 0.063 mag.

Figure 8. Validation of the image-injection operator on real ZTF science exposures. Panel (a) shows six representative epochs from the ZTF18abfhaji replay. The upper row contains the archival science stamps before injection, and the lower row contains the same scenes after adding the source. Headers give the time since the first detection and the prescribed band-specific apparent magnitude, mgm_g or mrm_r. Each stamp is displayed with an inverse-hyperbolic-sine stretch referenced to the robust sky noise. The sequential maps share a neutral low-surface-brightness range and transition toward the corresponding gg- or rr-band color for significant positive flux. One sky estimate and one display range are applied to each before-and-after pair, preserving their direct surface-brightness comparison. Panel (b) shows the complete observed gg- and rr-band light curve as open points. Filled circles identify the ten filter-balanced replay inputs, and crosses show the corresponding recovered magnitudes after injection at a position offset by 8″ from the cataloged transient. The replay gives median ∣Δm∣=0.019|\Delta m| = 0.019 mag and RMS⁡(Δm)=0.027\operatorname{RMS}(\Delta m) = 0.027 mag. Panel (c) shows the continuum injection-recovery test for 2,304 sources distributed across 64 host fields. Each host contributes 12 injections in each of gg, rr, and ii, giving 768 realizations per filter. Curves give the running median of Δm=mrec−minj\Delta m = m_{\mathrm{rec}} - m_{\mathrm{inj}}, and the shaded regions contain the central 68% of each local residual distribution. The full continuum sample has median ∣Δm∣=0.023|\Delta m| = 0.023 mag and RMS⁡(Δm)=0.051\operatorname{RMS}(\Delta m) = 0.051 mag. The ii-band sequence is broader because its sampled zero points yield fewer source electrons at fixed apparent magnitude.

The archival science image already contains its realized sky background, host-galaxy light, and detector noise. The injection therefore adds only the Poisson fluctuation associated with the artificial source. For a detector gain geg_e, expressed in electrons per data number, and a science-image zero point ZesciZ_e^{\rm sci}, the expected number of injected source electrons is

Ne,⋆=ge 10−0.4(minj−Zesci).(86)N_{e,\star} = g_e\,10^{-0.4(m_{\rm inj}-Z_e^{\rm sci})}. \tag*{(86)}

The corresponding source-counting contribution to the magnitude uncertainty scales approximately as σm≃(2.5/ln⁡10)Ne,⋆−1/2\sigma_m \simeq(2.5/\ln10)N_{e,\star}^{-1/2}. The median zero points of the sampled configurations are 26.14, 26.23, and 25.46 mag in gg, rr, and ii, respectively. At fixed minjm_{\rm inj}, the ii-band realizations consequently contain fewer source electrons and exhibit a broader Poisson residual distribution.

Replay of a real transient light curve

We perform a second validation using the observed ZTF light curve of ZTF18abfhaji as the empirical input sequence. Its light curve contains 37 usable detections across gg and rr, covering the rise, maximum, and decline over approximately 60 d. We select 10 detections at approximately uniform temporal quantiles within each filter, giving five replay epochs in gg and five in rr. For each selected detection we identify an archival science exposure in the same filter and require temporal agreement at the level of ∣Δt∣<0.03|\Delta t| < 0.03 d. The replayed source is injected at a nearby position offset by 8″ from the cataloged source coordinates, which prevents flux from the original transient entering the recovery measurement while retaining the exposure-specific background, zero point, and PSF.

The recovered magnitudes reproduce the replay inputs with median ∣Δm∣=0.019|\Delta m| = 0.019 mag and RMS⁡(Δm)=0.027\operatorname{RMS}(\Delta m) = 0.027 mag. Figure 8(a) shows six representative archival science stamps and their post-injection realizations. Figure 8(b) places all ten replay measurements on the full observed light curve. The individual residuals lie in the interval −0.025≤Δm≤0.069-0.025 \le\Delta m \le0.069 mag, with no monotonic drift across the sampled phase range. This agreement verifies that exposure-specific zero points and PSFs preserve the prescribed time-dependent flux when the operator is applied across independent visits and both filters.

Taken together, these tests show few-hundredths-of-a-magnitude recovery for bright and moderate-signal-to-noise ratio (SNR) sources, while the full 18≤minj≤2218 \le m_{\rm inj} \le22 mag continuum experiment has an RMS of 0.051 mag. The widening residual distribution at the faint end follows the Ne,⋆−1/2N_{e,\star}^{-1/2} dependence of source-counting noise. The pre-existing sky and host realization cancels in Deinj\mathbf{D}_e^{\rm inj}, so this closure test directly validates the astrometric placement, PSF normalization, AB magnitude conversion, and numerical stamp construction. Additional effects introduced by image subtraction, imperfect PSF estimation, correlated backgrounds, and alert-selection thresholds remain associated with the downstream survey processing.

Photometry

In order to validate the photometric predictions from our kilonova light curve emulator, we evaluate the model on a different set of light curves presented in M. Ristic et al. [87] that were not a part of the original training grid. Same as the original grid, these points can be found in R. Wollaeger et al. (2021). We compare the light curves predicted by the emulator to the truth light curves at the same intrinsic parameters to evaluate performance on points within the parameter space not seen during training. This section evaluates how well the model generalizes across the parameter space.

In Figure 9, we show the original grid points and the 66 new grid points used. Each of these grid points is also evaluated on a range of ν\nu values, specifically 54 evenly spaced bins between 0∘0^\circ and 180∘180^\circ. Of the additional simulations available for validation, we select the points on the interior of the grid, as to not directly overlap with existing points or validate on the boundary of our parameter space.

Figure 9. Coverage of the four-dimensional intrinsic-parameter space used for the photometric-surrogate evaluation. Green triangles mark the original training-grid nodes, and red circles mark the 66 validation nodes. All of the validation nodes are located to the interior of a 2% margin on the edge of the parameter space to avoid edge cases. Off-diagonal panels show pairwise projections in log⁡10Mejdyn\log_{10} M_{\mathrm{ej}}^{\mathrm{dyn}}, vejdynv_{\mathrm{ej}}^{\mathrm{dyn}}, log⁡10Mejwind\log_{10} M_{\mathrm{ej}}^{\mathrm{wind}}, and vejwindv_{\mathrm{ej}}^{\mathrm{wind}}. Diagonal panels show the marginal distributions of the selected configurations. Viewing angle is not shown here; each selected configuration is subsequently evaluated at the 54 available viewing angles.

Figure 10 shows how surrogate accuracy depends on viewing angle and on the agreement between predicted and true magnitude across the validation set. Panel (a) shows the mean squared error (MSE) between predicted and true AB magnitude as a function of viewing angle ν\nu, for each of the three ZTF bands, evaluated over all available configurations at all 54 viewing angles and restricted to the first 10 days after merger. The errors increase substantially near equatorial viewing angles, ι≈90∘\iota\approx90^\circ. Appendix § 10 examines this near-equatorial region further, with representative light curves and ejecta parameters for the eight configurations with the highest mean MSE. The equatorial viewing angles combined with low mass ejecta values produce the faintest of light curves, and that is where our simulations break down. It is, however, unlikely a kilonova in this parameter space would be detectable. Panel (b) shows the corresponding predicted-versus-true absolute-magnitude scatter for the 66 selected validation configurations, colored by time since explosion; the dashed line marks perfect agreement. Over this selected sample we find median ∣Δmsurr∣=0.323|\Delta m_{\mathrm{surr}}| = 0.323 mag and RMS⁡(Δmsurr)=0.763\operatorname{RMS}(\Delta m_{\mathrm{surr}}) = 0.763 mag, where Δmsurr≡mpred−mtrue\Delta m_{\mathrm{surr}} \equiv m_{\mathrm{pred}} - m_{\mathrm{true}}.

Figure 10. Photometric-surrogate accuracy in the three ZTF bands (gg, rr, ii), restricted to the first 10 days after explosion. (a) Mean squared error between predicted and true AB magnitude versus viewing angle ι\iota, evaluated over all available nodes at 54 viewing angles. Accuracy degrades sharply near edge-on viewing angles (ι≈89∘\iota\approx89^\circ–91∘91^\circ). (b) Predicted versus true absolute magnitude for the 66 selected interior configurations of Figure 9, evaluated at all 54 available viewing angles, colored by time since explosion; the dashed line marks perfect agreement. Among these 66 configurations, the one with the largest mean MSE, averaged across the three ZTF bands, reaches 53.2 mag2^2 at ι≈88.9∘\iota\approx88.9^\circ. Axis limits are cropped to the 0.5–99.5 percentile range of the combined predicted and true magnitude distribution to exclude a small number of numerically degenerate points at near-zero flux. Over this selected sample we find median ∣Δmsurr∣=0.323\lvert\Delta m_{\mathrm{surr}}\rvert= 0.323 mag and RMS(Δmsurr\Delta m_{\mathrm{surr}}) = 0.763 mag.

Figure 11 shows a representative light curve comparison illustrating the median-level agreement reported above. To select this example, we score each intrinsic-parameter–viewing-angle pair in the selected subset by its mean squared error averaged across the three ZTF bands over the first 10 days, sort all pairs by this score, and select the middle-ranked pair; this is distinct from the pointwise median absolute residual quoted above. Solid curves show the surrogate prediction and dashed curves show the true SuperNu light curve, in matching colors for each of the three ZTF bands.

Figure 11. Surrogate-predicted (solid) and SuperNu (dashed) absolute-magnitude light curves for the median MSE intrinsic-parameter–viewing-angle pair from the 66 selected configurations shown in Figure 9. This example represents median performance according to the adopted curve-level MSE ranking; it is not a median location in the physical parameter space.

Spectra

We validate the emulator against LANLTP2 simulations that were excluded at the level of the complete ejecta configuration. This grouping is required because the 66 epochs and 27 viewing directions generated by one radiative-transfer simulation share the same ejecta structure and form a highly correlated sequence. A split performed on individual spectra would place different projections of the same physical calculation in fitting and evaluation samples. We assign the 637 available ejecta configurations to five disjoint folds in V\mathcal{V}. Folds 2, 3, and 4 are used to fit the emulator, fold 0 is used to select the model and training checkpoint, and fold 1 is reserved for the results in this section. The reserved sample contains 128 previously unseen ejecta configurations and 228,096 individual spectra. Forty-five configThe 69 configurations lie on the Cartesian parameter grid. The other 83 are independent LANLTP2 calculations at irregular parameter locations, selected through active learning as presented in M. Ristic et al. [87], which test interpolation away from the regular grid nodes.

For each simulated spectrum and emulator prediction, we measure the normalized shape error and the integrated physical flux error

Eshape=∑j∣p^j−pj∣,Eflux=∑j∣L^bolLbolp^j−pj∣.(87)E_{\mathrm{shape}} = \sum_j \left|\hat{p}_j-p_j\right|,\qquad E_{\mathrm{flux}} = \sum_j \left|\frac{\hat{L}_{\mathrm{bol}}}{L_{\mathrm{bol}}}\hat{p}_j-p_j\right| . \tag*{(87)}

where pjp_j is defined in Equation (2). The first statistic lies between zero and two and measures redistribution of normalized spectral energy. The second in cludes the error in bolometric luminosity and measures the wavelength-integrated absolute flux discrepancy. We also measure the location of the broad maximum in λfλ\lambda f_\lambda, the optical to near-infrared color, and the relative luminosity error. Logarithmic flux residuals are evaluated in bins satisfying fλ,jLANLTP2>10−3max⁡kfλ,kLANLTP2f_{\lambda,j}^{\mathrm{LANLTP2}} > 10^{-3}\max_k f_{\lambda,k}^{\mathrm{LANLTP2}} for each spectrum. This threshold retains 67.5% of all wavelength bins and removes Monte Carlo zeros and negligible-flux regions from a statistic that is undefined at zero flux. The integrated errors in Equation (87) use every wavelength bin.

Across the reserved sample, the mean EshapeE_{\mathrm{shape}} is 0.0465. A bootstrap that resamples complete ejecta configurations gives a 95% confidence interval from 0.0437 to 0.0494, and the 95th percentile over individual spectra is 0.1096. The mean EfluxE_{\mathrm{flux}} is 0.0555. The median relative luminosity error is 0.0203, and its 95th percentile is 0.0899. Within the significant-flux mask, the median spectrum has a median absolute log-flux error of 0.0215 dex, corresponding to a flux ratio of approximately 1.05. The median optical to near-infrared color error is 0.0123 dex, or 0.031 mag. The median displacement of the broad λfλ\lambda f_\lambda maximum is 0.0021 dex in wavelength. Its 95th percentile reaches 0.0741 dex because two broad maxima with similar heights can exchange order under a comparatively small flux perturbation.

Figure 12 follows one ejecta configuration through six epochs at μ=0.50\mu= 0.50. We selected the configuration before plotting as the reserved simulation whose mean EshapeE_{\mathrm{shape}}, averaged over all epochs and viewing directions, lies closest to the median among the 128 test simulations. The comparison therefore represents typical model-level performance. The emulator follows the initial blue suppression, the movement of the spectral energy distribution toward longer wavelengths, and the broad optical and near-infrared structures. The largest difference in this sequence occurs at 0.125 d, when the spectral morphology evolves most rapidly. At later epochs, visible discrepancies are concentrated in low-flux regions and in the detailed shapes of broad blended features.

Figure 12. Simulated LANLTP2 spectra and emulator reconstructions for an ejecta configuration excluded from fitting and model selection. The physical parameters are Md=0.0577 M⊙M_d = 0.0577\,M_\odot, vd=0.051cv_d = 0.051c, Mw=0.0218 M⊙M_w = 0.0218\,M_\odot, and vw=0.116cv_w = 0.116c. Six epochs are shown at μ=0.50\mu= 0.50. The configuration was selected as the reserved simulation whose mean shape error lies closest to the median among all test simulations. The simulated spectra are plotted without smoothing or renormalization. The labels above the panels report the integrated normalized shape error from Equation (87).

Figure 13 locates the population residuals in wavelength and time. The median signed residual stays close to zero across most wavelength and time combinations that carry appreciable flux. The median absolute residual is smallest through much of the optical and near-infrared evolution after the first few tenths of a day. The early spectra and wavelength regions containing rapidly changing broad structures produce the most prominent residuals. At 0.125 d, the median EshapeE_{\rm shape} is 0.0827 and the 90th percentile is 0.2198. The time-dependent median reaches 0.0329 at 0.771 d and remains near that level through much of the subsequent evolution. Panel (a) identifies coherent color bias, while panels (b) and (c) separate the typical residual from the difficult upper tail.

Figure 13. Population distribution of log⁡10(fλemu/fλLANLTP2)\log_{10}(f_\lambda^{\mathrm{emu}}/f_\lambda^{\mathrm{LANLTP2}}) over the 228,096 spectra in the reserved test sample. Panel (a) shows the median signed residual, panel (b) shows the median absolute residual, and panel (c) shows the 90th percentile of the absolute residual as functions of rest-frame wavelength and time after merger. Bins below 10−310^{-3} of the maximum simulated fλf_\lambda in each spectrum are excluded before computing the population quantiles.

The diagnostics in Figure 14 examine the two quantities that determine the reconstructed physical flux. Panel (a) compares the emulated and native bolometric luminosities for every spectrum in the reserved sample. This quantity supplies the amplitude that converts p^j\hat{p}_j into physical flux through Equation (3). The density remains concentrated around the one-to-one relation over the full luminosity range sampled by LANLTP2.

Figure 14. Population diagnostics for the held-out LANLTP2 simulations. Panel (a) compares emulated and simulated log⁡10Lbol\log_{10} L_{\mathrm{bol}} for all 228,096 test spectra. Panel (b) compares log⁡10p^j\log_{10}\hat{p}_j and log⁡10pj\log_{10}p_j for 2,048,000 wavelength samples drawn equally from the 128 reserved ejecta configurations and restricted to bins with native fλf_\lambda above 10−310^{-3} of the maximum for that spectrum. In both panels, color gives the number of samples in each hexagonal bin and the dashed line marks exact reconstruction. The displayed shape range contains the central 99.9% of the combined native and emulated sample. Panels (c) and (d) give the median and 90th percentile of EshapeE_{\mathrm{shape}}, respectively, across the 128 complete held-out ejecta configurations at each fixed combination of time and viewing angle. The largest errors occur at the earliest epochs, while the two-dimensional representation resolves the weaker angular structure and its evolution with time.

Panel (b) directly examines the normalized spectral shape. Each point contributing to this density is a simulated and emulated pair (pj,p^j)(p_j,\hat{p}_j) for the same wavelength bin of the same spectrum. We restrict the comparison to bins satisfying fλ,jLANLTP2>10−3max⁡kfλ,kLANLTP2f_{\lambda,j}^{\rm LANLTP2} > 10^{-3}\max_k f_{\lambda,k}^{\rm LANLTP2}, consistent with the significant-flux mask used for the logarithmic residuals. We then draw 16,000 wavelength samples from each reserved ejecta configuration, with all epochs and viewing directions eligible, for a total of 2,048,000 pairs. Equal sampling by ejecta configuration prevents a subset of physical models from dominating the density. The logarithmic axes resolve both the high-probability spectral peaks and lower-probability structure over several orders of magnitude. The median absolute value of log⁡10(p^j/pj)\log_{10}(\hat{p}_j/p_j) is 0.0202 dex, and its 90th percentile is 0.0935 dex. In bins with pj≥10−3p_j \ge10^{-3}, which individually carry the largest fractions of spectral energy, these values decrease to 0.0126 and 0.0440 dex. The increasing dispersion toward smaller pjp_j is visible in

the density. The display limits contain the central 99.9% of the combined native and emulated sample.

Panels (c) and (d) examine the joint dependence of EshapeE_{\rm shape} on time and viewing angle. Each cell gives a quantile across the 128 reserved ejecta configurations at one fixed pair (t,μ)(t,\mu). The construction therefore preserves correlations between epoch and line of sight without treating the 66 epochs or 27 angular projections from one radiative-transfer calculation as independent members of the test population. At 0.125 d, the median varies from 0.0719 to 0.1005 across viewing angle, while the 90th percentile varies from 0.2084 to 0.2396. Both statistics decline rapidly over the next several epochs. Through much of the subsequent evolution, the median lies between approximately 0.03 and 0.045, with angular structure that remains smaller than the early-time degradation. The mean model-averaged EshapeE_{\rm shape} is 0.0467 for Cartesian-grid calculations and 0.0464 for the irregularly placed simulations, which supports interpolation away from the regular grid nodes.

Taken together, the four panels show that the population mean is not produced by compensating errors between luminosity and spectral shape. The luminosity reconstruction remains close to the identity relation, the significant-flux wavelength bins follow the corresponding identity relation in pjp_j, and the time and viewing-angle maps locate the residual upper tail at the earliest epochs. The agreement between the mean errors for Cartesian-grid and irregularly placed simulations also indicates that the test result is not confined to interpolation between adjacent nodes of the original regular grid. These diagnostics assess numerical fidelity to LANLTP2. They do not incorporate uncertainty in the radiative-transfer physics, atomic data, ejecta geometry, or composition.

Comparison to GW170817

Light curves

We now compare our simulations to observations of AT2017gfo ([96, 3] (Coulter et al. 2017)), the kilonova associated with the binary neutron star merger GW170817 ([4]). In order to do so, we start with the maximum likelihood parameters of AT2017gfo from B. L. King et al. [60], and generate light curves using the above workflow, sampling realistic ZTF observations. In addition, we simulate a varied set of kilonova light curves within the distance uncertainty of GW170817, specifically between 26 and 48 Mpc as originally measured in [4]. This set is meant to show a realistic credible interval for GW170817-like neutron star mergers. Figure 15 shows this comparison, with circle markers and the solid lines denoting the simulated maximum likelihood light curves, the diamond markers showing AT2017gfo, and the shaded region showing the 90% credible interval for simulated kilonovae within the measured distance uncertainty. We find the AT2017gfo observations are consistent with both the maximum likelihood and credible interval simulations, providing a sanity check of our methods.

Figure 15. A comparison of AT2017gfo to simulated ZTF observations. The circle markers show the simulated ZTF observations and the solid lines are the accompanying light curves the individual observations are drawn from. The light curves are simulated using the maximum likelihood AT2017gfo parameters found in B. L. King et al. [60]. The shaded region corresponds to the 90% credible interval for a set of simulated kilonova light curves as seen by ZTF within the measured distance uncertainty of GW170817. The diamond markers show the AT2017gfo observations in ps1 bands [96, 3] (Coulter et al. 2017).

Spectrum

The time-resolved spectrum of AT2017gfo provides an external test of the spectral data-generation model. We use the public ENGRAVE reduction of the VLT/X-shooter sequence2 originally presented by E. Pian et al. [82] and S. J. Smartt et al. [96]. The sequence spans 1.43 to 10.40 days after merger and covers the optical and near-infrared wavelength range. The released products have been flux calibrated, adjusted to contemporaneous photometry, corrected for Milky Way extinction, and transformed to a rest-frame wavelength coordinate. We retain their released flux-density normalization. The observed phases are converted to the source frame using trf=tobs/(1+z)t_{\rm rf}=t_{\rm obs}/(1+z), with z=0.009783z=0.009783. We evaluate the emulator at the maximum-likelihood LANLTP2 parameters used for the photometric comparison from B. L. King et al. [60]: Md=0.040 M⊙M_{\rm d}=0.040\,M_\odot, vd=0.27cv_{\rm d}=0.27c, Mw=0.028 M⊙M_{\rm w}=0.028\,M_\odot, vw=0.07cv_{\rm w}=0.07c, and ι=0.75\iota=0.75 rad. These values define the central prediction at every epoch, with DL=44D_{\rm L}=44 Mpc. The shaded region propagates the measured 26 to 48 Mpc distance range together with the 90% inclination interval 0.42≤ι≤0.950.42\leq\iota\leq0.95 rad reported by B. L. King et al. [60]. The envelope includes the changes in luminosity, color, and broad spectral morphology produced by these distance and viewing-angle ranges. No parameter is optimized against the spectra. This prescription makes the spectral sequence a predictive check of the physical realization already selected from the photometry.

Figure 16 also includes the HST G102 and G141 grism spectra at 4.9 and 7.3 days reported by N. R. Tanvir et al. [101] and distributed with the ENGRAVE release. Their integrated-flux ratios relative to the neighboring X-shooter spectra are 1.02 and 0.90 over the common wavelength intervals, with normalized shape errors of 0.092 and 0.139. The agreement supports the broad near-infrared morphology measured from the ground-based sequence. The released HST products were aligned to the contemporaneous photometry or X-shooter sequence, so they provide a cross-instrument check of spectral shape rather than an independent absolute calibration.

Figure 16. Multiepoch comparison of the LANLTP2 spectral emulator with the public spectra of AT2017gfo from 1.43 to 7.40 days after merger. Black curves show VLT/X-shooter observations at the labeled phases. Blue curves show the HST/WFC3 grism spectra at 4.9 and 7.3 days, plotted in the panels containing the nearest X-shooter epochs. Green curves show the emulator evaluated at the maximum-likelihood parameters from B. L. King et al. [60], with ι=0.75\iota= 0.75 rad and DL=44D_L = 44 Mpc. The shaded region shows the range of simulated spectra obtained by varying the luminosity distance over the measured 26 to 48 Mpc interval and the inclination over its 90% credible interval, 0.42≤ι≤0.950.42 \le\iota\le0.95 rad. No spectral parameters or wavelength-dependent corrections are fitted to the observations. Gaps in the X-shooter curves mark arm joins and wavelength intervals affected by strong telluric absorption.

For a common numerical comparison, each X-shooter spectrum is rebinned onto the emulator wavelength grid by integrating the densely sampled observed flux density within each wavelength bin and dividing by the covered bin width. This flux-conserving average treats the emulator output as a bin-averaged flux density. We retain rest-frame wavelengths from 0.35 to 2.25 μ\mum, and omit the joins between the three X-shooter arms together with the principal regions of strong telluric absorption. Let Bt\mathcal{B}_t denote the set of retained wavelength bins at epoch tt. The integrated flux within this common band and its normalized spectral distribution are

FtX=∑j∈Btfλ,t,jXΔλj,pt,jX=fλ,t,jXΔλjFtX,(88)F_t^X=\sum_{j\in\mathcal{B}_t}f_{\lambda,t,j}^X\Delta\lambda_j,\qquad p_{t,j}^X=\frac{f_{\lambda,t,j}^X\Delta\lambda_j}{F_t^X}, \tag*{(88)}

where X∈{obs,emu}X\in\{\mathrm{obs},\mathrm{emu}\}. We summarize the absolute renormalization with RF(t)=Ftemu/FtobsR_F(t)=F_t^{\mathrm{emu}}/F_t^{\mathrm{obs}}, and the wavelength redistribution with

Eshapeobs(t)=∑j∈Bt∣pt,jemu−pt,jobs∣.(89)E_{\mathrm{shape}}^{\mathrm{obs}}(t)=\sum_{j\in\mathcal{B}_t}\left|p_{t,j}^{\mathrm{emu}}-p_{t,j}^{\mathrm{obs}}\right|. \tag*{(89)}

This definition matches the normalized shape statistic used for held-out LANLTP2 calculations in Equation (87), with the sum restricted to the wavelength coverage supported by each observation.

The absolute flux of this fixed LANLTP2 realization lies close to the observed scale. At 44 Mpc, the median value of RFR_F is 1.064, with individual values from 0.830 to 1.931. The distance that would match the band-integrated flux at each epoch ranges from 40.1 to 61.1 Mpc. Between 5.40 and 9.40 days, the central prediction lies within 18% of the observed integrated flux. The earliest spectra show the largest excess in total flux. The median absolute physical log-flux residual in the retained wavelength bins is 0.161 dex. The envelope in Figure 16 combines the distance dependence with the additional variation in normalization and spectral shape induced by the allowed viewing angles.

The normalized spectra agree most closely during the middle of the sequence. The median EshapeobsE_{\mathrm{shape}}^{\mathrm{obs}} is 0.340, and the range is 0.203 to 0.596. The median absolute logarithmic residual after normalization is 0.153 dex. From 3.41 to 6.40 days, EshapeobsE_{\mathrm{shape}}^{\mathrm{obs}} remains between 0.203 and 0.249. During these epochs the model follows the progressive suppression of optical emission and the movement of the broad maximum toward the near-infrared, although the location and contrast of individual structures differ. The median absolute residual in the optical to near-infrared flux ratio is 0.286 dex, corresponding to 0.72 mag. Its sign changes with time: the emulated spectrum is relatively bluer through 4.40 days and becomes increasingly red relative to the observations at later epochs.

The earliest and latest spectra expose more specific limitations. At 1.43 days, the observed broad maximum lies near 0.62 μm\mu\mathrm{m}, while the model maximum occurs near 0.41 μm\mu\mathrm{m}, and Eshapeobs=0.513E_{\mathrm{shape}}^{\mathrm{obs}} = 0.513. After approximately six days, the observed sequence develops a broad maximum near 2.03 to 2.10 μm\mu\mathrm{m}. Analyses of the complete AT2017gfo sequence identify strong emission-like structure near 1.58 and 2.07 μm\mu\mathrm{m} during these phases [42]. The LANLTP2 prediction places its broad maximum between 1.26 and 1.48 μm\mu\mathrm{m} and does not reproduce the observed late-time 2.1 μm2.1\,\mu\mathrm{m} structure. The shape error consequently rises to 0.596 at 9.40 days.

Those tensions are consistent with the discrepancies reported when the underlying radiative-transfer simulated spectra were compared directly with AT2017gfo (R. T. Wollaeger et al. 2021). After first restricting the grid using broadband information, R. T. Wollaeger et al. (2021) ranked candidate calculations through an error in bolometric luminosity. Their lowest-error example produced a broad absorption structure between 1 and 2 μm2\,\mu\mathrm{m} at day 5 that was absent from the X-shooter spectrum. Models with high-YeY_e ejecta velocities above 0.05c0.05c were also systematically faint in the optical by that epoch, and the late-time calculations developed a spectral cliff that was not present in AT2017gfo. These examples suggest that models selected through broadband criteria can retain large, coherent wavelength-dependent errors. Consistency in bolometric luminosity does not by itself establish consistency in the spectrum shape.

Figure 16 complements the reserved-simulation validation in § 5.3. The reserved calculations measure how faithfully the numerical emulator reconstructs the LANLTP2 radiative-transfer library. The AT2017gfo comparison measures how closely one member of that library, selected by the photometric maximum-likelihood solution, describes a real kilonova. The corrected absolute normalization is broadly consistent with the data, particularly from approximately four to nine days. The wavelength-dependent residuals remain much larger than the emulator errors measured against held-out LANLTP2 calculations, and they have a coherent temporal evolution. Their character agrees with the limitations documented for the original grid. A joint spectroscopic fit could move to a different location in the ejecta parameter space. The restricted physical assumptions of the library would remain. These sources of physical model uncertainty should be represented when synthetic spectra are used to train parameter-estimation models for observed kilonovae.

Discussion

In this work we present a pipeline for the simulation of multi-modal observations of kilonovae with ZTF. Realistic photometry, images, and spectra are generated using kilonova models and observed survey distributions. Together, these three data types are representative of the electromagnetic observations that may be available for candidate kilonovae, and constitute a dataset capable of training AI models intended for kilonova classification, identification, and parameter estimation. We validate our simulation methods and find they accurately produce realistic survey detections consisting of images, spectra, and photometry.

We intend for our methods and simulated data to be used to predict what future kilonova observations may look like, as well as for training models, both of which may improve our chances of making the next kilonova detection. Our methods freely generalize to other observatories and surveys, especially the LSST all-sky survey conducted by the Vera C. Rubin Observatory. In the future, we will improve our methodology to produce joint observations between ZTF and Vera C. Rubin.

ACKNOWLEDGMENTS

We thank Ingo Tews, Niharika Sravan, and Natalya Pletskova for helpful discussions. This work was supported by the U.S. Department of Energy through Los Alamos National Laboratory (LANL). LANL is operated by Triad National Security, LLC, for the National Nuclear Security Administration of U.S. Department of Energy (Contract No. 89233218CNA000001). F.F.N., F.T., L.L.J. S.C., and S.D. were supported by the Laboratory Directed Research and Development program of Los Alamos National Laboratory project 20250750ECR. A.T. acknowledges support from the Director’s Postdoc Fellowship at Los Alamos National Laboratory funded by the Laboratory Directed Research and Development Program project number 20251157PRD2. F.F.N. and M.W.C. acknowledge support from the National Science Foundation with grant numbers PHY-2117997, PHY-2308862 and PHY-2409481. This research used resources of the National Energy Research Scientific Computing Center, a DOE Office of Science User Facility supported by the Office of Science of the U.S. Department of Energy under Contract No. DE-AC02-05CH11231 using NERSC award NP-ERCAP0037764. This research also used resources provided by the Los Alamos National Laboratory Institutional Computing Program, which is supported by the U.S. Department of Energy National Nuclear Security Administration under Contract No. 89233218CNA000001. SED Machine is based upon work supported by the National Science Foundation under Grant No. 1106171. The Gordon and Betty Moore Foundation, through both the Data-Driven Investigator Program and a dedicated grant, provided critical funding for SkyPortal. The authors used AI-assisted tools (ChatGPT 6.1 Sol and Claude Sonnet 5.5) for translation, grammar correction, and proofreading during manuscript preparation.

Software: Astropy ([13, 14, 15]), CIGALE ([24]), HyperGal ([67]), Matplotlib ([50]), NumPy ([47]), pandas ([108]), PyTorch ([79]), reproject ([88]), scikit-learn ([80]), SciPy ([105]), SEP ([17, 21]), SuperNu ([111, 110]), TensorFlow ([1])

Appendix

High-MSE light curves near equatorial viewing angles

Figure 10 in § 5.2 shows that surrogate accuracy degrades sharply near ι≈90∘\iota\approx90^\circ. Figure 17 shows the light curves predicted with the emulator for the three training grid points with the largest mean MSE in the ZTF gg band. The low mass ejecta grid points with ι≈90∘\iota\approx90^\circ are the culprit, which is also consistent with the intrinsic parameters of the highest MSE validation points. As seen in Figure 17 the grid points used for training have nonphysical features, specifically sharp and rapid declines, in their light curves for this regime, which leads to the high MSE. This is caused we approach the faintest edge of the parameter space, and the simulations we rely on lose fidelity. The emulator predictions do however remain more smooth in agreement with the rest of the parameter space. Regardless, it is unlikely to observe an off-axis, extremely low mass ejecta kilonova, as it will be very faint. All three lie within 5∘5^\circ of the equator (ι≈86∘\iota\approx86^\circ–92∘92^\circ). Under a uniform, angle-independent null, only 8×(20/180)≈0.98 \times(20/180) \approx0.9 of the eight worst-fitting nodes would be expected in this window by chance. The predicted and true light curves in this region show non-smooth, irregular structure that the flux-based surrogate does not reproduce, which is the direct source of the elevated MSE.

Figure 17. Surrogate-predictions (dashed) and training grid points (solid) absolute-magnitude light curves for the three highest mean MSE training grid points, all near (ι=90∘\iota= 90^\circ). Panel titles report the viewing angle and ejecta configurations for each case. These non-smooth light curve shapes near the equatorial viewing angle are the origin of the high-MSE region identified in Figure 10a.

References

  1. [1]Abadi, M., Agarwal, A., Barham, P., et al. 2015, TensorFlow: Large-Scale Machine Learning on Heterogeneous Systems, https://www.tensorflow.org/arxiv.org/abs/1603.04467
  2. [3]Abbott, B. P., et al. 2017a, Astrophys. J. Lett., 848, L13, doi: 10.3847/2041-8213/aa920cDOI
  3. [4]Abbott, B. P., et al. 2017b, Nature, 10.1038/nature24471. https://arxiv.org/abs/1710.05835
  4. [6]Ahumada, T., et al. 2024, Publ. Astron. Soc. Pac., 136, 114201, doi: 10.1088/1538-3873/ad8265DOI
  5. [7]Almualla, M., et al. 2021, Mon. Not. Roy. Astron. Soc., 504, 2822, doi: 10.1093/mnras/stab1090DOI
  6. [8]Alsing, J., Peiris, H., Leja, J., et al. 2020, The Astrophysical Journal Supplement Series, 249, 5, doi: 10.3847/1538-4365/ab917fDOI
  7. [9]Andrade, C., Alserkal, R., Manzano, L. S., et al. 2025, https://arxiv.org/abs/2502.14124
  8. [10]Andreoni, I., et al. 2021, Astrophys. J., 918, 63, doi: 10.3847/1538-4357/ac0bc7DOI
  9. [11]Andreoni, I., et al. 2024, Astropart. Phys., 155, 102904, doi: 10.1016/j.astropartphys.2023.102904DOI
  10. [13]Astropy Collaboration, Robitaille, T. P., Tollerud, E. J., et al. 2013, A&A, 558, A33, doi: 10.1051/0004-6361/201322068
  11. [14]Astropy Collaboration, Price-Whelan, A. M., Sipöcz, B. M., et al. 2018, AJ, 156, 123, doi: 10.3847/1538-3881/aabc4f
  12. [15]Astropy Collaboration, Price-Whelan, A. M., Lim, P. L., et al. 2022, ApJ, 935, 167, doi: 10.3847/1538-4357/ac7c74DOI
  13. [16]Baker, T., Bellini, E., Ferreira, P. G., et al. 2017, Phys. Rev. Lett., 119, 251301, doi: 10.1103/PhysRevLett.119.251301DOI
  14. [17]Barbary, K., Boone, K., McCully, C., et al. 2016, kbarbary/sep: v1.0.0, Zenodo, doi: 10.5281/ZENODO.159035
  15. [18]Bellm, E. C., Kulkarni, S. R., Graham, M. J., et al. 2018, Publications of the Astronomical Society of the Pacific, 131, 018002, doi: 10.1088/1538-3873/aaecbeDOI
  16. [19]Berger, E. 2010, Astrophys. J., 722, 1946, doi: 10.1088/0004-637X/722/2/1946DOI
  17. [20]Berry, C. P. L., Mandel, I., Middleton, H., et al. 2015, Astrophys. J., 804, 114, doi: 10.1088/0004-637X/804/2/114DOI
  18. [21]Bertin, E., & Arnouts, S. 1996, Astron. Astrophys. Suppl. Ser., 117, 393, doi: 10.1051/aas:1996164DOI
  19. [22]Blagorodnova, N., Neill, J. D., Walters, R., et al. 2018, PASP, 130, 035003, doi: 10.1088/1538-3873/aaa53fDOI
  20. [23]Bloemen, S., Groot, P., Nelemans, G., & Klein-Wolt, M. 2015, in Astronomical Society of the Pacific Conference Series, Vol. 496, Living Together: Planets, Host Stars and Binaries, ed. S. M. Rucinski, G. Torres, & M. J. Zejda, 254
  21. [24]Boquien, M., Burgarella, D., Roehlly, Y., et al. 2019, A&A, 622, A103, doi: 10.1051/0004-6361/201834156DOI
  22. [25]Bulla, M. 2019, Monthly Notices of the Royal Astronomical Society, 489, 5037, doi: 10.1093/mnras/stz2495DOI
  23. [26]Bulla, M., Coughlin, M. W., Dhawan, S., & Dietrich, T. 2022, Universe, 8, 289, doi: 10.3390/universe8050289DOI
  24. [27]Chambers, K. C., Magnier, E. A., Metcalfe, N., et al. 2016, arXiv E-prints, arXiv:1612.05560, doi: 10.48550/arXiv.1612.05560DOI
  25. [28]Cornish, N. J., & Littenberg, T. B. 2015, Classical and Quantum Gravity, 32, 135012. http://stacks.iop.org/0264-9381/32/i=13/a=135012
  26. [29]Coughlin, M. W., Dietrich, T., Heinzel, J., et al. 2020, Phys. Rev. Res., 2, 022006, doi: 10.1103/PhysRevResearch.2.022006DOI
  27. [31]Creminelli, P., & Vernizzi, F. 2017, Phys. Rev. Lett., 119, 251302, doi: 10.1103/PhysRevLett.119.251302DOI
  28. [32]Czekala, I., Andrews, S. M., Mandel, K. S., Hogg, D. W., & Green, G. M. 2015, The Astrophysical Journal, 812, 128, doi: 10.1088/0004-637X/812/2/128
  29. [33]Darc, P., Bom, C. R., Fraga, B., & Kilpatrick, C. D. 2024, The Astrophysical Journal, 971, 82, doi: 10.3847/1538-4357/ad53c7
  30. [34]Dietrich, T., Coughlin, M. W., Pang, P. T. H., et al. 2020, Science, 370, 1450, doi: 10.1126/science.abb4317DOI
  31. [35]Essick, R., Vitale, S., Katsavounidis, E., Vedovato, G., & Klimenko, S. 2015, The Astrophysical Journal, 800, 81. http://stacks.iop.org/0004-637X/800/i=2/a=81
  32. [36]Ezquiaga, J. M., & Zumalacárregui, M. 2017, Phys. Rev. Lett., 119, 251304, doi: 10.1103/PhysRevLett.119.251304DOI
  33. [37]Fairhurst, S. 2009, New J. Phys., 11, 123006, doi: 10.1088/1367-2630/11/12/123006DOI
  34. [38]Fairhurst, S. 2011, Class. Quant. Grav., 28, 105021, doi: 10.1088/0264-9381/28/10/105021DOI
  35. [39]Fong, W., & Berger, E. 2013, Astrophys. J., 776, 18, doi: 10.1088/0004-637X/776/1/18DOI
  36. [40]Fong, W.-f., Berger, E., Chornock, R., et al. 2013, Astrophys. J., 769, 56, doi: 10.1088/0004-637X/769/1/56DOI
  37. [41]Fong, W.-f., et al. 2022, Astrophys. J., 940, 56, doi: 10.3847/1538-4357/ac91d0DOI
  38. [42]Gillanders, J. H., Sim, S. A., Smartt, S. J., Goriely, S., & Bauswein, A. 2024, Mon. Not. Roy. Astron. Soc., 529, 2918, doi: 10.1093/mnras/stad3688DOI
  39. [43]Goldstein, A., et al. 2017, Astrophys. J. Lett., 848, L14, doi: 10.3847/2041-8213/aa8f41DOI
  40. [44]Goldstein, D. A., D’Andrea, C. B., Fischer, J. A., et al. 2015, Astron. J., 150, 82, doi: 10.1088/0004-6256/150/3/82DOI
  41. [45]Graham, M. J., Kulkarni, S. R., Bellm, E. C., et al. 2019, Publications of the Astronomical Society of the Pacific, 131, 078001, doi: 10.1088/1538-3873/ab006cDOI
  42. [46]Grover, K., Fairhurst, S., Farr, B. F., et al. 2014, Phys. Rev., D89, 042004, doi: 10.1103/PhysRevD.89.042004DOI
  43. [47]Harris, C. R., Millman, K. J., van der Walt, S. J., et al. 2020, Nature, 585, 357, doi: 10.1038/s41586-020-2649-2DOI
  44. [48]Hesthaven, J. S., & Ubbiali, S. 2018, Journal of Computational Physics, 363, 55, doi: 10.1016/j.jcp.2018.02.037
  45. [49]Hotokezaka, K., Nakar, E., Gottlieb, O., et al. 2019, Nature Astron., 3, 940, doi: 10.1038/s41550-019-0820-1
  46. [50]Hunter, J. D. 2007, Computing in Science & Engineering, 9, 90, doi: 10.1109/MCSE.2007.55
  47. [51]Ivezić, Ž., et al. 2019, Astrophys. J., 873, 111, doi: 10.3847/1538-4357/ab042cDOI
  48. [52]Jaegle, A., Borgeaud, S., Alayrac, J.-B., et al. 2022, in International Conference on Learning Representations. https://openreview.net/forum?id=fILj7WpI-g
  49. [54]Kasen, D., Metzger, B., Barnes, J., Quataert, E., & Ramirez-Ruiz, E. 2017, Nature, 551, 80 EP. http://dx.doi.org/10.1038/nature24453
  50. [55]Kasliwal, M. M., Nakar, E., Singer, L. P., et al. 2017, Science, 358, 1559, doi: 10.1126/science.aap9455DOI
  51. [56]Kessler, R., Marriner, J., Childress, M., et al. 2015, Astron. J., 150, 172, doi: 10.1088/0004-6256/150/6/172DOI
  52. [57]Kessler, R., Bernstein, J. P., Cinabro, D., et al. 2009, Publications of the Astronomical Society of the Pacific, 121, 1028, doi: 10.1086/605984
  53. [58]Kessler, R., et al. 2019, Publ. Astron. Soc. Pac., 131, 094501, doi: 10.1088/1538-3873/ab26f1DOI
  54. [59]Kiendrebeogo, R. W., et al. 2023, Astrophys. J., 958, 158, doi: 10.3847/1538-4357/acfcb1DOI
  55. [60]King, B. L., De, S., Korkobkin, O., et al. 2025, Publications of the Astronomical Society of the Pacific, 137, 104507, doi: 10.1088/1538-3873/ae10df
  56. [61]Klimenko, S., Vedovato, G., Drago, M., et al. 2016, Phys. Rev. D, 93, 042004, doi: 10.1103/PhysRevD.93.042004DOI
  57. [62]Kovachki, N., Li, Z., Liu, B., et al. 2023, Journal of Machine Learning Research, 24, 1. https://jmlr.org/papers/v24/21-1524.html
  58. [63]Kulkarni, S. R., et al. 2021, https://arxiv.org/abs/2111.15608
  59. [64]Lattimer, J. M., & Schramm, D. N. 1974, ApJL, 192, L145, doi: 10.1086/181612DOI
  60. [65]Leibler, C. N., & Berger, E. 2010, Astrophys. J., 725, 1202, doi: 10.1088/0004-637X/725/1/1202DOI
  61. [66]Levan, A. J., et al. 2024, Nature, 626, 737, doi: 10.1038/s41586-023-06759-1
  62. [67]Lezmy, J., Copin, Y., Rigault, M., Smith, M., & Neill, J. D. 2022, A&A, 668, A43, doi: 10.1051/0004-6361/202244740DOI
  63. [71]Lukošiūtė, K., Raaijmakers, G., Doctor, Z., Soares-Santos, M., & Nord, B. 2022, Monthly Notices of the Royal Astronomical Society, 516, 1137, doi: 10.1093/mnras/stac2342
  64. [72]Margutti, R., et al. 2017, Astrophys. J., 848, L20, doi: 10.3847/2041-8213/aa9057DOI
  65. [73]Masci, F. J., Laher, R. R., Rusholme, B., et al. 2019, Publ. Astron. Soc. Pac., 131, 018003, doi: 10.1088/1538-3873/aae8acDOI
  66. [74]Metzger, B. D., Martínez-Pinedo, G., Darbha, S., et al. 2010, Monthly Notices of the Royal Astronomical Society, 406, 2650, doi: 10.1111/j.1365-2966.2010.16864.xDOI
  67. [75]Morgan, J. S., Kaiser, N., Moreau, V., Anderson, D., & Burgett, W. 2012, Proc. SPIE Int. Soc. Opt. Eng., 8444, 0H, doi: 10.1117/12.926646DOI
  68. [76]Narayan, G., & ELAsTiCC Team. 2023, in American Astronomical Society Meeting Abstracts, Vol. 241, American Astronomical Society Meeting Abstracts #241, 117.01
  69. [77]Nugent, A. E., et al. 2022, Astrophys. J., 940, 57, doi: 10.3847/1538-4357/ac91d1DOI
  70. [78]Pang, P. T. H., Dietrich, T., Coughlin, M. W., et al. 2022, arXiv e-prints, arXiv:2205.08513, doi: 10.48550/arXiv.2205.08513
  71. [79]Paszke, A., Gross, S., Massa, F., et al. 2019, in Advances in Neural Information Processing Systems, ed. H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, & R. Garnett, Vol. 32 (Curran Associates, Inc.). https://proceedings.neurips.cc/paper_files/paper/2019/file/bdbca8ee7f92f2bfa9f7012727740-Paper.pdf
  72. [80]Pedregosa, F., Varoquaux, G., Gramfort, A., et al. 2011, Journal of Machine Learning Research, 12, 2825. http://jmlr.org/papers/v12/pedregosa11a.html
  73. [81]Perez, E., Strub, F., de Vries, H., Dumoulin, V., & Courville, A. 2018, Proceedings of the AAAI Conference on Artificial Intelligence, 32, doi: 10.1609/aaai.v32i1.11671DOI
  74. [82]Pian, E., et al. 2017, Nature, 551, 67, doi: 10.1038/nature24298DOI
  75. [83]Rastinejad, J. C., et al. 2022, Nature, 612, 223, doi: 10.1038/s41586-022-05390-wDOI
  76. [84]Rigault, M., Neill, J. D., Blagorodnova, N., et al. 2019, A&A, 627, A115, doi: 10.1051/0004-6361/201935344DOI
  77. [85]Rigault, M., Smith, M., Goobar, A., et al. 2025, A&A, 694, A1, doi: 10.1051/0004-6361/202550388
  78. [86]Ristić, M., O’Shaughnessy, R., Villar, V. A., et al. 2023, Physical Review Research, 5, 043106, doi: 10.1103/PhysRevResearch.5.043106DOI
  79. [87]Ristic, M., Champion, E., O’Shaughnessy, R., et al. 2022, Physical Review Research, 4, 013046, doi: 10.1103/PhysRevResearch.4.013046DOI
  80. [88]Robitaille, T. 2018, reproject: astronomical image reprojection in Python, Zenodo, doi: 10.5281/ZENODO.1162674
  81. [89]Rockafellar, R. T., & Uryasev, S. 2000, The Journal of Risk, 2, 21, doi: 10.21314/JOR.2000.038DOI
  82. [90]Röver, C., Meyer, R., Guidi, G. M., Viceré, A., & Christensen, N. 2007, Classical and Quantum Gravity, 24, S607, doi: 10.1088/0264-9381/24/19/S23DOI
  83. [91]Safarzadeh, M., & Berger, E. 2019, Astrophys. J. Lett., 878, L12, doi: 10.3847/2041-8213/ab24dfDOI
  84. [92]Savchenko, V., et al. 2017, Astrophys. J. Lett., 848, L15, doi: 10.3847/2041-8213/aa8f94DOI
  85. [94]Sidery, T., Aylott, B., Christensen, N., et al. 2014, Phys. Rev., D89, 084060, doi: 10.1103/PhysRevD.89.084060DOI
  86. [95]Singer, L. P., Price, L. R., Farr, B., et al. 2014, Astrophys. J., 795, 105, doi: 10.1088/0004-637X/795/2/105DOI
  87. [96]Smartt, S. J., et al. 2017, Nature, 10.1038/nature24303, doi: 10.1038/nature24303DOI
  88. [97]Sravan, N., Graham, M. J., Fremling, C., & Coughlin, M. W. 2022, in Big-Data-Analytics in Astronomy, Science, and Engineering, ed. S. Sachdeva, Y. Watanobe, & S. Bhalla (Cham: Springer International Publishing), 59–72
  89. [98]Takamoto, M., Praditia, T., Leiteritz, R., et al. 2022, in Advances in Neural Information Processing Systems, Vol. 35 (Curran Associates, Inc.), 1596–1611, doi: 10.52202/068431-0117DOI
  90. [99]Tancik, M., Srinivasan, P., Mildenhall, B., et al. 2020, in Advances in Neural Information Processing Systems, Vol. 33 (Curran Associates, Inc.), 7537–7547. https://proceedings.neurips.cc/paper/2020/hash/55053683268957697aa39fba6f231c68-Abstract.html
  91. [101]Tanvir, N. R., et al. 2017, Astrophys. J., 848, L27, doi: 10.3847/2041-8213/aa90b6DOI
  92. [102]The PLAsTiCC team, Allam, Jr., T., Bahmanyar, A., et al. 2018, arXiv e-prints, arXiv:1810.00001, doi: 10.48550/arXiv.1810.00001DOI
  93. [103]Tonry, J. L., Denneau, L., Heinze, A. N., et al. 2018, Publications of the Astronomical Society of the Pacific, 130, 064505. http://stacks.iop.org/1538-3873/130/i=988/a=064505
  94. [104]Troja, E., et al. 2022, Nature, 612, 228, doi: 10.1038/s41586-022-05327-3DOI
  95. [105]Virtanen, P., Gommers, R., Oliphant, T. E., et al. 2020, Nature Methods, 17, 261, doi: 10.1038/s41592-019-0686-2DOI
  96. [106]Watson, D., et al. 2019, Nature, 574, 497, doi: 10.1038/s41586-019-1676-3DOI
  97. [107]Wen, L., & Chen, Y. 2010, Phys. Rev., D81, 082001, doi: 10.1103/PhysRevD.81.082001DOI
  98. [108]Wes McKinney. 2010, in Proceedings of the 9th Python in Science Conference, ed. Stéfan van der Walt & Jarrod Millman, 56–61, doi: 10.25080/Majora-92bf1922-00aDOI
  99. [110]Wollaeger, R. T., & van Rossum, D. R. 2014, The Astrophysical Journal Supplement Series, 214, 28, doi: 10.1088/0067-0049/214/2/28
  100. [111]Wollaeger, R. T., van Rossum, D. R., Graziani, C., et al. 2013, The Astrophysical Journal Supplement Series, 209, 36, doi: 10.1088/0067-0049/209/2/36

Paper details

vlnc:W_yjt4rng7
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 3

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Physics and Astronomy

GPT-6.1 Sol (bare), Claude Sonnet 5.5 (bare)

View statement
Looking for related papers…
Contents