Multi-band analyses of the bright GRB 230812B and the associated SN2023pel

GRB~230812B is a bright and relatively nearby ($z =0.36$) long gamma-ray burst (GRB) that has generated significant interest in the community and has thus been observed over the entire electromagnetic spectrum. We report over 80 observations in X-ray, ultraviolet, optical, infrared, and sub-millimeter bands from the GRANDMA (Global Rapid Advanced Network for Multi-messenger Addicts) network of observatories and from observational partners. Adding complementary data from the literature, we then derive essential physical parameters associated with the ejecta and external properties (i.e. the geometry and environment) of the GRB and compare with other analyses of this event. We spectroscopically confirm the presence of an associated supernova, SN2023pel, and we derive a photospheric expansion velocity of v $\sim$ 17$\times10^3$ km s$^{-1}$. We analyze the photometric data first using empirical fits of the flux and then with full Bayesian Inference. We again strongly establish the presence of a supernova in the data, with a maximum (pseudo-)bolometric luminosity of $5.75 \times 10^{42}$ erg/s, at $15.76^{+0.81}_{-1.21}$ days (in the observer frame) after the trigger, with a half-max time width of 22.0 days. We compare these values with those of SN1998bw, SN2006aj, and SN2013dx. Our best-fit model favours a very low density environment ($\log_{10}({n_{\rm ISM}/{\rm cm}^{-3}}) = -2.38^{+1.45}_{-1.60}$) and small values for the jet's core angle $\theta_{\rm core} = 1.54^{+1.02}_{-0.81} \ \rm{deg}$ and viewing angle $\theta_{\rm obs} = 0.76^{+1.29}_{-0.76} \ \rm{deg}$. GRB 230812B is thus one of the best observed afterglows with a distinctive supernova bump.


INTRODUCTION
Gamma-ray bursts (GRBs) are energetic explosions that, with their afterglows, emit over the entire range of electromagnetic radiation.
Typically, they are classified in two categories: "long" (duration), lasting more than 2 seconds in the gamma/X-ray bands, and "short", lasting less than 2 seconds.Long GRBs are widely believed to result from the collapse and explosion of a very massive star, hence they are often referred to as "collapsar" and hypernova.Short GRBs are thought to result from the merger of a neutron star with another neutron star or with a black hole (compact objects).In both categories, GRBs produce bipolar jets emerging from the newly formed compact object.The jets interact with the surrounding matter and, through shocks, producing "afterglow" emission, first in the X-ray band, then, as the jet slows and weaker shocks occur, UV, optical, IR, and radio emissions.The luminosity of GRB afterglows is moderately correlated with the isotropic prompt-emission (mostly -ray) energy released,  iso (Gehrels et al. 2008;Nysewander et al. 2009;Kann et al. 2010Kann et al. , 2011)).
Core-collapse GRBs are also associated with an optical/nearinfrared supernova (SN), which represents the more isotropic outburst (in addition to the jet) from the central explosive process (more below).GRB 980425/SN1998bw was the first well-documented example of a GRB associated with a supernova, a core-collapse event strongly associated with a (long-duration) burst (Galama et al. 1998;Patat et al. 2001).The association between SN1998bw and GRB 980425 was first made from the optical spectrum and location of a transient in a spiral arm of the galaxy ESO184-G82 (Galama et al. 1998).Observations of such cases strengthen the fact that galaxies with strong star formation have greater potential for the occurrence of long gamma-ray bursts (Bloom et al. 2002).
Important elements which strengthen the association of supernovae with gamma-ray bursts (such as the above cases) include the broad lines in the object's emission spectrum, which are strongly typical of Type Ic supernova lines, and the association with starforming galaxies; such indicators provide a coherent scenario for the GRB-SN association.Still, important issues remain to be resolved, including: in which cases does a process (collapsar, merger) produce a long or short GRB, and what are their counterparts (rprocess or not?); what powers the central engine in each case (magnetar, radioactive heating, etc.); what kinds of jets are produced, etc.To address such key questions, we need a large sample of GRB events exhibiting multi-band emission with a (supernova/kilonova) bump in the light curve, characteristic lines in the spectrum, rich enough data to give us constraints on the current models (radioactive heating, millisecond magnetar central engine, etc.).
Important parameters that characterize the SNe associated with GRBs include their maximum luminosity (bolometric and in various bands), the time of their peak emission, and the width at halfmax of the light curve.Many authors often use the (less physically meaningful) relative brightness factor  (typically compared to SN1998bw) and the (time) "stretch factor"  (that is, a "time width"), also compared to SN1998bw (Cano et al. 2017).A grading system, introduced by Hjorth & Bloom (2012), became widely adopted for characterizing the strength of a GRB-SN association.The grading ranges from (A), very strong (conclusive spectroscopic evidence), to (E), the weakest associations.In the last 25 years, there have been a dozen cases rated A or A/B (Cano et al. 2017).For those, the average peak time (in the rest frame) is ∼ 13.2 days, with a standard deviation of ∼ 2.6 days (computed from Table 3 of Cano et al. 2017).
However, the massive star origin for all long GRBs has recently been challenged by the discovery of a few long GRBs (GRB 211211A, GRB 230307A) associated with a kilonova, normally the signature of a binary compact object merger (Rastinejad et al. 2022;Troja et al. 2022;Yang et al. 2022;Bulla et al. 2023;Levan et al. 2023).In addition to these recent associations with kilonovae, there are also nearby long GRBs without a detected bright SN (Fynbo et al. 2006;Gal-Yam et al. 2006;Valle et al. 2006;Gehrels et al. 2006;Jin et al. 2015).This evidence then produces a more nuanced picture: while most long GRBs originate in massive star explosions, a few may have a different origin.It is thus crucial to obtain a revised census of the collapsar/merger origin for long GRBs.Events at low redshift ( ≲ 0.5) offer an excellent opportunity to carry out this measurement, as the associated SNe, if present, can be easily detected in photometry and even confirmed spectroscopically with 10m-class telescopes.GRB 230812B provided us with an opportunity to further explore these GRB-Supernova/Kilonova associations.
GRB-SN associations may also be found serendipitously with optical wide-field survey programs (Soderberg et al. 2007) rather than by following bursts and their afterglows.GRB 230812B was initially detected by the Fermi Gamma-ray Burst Monitor (GBM - Meegan et al. 2009), the Gravitational wave high-energy Electromagnetic Counterpart All sky Monitor (GECAM), the AG-ILE/MCAL instrument (Casentini et al. 2023), and the Konus-Wind instrument (Frederiks et al. 2023).This GRB is the most recent event to exhibit a clear SN feature.
With the sky localization probability area provided by GBM or LAT (Lesage et al. 2023;Scotton et al. 2023), a series of tiled observations were obtained by the Neil Gehrels Swift observatory X-ray telescope (XRT) (Gehrels et al. 2004), the Zwicky Transient Facility (Salgundi et al. 2023), and the Global MASTER-Net (Lipunov et al. 2023a).The X-ray and UV counterpart of GRB 230812B was discovered 7.1 hours after  0 by Swift/XRT (Page & Swift-XRT Team 2023) and Swift/UVOT (Kuin & Swift/UVOT Team 2023).The optical counterpart of GRB 230812B was found by the Zwicky Transient Facility on 2023-08-13 at 03:34:56, 8.5 hours after the GRB trigger time T 0 (Salgundi et al. 2023), and also by KAIT (the Katzman Automatic Imaging Telescope - Zheng et al. 2023), which provided localization with arcsecond accuracy.Simultaneously, the Global MASTER-Net robotic telescopes network reported the optical counterpart at the same location (Lipunov et al. 2023b).
A series of photometric observations across the full electromagnetic spectrum were conducted in the months following the trigger.Among them, we can cite as an example the Multipurpose InSTRument for Astronomy at Low-resolution spectraimager (T193/MISTRAL) in optical (Adami et al. 2023a,b;Amram et al. 2023), the Italian 3.6m TNG telescope in near-infrared, and the Northern extended millimeter array (NOEMA) in radio (de Ugarte Postigo et al. 2023b).Spectroscopic observations were also conducted in parallel.It led to the measurements of the transient's redshift:  = 0.360 (de Ugarte Postigo et al. 2023a).Twelve days later, observations using OSIRIS+ mounted on the Gran Telescopio Canarias (GTC) showed features in the spectrum characteristic of a GRB-SN event and matched with the spectrum of SN1998bw, indicating, rather conclusively, the presence of a supernova (Agüí Fernández et al. 2023;Agui Fernandez et al. 2023).
GRB 230812B being a high-luminosity and (relatively) closeby burst ( = 0.36) makes it a very worthwhile target of investigation of the GRB and its afterglow, the SN features, and the correlations between the two.To compute distances, absolute magnitudes from apparent magnitudes, etc., we use the Planck18 cosmological model from astropy (Collaboration et al. 2020); it adopts a flat cosmology with  0 = 67.66km • s −1 • Mpc −1 and Ω m = 0.310.The observed redshift  = 0.360 then corresponds to a luminosity distance of 1981 Mpc; with the fluence 2.52 × 10 −4 erg cm −2 given by Fermi/GBM (Roberts et al. 2023), we obtain the total isotropic gamma energy  ,iso = 1.2 × 10 53 erg; and with the duration ( 90 = 3.26 s) we get the mean gamma-ray isotropic luminosity  ,iso = (1 + ) ,iso / 90 = 4.9 × 10 52 erg s −1 .This makes this event one of the most luminous GRB-SN events ever recorded.
In this paper, we report observations by the GRANDMA network and its partners of the bright GRB 230812B and the supernova (named SN2023pel) that emerged in the light curve about five days after the burst onset.In §2, we present the observational data from more than two dozen instruments and the photometric methods we use.We also explore properties from the host galaxy (brightness, line of sight extinction).In §3, we analyse our multi-epoch spectra from the GRB afterglow to the confirmation of the presence of SN2023pel.In §4, we present the methods we applied in the analysis of the afterglow light curves, using both empirical fits and Bayesian inference.We then present our results on the astrophysical scenarios and processes using different jet structures that best describe the data, and compare SN properties with other GRB-associated supernovae.In §5, we present some general discussion and conclusions.

Swift XRT, UVOT
The X-ray light curve (0.3 − 10 keV) of GRB 230812B was acquired from the UK Swift Science Data Centre 1 (Evans et al. 2007(Evans et al. , 2009)).The data were extracted from the Burst Analyser 2 (Evans et al. 2010), which provides the light curves and spectra of the [0.3-10] keV apparent flux, as well as the unabsorbed flux density at 10 keV in Jansky units.For the spectral energy distribution (SED) fitting to measure the dust from the galaxy (see sections below), the [0.3-10 keV] XRT data were grouped by 10 counts/bin using grppha, a subpackage from HEASoft (version 6.31.1), for statistical purposes.For the other analyses, we performed a re-binning of the unabsorbed light curve at 10 keV by dividing the observations into eight noncontinuous time windows.Among these, four windows contained a cluster of observations occurring within an hour or less, while the remaining four had a single data point each.For each cluster, we computed the mean value and standard deviation to produce data points in the light curve for the analysis.These values are reported in Table A1.
We retrieved images taken by the Ultraviolet/Optical Telescope (UVOT, Roming et al. 2005) from the Swift archive3 .The source was imaged using the broadband white filter from 0.3 days to 8.2 days.In all the images, we checked the effectiveness of the aspect correction.To address the excess broadening induced by pointing jitter from the aging attitude control system (Cenko 2023), a meticulous assessment of an early image was conducted to determine where the source counts merge into the background.To accommodate this, a slightly larger aperture of 7.5 arcseconds was used for the source.All further images show that the source is contained in this aperture.Background measurements were obtained by analyzing an annular region extending from 10 to 22 arcseconds (after a careful background region positioning).The later images were summed to get a good signal-to-noise ratio in the usual way using the Ftool uvotmaghist 4 .We then transformed the Vega magnitudes to AB magnitudes by adding 0.8 mag as is appropriate in white (Breeveld et al. 2011).
The late-time magnitude upper limits suggest that the host galaxy magnitude is faint, white > 23.2.We tried deriving a near-UV magnitude for the host galaxy from earlier observations from the Galex gPhoton database5 , but were unsuccessful in avoiding contamination by nearby stars.We eventually chose the magnitude 23.54 ± 0.84 in -band from the Sloan Digital Sky Survey DR7 (Abazajian et al. 2009) as an approximation of the white contribution, making sure we propagated properly its very conservative error bars through flux subtraction.The UVOT values, corrected from this constant galaxy flux contribution and from Milky way extinction (see below), are reported in Table A2.

Optical data set
We conducted simultaneous observations with GRANDMA (Antier et al. 2020a), thanks to its operational platform SkyPortal (Coughlin et al. 2023), and with associated partners, from less than a day after the trigger time  0 up to 38 days (see Figure 1).Details on the observational campaign in the various networks can be found in the Appendix.From the images taken, we successfully extracted the photometry of the source and corrected it from the constant flux contribution of the host galaxy and from absorption by dust along the line of sight.The data set can be found in Table A2.Our preliminary analysis of the GRANDMA observations has been reported publicly in the General Coordinates Network (GCN) 6  (Mao et al. 2023;Pyshna et al. 2023). 6https://gcn.nasa.gov/

Photometry
Prior to photometry, all images were pre-processed in a telescopespecific way with bias and dark subtraction and flat-fielding.We manually masked the regions of the images containing significant imaging artefacts or regions not fully corrected by the preprocessing.Also, we derived astrometric solutions for the images where telescope pipelines did not provide them by using the Astrometry.netservice (Lang et al. 2010).
In order to increase the signal-to-noise ratio of the images, we resampled and coadded individual frames using the Swarp software (Bertin 2010) for sequences of images acquired on the same telescope within a short interval of time.Then, we performed the forced photometry at the transient position using STDPipe (Karpov 2021), a set of Python codes for performing astrometry, photometry, and transient detection tasks on optical images, in the same way as Kann et al. (2023).
In order to simplify the analysis and quality checking of the heterogeneous set of images from different telescopes, and to keep track of the results, we created a dedicated web-based application, STDWeb7 , which acts as a web interface to the STDPipe library and provides a user-friendly way to perform all steps of its data processing, from masking bad regions to image subtraction, with thorough checking of the intermediate results of every step, and then adjusting the settings in order to acquire optimal photometry results.It also contains some heuristics for the selection of an optimal aperture radius and an optimal selection of reference photometric catalogue, refining the astrometric solution as needed, etc.
Specifically, for the photometry on all images, we used an aperture radius equal to the mean FWHM value estimated over all point-like sources in each image.For photometric calibration, we used the Pan-STARRS DR1 catalogue (Flewelling et al. 2016) for processing the images acquired in filters close to the Sloan system.We used a spatially variable photometric zero-point model represented as a second-order spatial polynomial in order to compensate for the effects of improper flat-fielding, image vignetting, and positionally-dependent aperture correction (e.g.due to PSF shape variations).We first performed the analysis taking into account the linear color term (using  − for Sloan-like filters) in order to assess how much the individual photometric system of the image deviates from the catalogue one.Then, if the color term is negligible (e.g.smaller than 0.1), we re-run the analysis of the image without the color term, thus directly deriving the measurement in catalogue photometric system.If the color term is significant, we kept it in the analysis and corrected the measurement using the known color of the transient.
When the signal-to-noise ratio obtained with the forced photometry is below 5, we derive an upper limit for it by multiplying the background noise inside the aperture by 5, and converting this flux value to magnitudes.For images taken too close to each other (on a logarithmic timescale), we only selected the one with the best signal-to-noise ratio.Images with a sensitivity too low (> 1.5 apparent magnitude brighter than nearby measurements) were excluded from the data analysis.Images which, after subtraction of the galaxy's constant flux, give a larger error bar than 0.5, were also excluded from our data set for this analysis.
In parallel, the image reduction for  and  bands was carried out using the jitter task of the ESO-eclipse package 8 .Astrometry was performed using the 2MASS9 catalogue.Aperture photometry was performed using the Starlink PHOTOM package10 .To minimize any systematic effect, we performed differential photometry with respect to a selection of local isolated and non-saturated reference stars from the UKIDSS11 survey.

Host galaxy properties
The host galaxy of GRB 230812B is SDSS J163631.47+475131.8, with measurements available in SDSS DR16 (Ahumada et al. 2020), but its photometry there is marked as unreliable.The host galaxy's redshift  = 0.36 was determined through GTC spectroscopic observations of emission lines (de Ugarte Postigo et al. 2023a).We studied its brightness, both for host flux subtraction and spectral analysis.
Constant flux from the host at the location of GRB 230812B -To better characterize the host galaxy flux, we acquired the data for the GRB position from archival Pan-STARRS DR1 (Waters et al. 2020) images in  ′ filters, and from the DESI Legacy Surveys DR10 (Dey et al. 2019) stacked image in  ′ ,  ′ and  ′ filters.We then performed forced photometry on these images, on the same apertures and with the same parameters as used above for the reduction of the dataset.To convert Legacy Survey measurements to the Pan-STARRS photometric system, we estimated the color term12 while calibrating these images.For the  ′ filter, this happened to be negligible, but for  ′ and  ′ , we used the following equations: where the magnitudes  ′ ,  ′ ,  ′ ,  ′ correspond to the Pan-STARRS system.To extract  ′ and  ′ , we used the  ′ values estimated from the Legacy Survey image, and  ′ values from Pan-STARRS image.The results are summarized in Table 1.These host flux contributions were then subtracted from the apparent flux to obtain the transient flux, combining the flux errors from the apparent magnitude and the host contribution to obtain the errors on the host-subtracted flux.
In  and  filters, there are to our knowledge no NIR detections of the host in available survey catalogues.We obtained a deep latetime -band observation at  0 + 60 days using the TNG telescope, finding a magnitude of 20.91 ± 0.32 (Vega), i.e. 21.82 (AB).This approximate host galaxy contribution could then be subtracted from the other TNG  images.Unfortunately, no late-time imaging in band could be performed, so no host contribution could be estimated in this filter.
Star formation rate from the host galaxy -Using these host flux contributions as approximations for the observed magnitude of the galaxy as a whole, we apply the CIGALE13 code (Boquien et al. 2019) to study the spectral energy distribution (SED) of the galaxy.This analysis constrains the model parameter space to a mass  = (1.99±0.54)×10 9 ⊙ , a star formation rate (on the last 10 Myr)   = 0.17 ± 0.07  ⊙ yr −1 , and an attenuation   = 0.09 ± 0.06 mag.We show the best-fit spectrum in figure 2. However, one should  keep in mind that we are effectively considering the flux of the host galaxy within the aperture size of the transient (a few arcseconds because of point spread of the instruments; to be compared with the 5 kpc/arcsec scale at  ≃ 0.36), and are thus missing a fraction of the galaxy, underestimating the flux by an unknown amount that may bias these galaxy parameters.The SFR is especially hard to constrain without more UV data, so its uncertainty provided here is likely underestimated.

Line of sight extinction
Milky Way (MW) extinction -We corrected the UV, ,  and  bands from the MW extinction values from Schlafly & Finkbeiner (2011), computed along the line of sight by the NED calculator 14 .These corrections are reported in Table 1.
Host galaxy dust extinction -To estimate the extinction suffered by the afterglow due to the host galaxy dust, we created a spectral energy distribution (SED) from X-ray to optical at two epochs:  0 + 2.2 days, corresponding to the quasi-simultaneity of the whitegriz bands, and at  0 + 4 days, to include observations from the J, K bands; as no quasi-simultaneous observation was available  at this epoch for griJ, the photometric points were estimated through interpolations.We considered the typical extinction curves of MW, Large Magellanic Cloud and Small Magellanic Cloud of Pei (1992), which gave similar results.We report the results obtained with the average SMC dust extinction law.For each epoch, the intrinsic spectrum was modeled with a single or broken power law using the afterglow theory outlined in Sari et al. (1998).For the broken power law, the difference in slope between X-ray and NIR wavelengths was set to Δ =   -  = 0.5, which corresponds to the change in slope due to the cooling break.For both epochs, the best fit of the X-ray/NIR SED is obtained with a single power law, and the measured dust extinction   is compatible with zero (See Table 2).The higher uncertainty in   for  0 + 4 days is due to higher uncertainties in the -and -band observed fluxes.The best fits of the SED at both epochs are shown in Figure 3.
The  0 + 2.2 days SED constrains best the host galaxy dust extinction as   = 0.0 ± 0.075 mag, corresponding to a reddening of  ( − ) = 0.0 ± 0.026 mag for the average SMC model with   = 2.93 (this constraint is tighter than but compatible with the upper limit  ( − ) < 0.07 mag (3) in Srinivasaragavan et al. 2024).This is consistent with the CIGALE analysis finding a very low global attenuation.We thus chose not to apply any additional extinction correction to the photometric points in Table A2.

Radio
We also added to our data set two unique submillimeter measurements from NOEMA, takend 3.8 days post  0 : see a brief description of the analysis in de Ugarte Postigo et al. (2023b).To complete our multi-wavelength dataset at lower energies, we gathered the published results of radio observations of GRB230812B starting two days after  0 and covering different radio bands from 1 to 15.5 GHz.We use the data from the Arcminute Microkelvin Imager Large-Array (Rhodes et al. 2023), the Karl G. Jansky Very Large Array (Giarratana et al. 2023;Chandra et al. 2023), and the upgraded Giant Meterwave Radio Telescope (Mohnani et al. 2023).These data are summarized in Table A1.No correction from the host constant flux and extinction were applied to these measurements.

SPECTRAL ANALYSIS
We performed spectroscopy of the optical counterpart of GRB 230812B on 3 epochs using OSIRIS+ (Cepa et al. 2000) on the 10.4 m Gran Telescopio Canarias (GTC) (see details in the appendix).These spectra, together with the host galaxy model derived from the SED fit are shown in Fig 4.
The first epoch was obtained 1.1 day after the GRB, when the strong continuum was dominated by the powerlaw, synchrotron emission of the afterglow.As already mentioned by (de Ugarte Postigo et al. 2023a), the spectrum shows a strong trace with both emission and absorption lines which we identify as MgII, MgI, CaII, CaI in absorption, and [OII] and [OIII] in emission, at an average redshift of 0.3602±0.0006,which we identified as the refined redshift of the GRB.The spectral features and their equivalent widths (EW) are displayed in Table 3.The emission line EWs do not carry much information due to the varying continuum, but the absorption features tell us about the line of sight to the GRB within its own host galaxy.We can calculate the line strength parameter as proposed by de Ugarte Postigo et al. ( 2012), which determines the strength of the features as compared to the a large sample of afterglows.The line of sight towards GRB 230812B displays a line strength parameter of LSP=0.15±0.16,indicating that the features are just slightly stronger than the average of the sample (percentile 60 of the sample).The only significant difference with respect to the typical GRB spectrum is the relative strength of MgI with respect to MgII.In our case MgI, is relatively strong, implying that the host galaxy of GRB 230812B is likely to have a low-ionized interstellar environment.
The other two epochs (12.12 and 15.12 days post  0 ) show similar, broad features typical of broad line Ic supernovae.The second epoch has a slightly redder continuum, that could be due to the cooling of the ejecta.In our analysis, we consider that the contamination by the afterglow continuum is negligible at these epochs.
To analyze the clean SN spectra, we subtracted the contribution from the host galaxy using the host spectrum template that was fit to the host photometry in section 2.2.2.The host subtracted spectra resemble well the ones obtained for SN1998bw at similar rest-frame observing epochs as was earlier noted by Agüí Fernández et al. (2023), who identify SN2023pel as a broad line type Ic supernova.
Furthermore, we use NGSF (Goldwasser et al. 2022) on the host-subtracted spectra to determine the type of SN associated with the burst.For the spectra taken on Aug. 27, the best matches are indeed those of type Ic, the best one being SN2006aj, at phase 2 days (after its peak), with a reduced  2 /  = 1.74, followed by  At 12 and 15 days the supernova component is responsible for most of the emission, with little evolution between the two epochs.We have plotted the host galaxy spectrum derived from the SED fit to understand its contribution to the observations.SN2002ap, SN2005ek and SN1998bw with  2 /  = 1.77, 1.78 and 1.79 respectively.We note that Srinivasaragavan et al. ( 2024) also find SN2002ap and SN1998bw to be good matches to their spectrum.
Additionally, we measured the photospheric velocity of SN2023pel using host-subtracted spectra from GTC. Narrow emission lines and artifacts were first clipped using the IRAF-based routine WOMBAT, and then smoothed the spectra using the the open-source code SESNspectraPCA15 .We measure the velocity of the Fe II line near the SN peak, a proxy for the photospheric velocity of the SN, using SESNspectraLib16 (Liu et al. 2016;Modjaz et al. 2016).SESNspectraLib computes the blue-shift of the Fe II 5169 Å line between a normalized SN Ic template and the pre-processed and pre-smoothed SN Ic-BL spectrum.Since the Fe II feature in a standard SN Ic spectrum is actually a combination of three lines (at 4924 Å, 5018 Å, 5169 Å), one can measure the relative blue shift of the 5169 Å line in a SN Ic-BL spectrum to a normalized SN Ic template of the same phase.The uncertainty on the velocity measurement is calculated by adding the uncertainty of the mean SN Ic template (at a particular phase) in quadrature with the uncertainty on the relative blue-shifted Fe II absorption velocity.We measure  ℎ = 19000 ± 4000 km s −1 for the spectrum taken on 2023-08-24 and  ℎ = 17000±3000 km s −1 for the spectrum taken on 2023-08-27.The velocity we measure is broadly consistent with Srinivasaragavan et al. (2024) and with that of the larger population of GRB-SNe at a similar phase Cano et al. (2017), for which the average velocity at peak is  = 20000 ± 8000 km/s.

Empirical Light-Curve Analysis
As a first empirical analysis of the afterglow, we perform a multiband fit of our data up to 5 days (Figure 1, bottom), to avoid including the contribution from the emerging supernova.Assuming a powerlaw function of the form   ∝  −   − , we derive a decay slope of  = 1.35 ± 0.02 and a spectral slope  = 0.74 ± 0.01 (Figure 6).We note that these values are almost identical to those obtained by Srinivasaragavan et al. (2024) for this GRB: in their work,   = 1.31 ± 0.02 and   = 0.74 ± 0.02.These slopes give an indication of the physical conditions in the GRB's jet (which produces the afterglow through shocks), particularly the electron distribution's index  (  () ∝  −  ).
Using the forward shock model, different assumptions about the afterglow environment lead to different analytical equations and relations between  and  and  (Sari et al. 1998;Panaitescu & Kumar 2000).For instance, a fast-cooling scenario describes a spectral index  = /2 leading to an unusual  = 1.48 ± 0.03, but for a slow-cooling scenario,  = (  − 1)/2, which would give a more reasonable  = 2.48 ± 0.03.For the time-decay slope , a uniform external medium gives  = (3/4)(  − 1), which means  = 2.80 ± 0.04, while a wind medium gives  = (3 − 1)/4,  = 2.14 ± 0.04.The temporal and spectral indices are not satisfied by ), the thin-shell approximation is used for handling the dynamics of the relativistic ejecta propagating through the interstellar medium, and the angular structure is introduced by dissecting the blast wave into angular elements, each of which evolves independently, including lateral expansion.The analytical descriptions in Sari et al. (1998) are used for the magnetic-field amplification, electron acceleration, and synchrotron emission from the forward shock.The observed radiation is then computed by performing equal-time arrival surface integration.It should be noted that the model does not account for the presence of a reverse shock or an early coasting phase and does not include inverse Compton radiation.This limits its applicability to the early afterglow of very bright GRBs.In addition, it does not allow to explore a wind-like medium, which may be relevant in a case like GRB230812B.In sncosmo, the supernova modelisation is constructed from observations of the supernova SN1998bw associated with the long GRB 980425.
We use the Nuclear physics and Multi-Messenger Astronomy where L ( ì ), ( ì ) and Z() are called the likelihood, the prior, and the evidence, respectively.The nested sampling algorithm implemented in pymultinest (Buchner 2016) is used for obtaining the posterior samples and the evidence.
Assuming a priori that the different scenarios considered are equally likely to explain the data, the plausibility of M 1 over M 2 is quantified by the Bayes factor  2023), the systematic uncertainty  sys is treated as a free parameter and sampled over during the nested sampling and not kept fixed at a particular value.Therefore, the resulting posterior of  sys can also be interpreted as the goodness of fit.The lower the  sys , the better the fit, and vice versa.
We have analyzed our full data set (X-ray, UV, optical, IR, and radio) 19 with NMMA.All the values quoted in this section are medians with a 95% credible interval as uncertainty.

Jet structure
We vary the jet structure of the GRB to try to characterize or to constrain the jet.To do this, we considered Gaussian (Gauss) and power-law (Power-law) jet structures.Gaussian jets feature an angular dependence  ( obs ) ∝ exp(− 2 obs /(2 2  )) for  obs ≤   , with   being an additional free parameter.A power-law jet features an angular dependence  ( obs ) ∝ (1 + ( obs /  ) 2 /) −/2 for  obs ≤   , with   and  being additional parameters.The resulting log Bayes factor ln B of Power-law+SN relative to Tophat+SN and Gauss+SN is found to be 18.360 ± 0.020 and 17.356 ± 0.020, respectively, demonstrating a preference for the power-law jet.
The light curve fits of our best-performing model, i.e.Power-law+SN, are shown in Figure 7.The posterior distributions of the GRB+SN models for all jet structures considered in this work are shown in Figure 8 (with corresponding priors displayed in Table 5).The corresponding best-fit light curves are shown in Figure D1 in the Appendix.
Given the Bayes factors with the interpretation of Jeffreys (1961) and Kass & Raftery (1995), one will conclude that the power-law jet is decisively favored against the Gaussian and the top-hat jets.Yet, as previously explained, the models presented in afterglowpy have limitations for early-time GRB afterglow, and the early-time data is also the main source of discriminatory power between different jet structures (as seen in Figure D1).Thus one can only conclude that there is a preference for power-law jet structure over top-hat and Gaussian jet structures, but it is not a confirmation for detecting such a structure.
In Figure 8, we present the NMMA posteriors for the source parameters, namely the isotropic energy  0 , the interstellar medium density  ISM , the viewing angle  obs , the half-opening angle of the jet core  core , and the microphysical parameters {,   ,   } (the power-law index of the electron energy distribution, the fraction of energy in electrons, the fraction of energy in the magnetic field, respectively) using the different jet structure models with SN.
The numerical results for the posteriors and the associated priors can be found in  Fraĳa et al. 2020), it remains surprising in this case where the supernova association is strong evidence for a massive progenitor.This may reflect a strong reduction of the progenitor mass loss in the last centuries before the collapse or that the environment had likely been blown away before the jet's interaction with it.The fractions of energy in the electrons and in the magnetic field are   = 10 −0.10 +0.10 −0.29 and   = 10 −2.29 +1.02 −0.94 ; and the jet's core angle  core = 1.54 +1.02 −0.81 deg and viewing angle  obs = 0.76 +1.29  −0.76 deg.

Investigation on the X-ray residual
Figure 7 shows that the best-fitting model has substantial residuals in the X-ray band, especially at earlier times.To further understand this phenomenon, we have performed additional analyses considering data up to 5 days after trigger time, all with the Power-law model, the best-performing GRB model considered.The analyses consider either only the X-ray data or only the UV, optical, and IR (UVOIR) data.The results vary in significance, as demonstrated for instance by the electron energy distribution index .The analysis with the UVOIR dataset gives  = 2.39 +0.11 −0.14 , whereas the analysis with only X-ray data gives  = 2.25 +0.22  −0.27 .We should, however, note the limitations of this restricted analysis as it results in posterior distributions that are less constrained due to the lower amount of data considered, in the X-ray band, in particular.Moreover, afterglowpy does not include early-time components such as a reverse shock or inverse Compton radiation.The UVOIR data have a higher weight in the Bayesian analysis due to the higher number of data points in those bands, and since the SN model used here does not support the X-ray band, we can ascribe the high residuals in the X-ray band to a combined effect of the different sizes of the datasets in different filters and a limitation of the models considered in this work.

Comparison of SN2023pel with other GRB-associated SNe
We compare the luminosity of SN2023pel with those of several well-studied GRB-associated supernovae, namely SN1998bw, SN2006aj, and SN2013dx (Mazzali et al. 2021).To do this, we use the bolometry tool from SNooPy (Burns et al. 2011) 20 to obtain a bolometric light curve in the (450−1050) nm range.We grouped our  and -band data points (see Table A2) into 1-day bins.When an optical band has no observed data in a bin, we use the flux from the best-fit model lightcurves as a proxy.We then subtract the bolometric flux from the GRB component of the best-fit model from the total curve in order to get the SN component.Our results are shown in Figure 9.We compare the maximum luminosities, the peak times, and half-max time widths of those four supernovae (SN2023pel, SN1998bw, SN2006aj, and SN2013dx, see Table 4).SN2023pel has a (rest-frame) peak time of 11.6 days, close to that of SN2013dx, but shorter than for SN1998bw and longer than for SN2006aj.It is also consistent with the average peak-time of 13.2 ± 2.6 days that Cano et al. (2017) find for a collection of GRB-SN events.However, SN2023pel notably declines somewhat faster than the other three,  especially SN1998bw, with a half-max time width of 16.2 days compared to 36.0 days for the latter.We also note the differing evolution of the supernova in each band, e.g. the half-max time widths in the  ′ and  ′ bands, measured in the source frame, are 17.32 +1.27  −1.23 days and 13.30 +0.97  −0.96 days, respectively.
Additionally, we compute the brightness factor  SN and (time) stretch factor  SN (both relative to SN1998bw) to compare SN2023pel with the results of the recent Srinivasaragavan et al. (2024) paper on this supernova.We find  SN = 1.08Further investigations have been pursued by Srinivasaragavan et al. (2024) to contextualize GRB 230812B/SN 2023pel with respect to a complete GRB-SN population beyond the three examples mentioned above (see Sec. 4.3 of Srinivasaragavan et al. (2024)).Their comparison (using statistical correlations between  , and    ,1998 ,   ,  and    ) shows that SN 2023pel is a rather ordinary SN with respect to the overall GRB-SN population, adding more evidence that the central engine and SN powering mechanisms are decoupled in GRB-SN systems.

DISCUSSION AND CONCLUSION
GRB 230812B was a bright and relatively nearby gamma-ray burst that displayed a number of important features: it was accompanied by a luminous supernova, it produced radiation from a high energy of 72 GeV down to radio wavelengths, and was observed for at least a few months since the initial burst, which was detected by several space detectors.Dozens of images and measurements were taken from observatories across the world, including some 80 data points from our GRANDMA network and partner institutions, necessitating not only careful reductions and analyses but also subtractions of backgrounds, host and Milky Way galaxy absorption (dust) and extinction corrections, etc.With a duration  90 of 3.264 ± 0.091 s (in the [50 -300] keV band), GRB 230812B falls in the "long" category, thus (in principle) the result of a very massive star's collapse, which produces powerful jets and (oftentimes) a more isotropic supernova, which may be detected several days after the initial burst and afterglow.However, motivated by recent cases indicating that "long" GRBs may sometimes display kilonova characteristics (which are normally associated with "short", merger-type GRBs) and vice versa ("short" GRBs displaying collapsar-type characteristics), it was worthwhile Table 5. NMMA -Parameters and prior bounds employed in our Bayesian inferences.We report median posterior values at 95 % credibility for various physical scenarios and jet structures for the GRB."Uniform" refers to an uniform distribution, and "LogUniform" refers to an uniform distribution for the log of the parameter.N ( ,  2 ) refers to a Gaussian distribution with mean  and variance  to analyze this GRB's multi-band emission to see if it is best fit with a supernova or a kilonova, in addition to determining its jet properties, i.e. geometry (observed and core angle) and physical parameters (electron and magnetic field energy fractions, etc.).
In a nutshell, our analyses (both photometric and spectral) found a clear confirmation of a supernova, and, using NMMA, a GRB best fit by a high (but not abnormal) total energy  0 = 10 52.82 +0.35 −0.31 erg.The associated supernova SN2023pel peaked 15.76 +0.81  −1.21 days (in the observer frame) after the trigger, consistent with Srinivasaragavan et al. (2024) for this supernova and similar to cases of strong GRB-SN associations (Cano et al. 2017).We also plotted pseudo-bolometric light curves for SN2023pel and three other GRB-associated supernovae (SN1998bw, SN2006aj, SN2013dx); we found this new one to have evolved similarly to the others, albeit somewhat faster (especially in decay times).
Our best-fit model also gave a very low ambient density  ISM = 10 −2.38 +1.45 −1.60 cm −3 , similar to a number of previously modeled cases (see the brief discussion and references given above).Further investigations with different models are called for to confirm and understand all these findings.
Our NMMA framework/simulation also gave best-fit parameter values for the jet's geometry (shape and core and viewing angles) and physical conditions (electron energy distribution index, electron energy fraction, and magnetic field energy fraction).The jet's geometry/shape was best described by the (angular) 'power-law' model; the electron energy distribution index  was found to be ≈ 2.1, which is quite typical; the best-fit magnetic field energy fraction   was ≈ 10 −2.4 , also quite typical.However, the electron energy fraction was found to be rather high:   ≈ 0.5 − 1 (10 −0.10 +0.10 −0.29 ).The jet's core and viewing angles were found to be small:  core = 1.54 +1.02 −0.81 deg and  obs = 0.76 +1.29 −0.76 deg, respectively.Despite these atypical values, the parameters still allow an on-axis jet scenario.
GRB 230812B, bright and relatively close-by, provided us (the GRANDMA network and its partners) the opportunity to perform dozens of observations in UV, optical, near infrared, and submillimeter resulting in some 80 high-quality data points.The light curves in optical showed a distinctive supernova bump, SN2023pel, which turned out to be about as bright as the famous SN1998bw.Our spectroscopic analysis determined a photospheric velocity  ℎ = 17000 ± 3000 km s −1 near the peak, and the host-subtracted spectra was best fit by SN2006aj, slightly better than SN2002ap, SN2005ek and SN1998bw.
The rich data that we have produced, coupled with data from other groups (Srinivasaragavan et al. 2024) and facilities, will help explore this event and other GRB-SN associations with additional tools and models.Covering 9 orders of magnitude in frequency, our multi-band analysis presented some information about the jet and the supernova, but further investigations can help confirm or refine our results.Near-infrared (NIR) observations of GRB 230812B were carried out with the Italian 3.6-m TNG telescope, sited in Canary Island, using the NICS instrument in imaging mode.A series of images were obtained with the J and K filters on 2023 August 16 (i.e. about 4.1 days after the burst) and with the J filter only on 2023 August 21 and 2023 October 11 (i.e. about 9.1 days and 60.1 days after the burst).
In addition to the professional network, GRANDMA activated its Kilonova-Catcher (KNC) citizen science program for further observations with amateurs' telescopes.
The GRANDMA observations and its partners are listed in Table A2), which includes the start time T mid time (in ISO format with post-trigger delay) and the host-galaxy/extinction-corrected brightness (in AB magnitudes) of the observations, as well as the uncorrected magnitudes.The exposure times, names of telescopes, and filters used are mentioned for each observation.Our method for calculating the magnitudes is described in the section 2.2, including our methods of photometry transient detection, magnitude system conversion, host galaxy extinction correction, and galaxy subtraction.

APPENDIX B: SPECTROSCOPIC OBSERVATION DETAILS
We used OSIRIS+ (Cepa et al. 2000) mounted on the 10.4m Gran Telescopio Canarias (GTC) telescope at Roque de los Muchachos Observatory in La Palma, Canary Islands, Spain, to observe the afterglow and supernova that follow GRB 230812B.The observation consisted of spectroscopy with an exposure time of 3x900s and grism R1000B, with a wavelength coverage between 3600 and 7800 AA.The first spectrum started at 21:37 UT, 1.110 days after the burst, while the on August 24, 2023 at 21.79 hours UT, 12.12 days after the GRB detection, close to the peak of the supernova emission (Agüí Fernández et al. 2023;de Ugarte Postigo et al. 2023a).
The last two epochs were initially programmed to be obtained with larger spacing between epochs, but due to weather and telescope scheduling they ended up being rather close in time.The first epoch was obtained with a single grism, R1000B, covering the range between 3700 and 7880 Å.The second epoch included two grisms, R1000B and R1000R, this second one adding coverage between 5100 and 10100 Å to cover the full optical spectrum.

APPENDIX C: SKYPORTAL
To store, display, and annotate GRANDMA data products in a follow-up campaign, we use SkyPortal (van der Walt et al. 2019;Coughlin et al. 2023), a powerful database, API, and web application for time-domain astronomy.We use it for its capabilities of ingesting multi-messenger triggers from GCNs in real-time, from where network-cognizant observation plans are automatically generated using gwemopt (Coughlin et al. 2018).It also enables automated ingestion of transients from the Transient Name Server (TNS) identified by surveys such as the Zwicky Transient Facility (Bellm et al. 2019;Graham et al. 2019), the Panoramic Survey Telescope and Rapid Response System (Pan-STARRS) (Morgan et al. 2012), or the Asteroid Terrestrial-impact Last Alert System (ATLAS) (Tonry et al. 2018); it is from TNS that we retrieved the discovery photometry.We store photometry information, including flux and limiting magnitude measurements from follow-up observations by GRANDMA's telescopes within SkyPortal, supplementing the data imported from TNS, to create light curves.From the dedicated source page, easy access is provided to many other database services, such as Vizier (Ochsenbein et al. 2000).Finally, SkyPortal is used for simplifying interactions with Bayesian inference frameworks such as the Nuclear physics and Multi-Messenger Astronomy framework NMMA (Dietrich et al. 2020;Pang et al. 2022), which we discuss more in the main text.Operations on SkyPortal are conducted and monitored by "shifters", members of the collaboration organized in teams every week, and divided into four daily slots of six hours each to accommodate timezone constraints while maintaining 24/7 coverage.Shifters look out for new candidates from surveys (particularly LIGO-Virgo-KAGRA, LVK) and new GCN events on the platform and report on associated Slack channels which candidates are to be followed up or not based on predefined criteria.The shifts are also organized using SkyPortal's dedicated page in the form of a calendar.Shifters or members of telescope teams are expected to upload executed observations data either manually or programmatically using the API.GCN circularlike documents can even be automatically generated, ensuring consistent formatting of the results reported to the General Coordinates Network while reducing the possibility for human errors to be made.

APPENDIX D: COMPARING DIFFERENT ASTROPHYSICAL SCENARIOS NMMA
As discussed in Section 4.2, using NMMA, we can quantitatively compare different astrophysical scenarios in a Bayesian framework.We have performed studies using various models and jet geometries.NMMA is able to perform joint Bayesian inference of multimessenger events containing gravitational waves, GRB afterglows, SNe, or kilonovae.In addition to scenarios mentioned above, we also consider two kilonova models, Bu2023Ye (Anand et al. 2023) and Ka2017 (Kasen et al. 2017), to accompany the Top-hat model as possible explanations of the dataset.The log Bayes factor ln B of various models relative to the Power-law+SN, which is the best-performing model to be introduced shortly, can be found in Table D1.The posterior of  sys is also shown in Table D1.The Power-law+SN has the lowest value of  sys , thus signifying a better fit compared to other models.Comparing the differences between the log Bayes factor of scenarios with and without a SN component, we conclude that the presence of a SN component is statistically supported from a Bayesian perspective.
The posterior values of all the considered models is summa- Table A2.UVOIR observations of GRB 230812B.In column (2),  (s) is the time delay between the start of the observation and the Fermi GBM's GRB trigger time (2023-08-12T18:58:12), all in days.Column (5) gives apparent magnitudes or 5- upper-limits in the AB system, without any correction.Column (6) gives magnitudes in the AB systems for the afterglow and the associated SN, i.e. corrected for the host galaxy and the dust from the MW (AG + SN).When only upper limits were obtained, we corrected only for the MW dust.In Column (7), a cross means we did use this data point for the Bayesian analysis; in some cases the data were not used due to redundancy, i.e. a better measurement was made by another telescope at about the same time.

Figure 1 .
Figure 1.Top: Observations from this work in -, -, -, and -band (observer frame times).Apparent magnitudes before correction by host galaxy flux or for the Milky Way foreground extinction; colored filled regions with arbitrary errorbars 0.2 mag wide have been added to ease the visualization of the light curves.Bottom: Multi-band (X-ray to IR) light curves, corrected from host galaxy flux and the Milky Way foreground extinction.In grey are power-laws fit to the data points up to  0 + 5 days (see section 4.1).

Figure 2 .
Figure 2. Spectrum of the best-fit host galaxy model in CIGALE, constrained by our estimations in  and  bands.

Figure 3 .
Figure 3. X-ray to NIR SED of the afterglow of GRB 230812B at  0 + 2.2 days and  0 + 4 days (observer-frame times).The dashed lines correspond to the best fit intrinsic model (single power law).The solid lines illustrate the best fit to the data, including the absorption in the X-ray.The 0.3-10 keV XRT spectrum extracted around  0 + 2.2 days has been rescaled and used for the SED at  0 + 4 days

Figure 4 .
Figure 4. Spectra of GRB 230812B obtained with OSIRIS+.At 1.1 day the emission was dominated by the afterglow, with a simple powerlaw continuum with absorption lines from the line of sight and emission lines from the host.At 12 and 15 days the supernova component is responsible for most of the emission, with little evolution between the two epochs.We have plotted the host galaxy spectrum derived from the SED fit to understand its contribution to the observations.

Figure 5 .
Figure 5.Comparison of the host subtracted spectra of GRB 230812B at times close to the peak of SN2023pel with spectra of SN1998bw at similar rest frame epochs.

Figure 6 .
Figure 6.Posteriors of multiband fit of optical afterglow (emission up to 5 days): log of the zero-point flux (at 1 day, 1 Hz, in mJy),  the temporal decay slope and  the spectral slope.
framework NMMA(Dietrich et al. 2020;Pang et al. 2022;Pang et al. 2023) 17 to evaluate the statistical significance of the different jet structures and provide physical properties of the GRB afterglow and the supernova component18 .NMMA uses Bayesian inference that allows us to quantify which theoretical model M fits the observational dataset  best by computing posterior probability distributions P ( ì ) = ( ì |, M).Here ì  denotes the model's parameters.These posteriors are computed via Bayes' theorem: with B > 1(ln B > 0) indicating a preference for M 1 , and vice versa.Given a set of AB magnitude measurements {   (  )} (and the associated statistical uncertainties    ) across different times {  } and filters {  }, the likelihood is given by the estimated AB magnitude for the parameters ì  given different models.Moreover, as an improvement over Kunert et al. (2023) and Kann et al. (

Figure 7 .
Figure 7. Best-fit light curves of the Power-law+SN model.Datapoints are reported in the observer frame.

Figure 8 .
Figure 8. Posterior distribution using different jet models of afterglowpy and nugent-hyper for the supernova component.

Figure 9 .
Figure 9.Comparison of pseudo-bolometric ( ) luminosity (erg/s) of SN2023pel with those of SN1998bw, SN2006aj, and SN2013dx.In orange, the lightcurve computed from the best-fit nugent-hyper model, and in red, the points computed from our observational data after subtraction of the best-fit GRB component.

Figure D1 .
Figure D1.Best-fit light curves for of the GRB + SN models with top-hat, Gaussian and power-law jet structures.Datapoints are reported in the observer frame.

Table 1 .
Apparent magnitudes of the host galaxy used for flux subtraction and the Milky Way (MW) extinction in the line of sight in different filters.

Table 2 .
Results of the spectral analysis for both epochs.

Table 3 .
Identification and equivalent width of the spectral features observed in the afterglow spectrum.

Table A1 .
X-ray and radio data used in this work."Delay" is the time interval between the start of the observation ( start ) and the Fermi GBM's GRB trigger time(2023-08-12T18:58:12). We display both the unabsorbed flux densities and the corresponding computed AB magnitudes.