<figure><img src="image_1.png" /></figure>

HAL
open science

# Prompt-to-afterglow transition of optical emission in a long gamma-ray burst consistent with a fireball

Liping Xin, Xuhui Han, Huali Li, Bing Zhang, Jing Wang, Damien Turpin, Xing Yang, Yulei Qiu, Enwei Liang, Zigao Dai, et al.

► To cite this version:

Liping Xin, Xuhui Han, Huali Li, Bing Zhang, Jing Wang, et al. Prompt-to-afterglow transition of optical emission in a long gamma-ray burst consistent with a fireball. Nature Astronomy, 2023, 7 (6), pp.724-730. 10.1038/s41550-023-01930-0. hal-04079505

HAL Id: hal-04079505

https://hal.science/hal-04079505v1

Submitted on 4 Oct 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Prompt-to-afterglow transition of optical emission in a long gamma-ray burst consistent with a fireball

Received: 4 August 2022

Accepted: 27 February 2023

Published online: 10 April 2023

<figure><img src="image_3.png" /></figure>

Check for updates

Liping Xin<fnref n="1" />✉, Xuhui Han<fnref n="1" />, Huali Li<fnref n="1" />, Bing Zhang<fnref n="1" />,²,³✉, Jing Wang<fnref n="4" />, Damien Turpin⁵, Xing Yang<fnref n="4" />, Yulei Qiu<fnref n="1" />, Enwei Liang<fnref n="4" />, Zigao Dai⁶,⁷, Hongbo Cai<fnref n="1" />, Xiaomieng Lu<fnref n="1" />, Xiang-Yu Wang⁷,⁸, Lei Huang<fnref n="1" />, Xianggao Wang<fnref n="4" />, Chao Wu<fnref n="1" />, He Gao⁹,¹⁰, Jia Ren<fnref n="1" />,²,⁸, Lulu Zhang<fnref n="4" />, Yuangui Yang¹¹, Jingsong Deng<fnref n="1" />,¹² & Jianyan Wei<fnref n="1" />,¹²✉

Long gamma-ray bursts, which indicate the end-life collapse of very massive stars, are produced by extremely relativistic jets colliding with circumstellar medium. A huge amount of energy is released both in the first few seconds, namely the internal dissipation phase, which powers prompt emissions, and in the subsequent self-similar jet-deceleration phase, which produces afterglows observed in the broadband electromagnetic spectrum. However, prompt optical emissions of gamma-ray bursts have rarely been detected, seriously limiting our understanding of the transition between the two phases. Here we report detection of prompt optical emissions from a gamma-ray burst (that is, GRB 201223A) using a dedicated telescope array with a high temporal resolution and a wide time coverage. The early phase coincident with prompt gamma-ray emissions shows a luminosity in great excess with respect to the extrapolation of gamma-rays, while the later luminosity bump is consistent with onset of the afterglow. The clearly detected transition allows us to differentiate physical processes contributing to early optical emissions and to diagnose the composition of the jet.

A long-duration gamma-ray burst (GRB) is produced by the collapse of a massive star into a black hole or a rapidly spinning, highly magnetized neutron star, with enormous energy emitted in the entire electromagnetic spectrum in the first few seconds from a jet moving towards Earth

with a speed close to the speed of light<fnref n="1" />. Because of the relativistic effects, the jet transitions from the internal dissipation phase that produces prompt emission to the self-similar deceleration phase that powers broadband afterglow within tens to hundreds of seconds in the

<footnote n="1">¹CAS Key Laboratory of Space Astronomy and Technology, National Astronomical Observatories, Chinese Academy of Sciences, Beijing, China. ²Nevada Center for Astrophysics, University of Nevada, Las Vegas, NV, USA. ³Department of Physics and Astronomy, University of Nevada, Las Vegas, NV, USA.</footnote>

<footnote n="4">⁴Guangxi Key Laboratory for Relativistic Astrophysics, School of Physical Science and Technology, Guangxi University, Nanning, China. ⁵Université Paris-Saclay, Université Paris Cité, CEA, CNRS, AIM, Gif-sur-Yvette, France. ⁶Department of Astronomy, University of Science and Technology of China, Hefei, People's Republic of China. ⁷School of Astronomy and Space Science, Nanjing University, Nanjing, China. ⁸Key Laboratory of Modern Astronomy and Astrophysics (Nanjing University), Ministry of Education, Nanjing, People's Republic of China. ⁹Institute for Frontier in Astronomy and Astrophysics, Beijing Normal University, Beijing, China. ¹⁰Department of Astronomy, Beijing Normal University, Beijing, People's Republic of China. ¹¹School of Physics and Electronic Information, Huaibei Normal University, Huaibei, China. ¹²School of Astronomy and Space Science, University of Chinese Academy of Sciences, Beijing, People's Republic of China. ✉e-mail: xlp@nao.cas.cn; bing.zhang@unlv.edu; wjy@nao.cas.cn</footnote>
<figure><img src="image_4.png" /><figcaption>**Fig. 1** | GRB 201223A was observed by GWAC before, during and after the GRB, providing the transition from prompt to afterglow emission and insight into the composition of GRB jets. The images show the GRB location in 16 consecutive frames obtained using the 0.18 m ground-based wide-angle cameras owned by the National Astronomical Observatories, CAS, China, and located at the Xinglong Observatory. Each GWAC telescope uses an unfiltered 4,000 × 4,000 pixel back-illuminated CCD (charge-coupled device) camera</figcaption></figure>

and typically achieves a 3σ limiting magnitude of R 15.4 mag for a 10 s exposure. The displayed images span the time interval from 17:57:53 to 18:01:23 UT on 23 December 2021. The arrows point to the location of the GRB optical counterpart (right ascension 08 h 51 min 09.51 s, declination +71° 10′ 47.4" (J2000.0)). The right and upper directions denote East and North, respectively. The effective exposure time range is labelled in each frame, relative to the Swift BAT trigger time in seconds.

observer frame. Even though this transition has been widely observed in the X-ray band$^{2,3}$, it is not well studied in the optical band because of the sparse coverage of optical emission throughout the entire gamma-ray emission phase using telescopes with both large field of view and high sensitivity. Bright optical flashes associated with prompt emission have been observed in several GRBs$^{4-6}$, but their immediate transition to early afterglow was only studied in limited cases$^{5}$. Other early optical

observations often show a significant emission component from a bright reverse shock$^{7-9}$, which smears the clear transition signature from prompt to afterglow emission. The Ground-Based Wide-Angle Camera Array (GWAC)$^{10}$ is a wide-angle (a field of view of 2,200°$^2$ built currently), moderate-sensitivity (detection limit around 16 mag) optical facility that can monitor a GRB prompt emission phase with a high temporal cadence (integration times of 10 s), aiming to capture the
<figure><img src="image_5.png" /></figure>

**Fig. 2** | A comparison of the prompt gamma-ray, X-ray and optical light curves of GRB 201223A measured by Swift BAT, Swift XRT, Swift UVOT, GWAC and F60A from before the event to -10⁴ s after the Swift trigger time. The BAT emission from 15–150 keV has been integrated over a 0.256 s time interval. The horizontal lines for the individual data points denote the observing intervals and the vertical lines represent the 1σ error bars. The downwards arrows indicate the upper limit for these measurements. The first optical emission was captured coincidentally during the main gamma-ray pulse. The figure is separated into two parts: the x-axis in the left-hand panels before the trigger time is displayed in linear space, while the temporal axis in the right-hand panels after the trigger time is shown in logarithmic space. The measured optical light curves have four segments. No optical emission was detected from the source before the trigger time. After the peak time of the prompt gamma-ray emission, there is a short-lived plateau or a shallow increase of optical emission in the first -17 s. After this, a rising feature was detected with a temporal power-law index of $s \approx 0.66 \pm 0.30$ to the peak time of $t_p = 52 \pm 30$ s, followed by a late temporal power-law decay with an index of $-1.07 \pm 0.15$. The X-ray emission shows a similar behaviour to the optical light curve. More information on the statistics is presented in Fig. 3.

emergence of optical flares accompanying the prompt high-energy emission, as well as offering a glimpse of the clear transition from the prompt to afterglow phase.

On 23 December 2020, GRB 201223A triggered the Bursts Alert Telescope (BAT) on board the Neil Gehrels Swift Observatory¹¹ and the Gamma-Ray Burst Monitor (GBM) of the Fermi Gamma-Ray Telescope¹² at 17:58:26 universal time (UT)¹³,¹⁴. The duration of the gamma-ray emission was ~29 s with a 15–350 keV fluence of approximately $1.64 \times 10^{-6}$ erg cm$^{-2}$ on the basis of a cutoff-power-law spectral model¹³.

The afterglow was detected by the Swift X-Ray Telescope (XRT) and Ultraviolet/Optical Telescope (UVOT)¹⁵, with a bright optical counterpart of $16.76 \pm 0.06$ mag identified in a UVOT-u filter image about 292 s after the trigger. No spectroscopic redshift was reported. If we conservatively place the Lyα limit in the middle of the UVOT-u bandpass (346.5 nm; ref. 15), the redshift of GRB 201223A would be smaller than 1.85.

A large patch of the sky area covering GRB 201223A was monitored continuously by GWAC with a cadence of 15 s, lasting for 95 min from 16:48:31.9 to 18:23:41.9 UT covering 70 min before the GRB trigger to 25 min after the trigger at the Xinglong Observatory in China. These intense observations covered the entire process of the event. The emergence of a fast transient within its field of view at the location of GRB 201223A was serendipitously detected by one of the GWAC instruments, which is temporally coincident with the prompt gamma-ray pulses of the GRB (Methods). The optical counterpart was detected in 16 consecutive images as shown in Fig. 1, which covered the total duration of high-energy emission, providing a rare glimpse of the temporal activity in the visual wavelengths around the onset of the GRB.

<figure><img src="image_6.png" /></figure>

**Fig. 3** | Optical and X-ray light curves of GRB 201223A and their modelling. Optical data are derived from GWAC and GWAC-F60A, shown in red. The X-ray flux in blue is measured by the XRT instrument on board the Swift satellite. The black dashed line shows the good fit during the temporal range [16 s:3,000 s] with a broken power-law model. All the error bars denote the 1σ statistical errors. From the second GWAC measurement, the flux is brightening with a slope of $\alpha_1 = 0.66 \pm 0.30$ before the peak time of $t_m = 52 \pm 30$ s. The optical emission enters a decay phase as a single power law with an index of $\alpha_2 = -1.07 \pm 0.15$. Reduced $\chi^2 = 0.67$ with a degree of freedom (DoF) of 28. The green dashed line reviews the best fit for the X-ray light curve with a slope of $0.91 \pm 0.02$ and $\chi^2/\text{DoF} = 77.0/20$.

The event was also responded to automatically by the F60A telescope after the alert message was received, resulting in optical observations starting 45 s after the gamma-ray trigger and stopping at ~3 ks, when the event faded to the limiting magnitude of ~18.

The optical, X-ray and gamma-ray light curves are displayed in Fig. 2. We obtain the BAT and XRT light curves from the XRT light curve and spectral repository¹⁶. The observed 15–150 keV flux measured by Swift BAT is integrated with a 0.256 s temporal resolution, showing several spikes during its activities. The main emission after the trigger time lasts for about 10 s and some weak precursors are also observed. The X-ray light curve shows a single-power-law decay with an index of $\alpha_x \approx 0.91 \pm 0.02$ (Fig. 3). During the decay phase, there is a weak signature of rebrightening, which indicates a reactivation of the central engine. During and before the faint gamma-ray precursor, no optical emission was detected in our images down to a limit of ~15.3 mag in the R band. After its sudden appearance during the main gamma-ray prompt emission phase, the optical brightness remains briefly constant during the first two frames and then rises rapidly to the peak of 14.5 mag in the R band with a power-law index of $0.66 \pm 0.30$. It reaches the peak at $52 \pm 34$ s and then transitions to a decay phase with a decay index of $-1.07 \pm 0.15$ (Fig. 3), which extends all the way down to the sensitivity limit of the F60A at ~3,000 s.

So far only a small number of GRBs have been captured in the optical band before the end of the high-energy emission. Among these events, very few have been observed for the entire duration of the GRB. For most GRBs, the prompt optical emission seems to be consistent with or fainter than the extrapolation of high-energy emission to the optical band, consistent with the same synchrotron radiation origin as the gamma-rays¹⁷,¹⁸. One exception was the naked-eye burst GRB 080319B, which showed a distinct optical emission component four orders of magnitude above the extrapolation of gamma-ray emission⁶. The prompt optical flash detected from GRB 201223A shows similar behaviour. As shown in Fig. 4, its prompt optical emission is again about four orders of magnitude above the extrapolation of gamma-ray
<figure><img src="image_7.png" /></figure>

**Fig. 4** | Broadband spectra of the prompt phase in GRB 201223A. The red solid data point was observed by GWAC. The grey data points were measured by Swift BAT and other data were derived from Fermi GBM. The time duration for all the data is from -2.31 s to 7.69 s after the burst. The black dashed line denotes the best-fitting model after the joint analysis of the GWAC data, Swift BAT data and Fermi GBM data (Methods) have a spectral index of 0.24 ± 0.17 and a characteristic energy of 67.56 ± 11.60 keV. The final χ²/DoF of 317.81/216 is derived for the fitting. All the error bars represent the 1σ statistical uncertainties. The optical data are brighter than the extrapolation of the gamma-ray spectrum of GRB 201223A by about four orders of magnitude, indicating a distinct radiation mechanism for optical measurement and the high-energy band data. CPL, cutoff-power-law.

<figure><img src="image_8.png" /></figure>

**Fig. 5** | The spectral energy distribution between X-ray and optical wavelengths during the time window from 100 to 300 s after the Swift BAT trigger time. The X-ray spectrum in black is extracted from Swift XRT data. The red data are measured from GWAC data. The joint fitting with GWAC R-band data and X-ray data gives a photon index of $\beta_{OX} = 2.00 \pm 0.05$ with $\chi^2/\text{DoF} = 3.47/6$ after taking photoelectric absorption (wabs model) into account using the X-Ray Spectral Fitting Package (Xspec12)³⁴, which agrees with that derived by fitting the X-ray data only ($\beta_X = 1.77 \pm 0.49$ with $\chi^2/\text{DoF} = 4.05/5$). The fitting result with the total model (wabs + powerlaw) is shown in cyan and the only power-law component is displayed as a grey dashed line. The UVOT data, which were not included during the fitting (Methods and Supplementary Fig. 1), are also displayed. The error bars represent the 1σ errors.

emission, even though the flux is fainter by 9 mag. Considering that the redshift of GRB 080319B⁶ (z = 0.973) is lower than the redshift upper limit of GRB 201223A, the peak prompt optical luminosity of GRB 201223A is probably smaller by more than two orders of magnitude than that of GRB 080319B. Our observation suggests that whatever physical mechanism operated in the naked-eye GRB (for example synchrotron + synchrotron self-Compton⁶,¹⁹, emission from residual internal shocks²⁰ or emission from decayed neutron shells²¹) is not limited to bright events and can apply to moderately bright GRBs as well.

The peak time of the bump indicates the time when the relativistic jet begins to decelerate after interacting with a sufficient amount of mass in the external medium. Assuming that the burst has a redshift close to the upper limit (that is, $z \approx 1.85$) and taking the measured gamma-ray spectral parameters, the burst has a typical isotropic gamma-ray energy, $E_{\gamma,\text{iso}} \approx 1.8 \times 10^{52}$ erg (Methods), with a high initial Lorentz factor ($\Gamma_0 \approx 267 \zeta^{4/8} n^{-1/8}$) for its relativistic jet, where n is the external medium density and $\zeta$ is the ratio of kinetic energy to gamma-ray energy (Methods). The deceleration radius could be constrained to be $R_{\text{dec}} \approx 2.2 \times 10^{17}$ cm. During the early afterglow phase, the optical and X-ray emissions have a similar behaviour, as displayed in Fig. 3, which agrees with the prediction of the standard afterglow theory in the slow-cooling regime with $v_m < v_o < v_x < v_c$, where $v_m, v_o, v_x$ and $v_c$ are the characteristic synchrotron emission frequency with minimum electron Lorentz factor, optical frequency, X-ray frequency and synchrotron cooling frequency, respectively. The late X-ray emission is contaminated by a flaring or plateau-like rebrightening behaviour, which signifies a late-time central engine activity. The common origin of the optical and X-ray early afterglow can also be seen from the spectral energy distribution at 100–300 s (Fig. 5), which shows that the joint optical–X-ray spectral energy distribution has a spectral index ($\beta_{OX} = 2.00 \pm 0.05$) similar to that derived with the X-ray data only ($\beta_X = 1.77 \pm 0.49$).

It is widely believed that long GRBs originate from the collapse of massive stars²². The leading candidate for the long GRB progenitor is a Wolf–Rayet star²³. A major fraction of its mass is expected to be lost in the form of the stellar wind before the collapse. The fact that the ambient medium has a constant-density profile can place an upper limit on the ejected wind mass from the progenitor. For a wind profile with $\rho = A r^{-2}$ ($\rho$, wind medium density; r, distance from the burst), where $A = \dot{M}/4\pi V_w = 5 \times 10^{11} A_*$ g cm$^{-1}$ ($A_*$, parameter of stellar wind density; $V_w$, velocity of the stellar wind), the non-detection of a wind medium at early times places a tight upper limit²⁴,²⁵ of $A_* < 3.4 \times 10^{-2} n^{1/2}$ (Methods), two orders of magnitude smaller than the typical value expected from a Wolf–Rayet stellar wind with $A_* = 1$; the latter corresponds to $\dot{M} = 1 \times 10^{-5} M_{\odot} \text{yr}^{-1}$ and $V_w = 1,000$ km s$^{-1}$. Taking the highest wind velocity of ~5,000 km s$^{-1}$ from known Wolf–Rayet stars in our Galaxy²⁶, we can derive a conservative upper limit of the mass loss rate $\dot{M} < 1.7 \times 10^{-6} M_{\odot} \text{yr}^{-1}$, which gives an upper limit of the mass of the progenitor of ~3.8 $M_{\odot}$ with the relation of mass-loss rate and the stellar mass of Wolf–Rayet stars²⁷ (Methods). This is in contrast to the naked-eye GRB 080319B, which clearly showed a wind medium and a much larger mass-loss rate and Wolf–Rayet stellar mass. This suggests that the mechanism producing excessively bright prompt optical emission can operate in progenitor systems with a wide range of mass-loss rate.

The transition from prompt to afterglow emission in the optical band was reported⁵ in GRB 050820A with a long duration of ~750 s. The optical observation started 5 s after the trigger of its initial precursor, which allowed us to detect the superposition between a component that tracks late prompt emission due to continued central engine activity and another smooth component, probably associated with the onset of early afterglow. For GRB 201223A, the transition from prompt emission to afterglow in the optical wavelength is very smooth without any signature of late central engine activities, and the forward shock emission component before the deceleration of the relativistic
outflow was clearly detected immediately after the initial trigger. This offers a new insight into the diversity of the energy release of a GRB jet directly after the initial explosion. The clear prompt-to-afterglow transition signature in GRB 201223A benefits from the lack of a bright reverse shock emission component as observed in some other GRBs$^{7–9}$. Physically, this could be because either the jet is Poynting flux dominated$^{28}$ or it is a pure fireball with the reverse shock typical synchrotron frequency below the optical band at shock crossing$^{29}$. For the three possible interpretations of the prompt emission optical excess$^{6,19–21}$, a matter-dominated ejecta is needed. As a result, a fireball composition gives a unified interpretation to the early optical emission of this event.

Because GRBs are unpredictable in both time and spatial direction, simultaneous observations of the entire activity of GRBs in both gamma-rays and optical wavelength without any delay are a great challenge even after improving the high slewing speed of the follow-up telescopes. This limits progress in studying the physical processes during the prompt emission and early afterglow phases of GRBs. The successful detection of prompt optical emission directly after the trigger of this -29-s-long GRB with GWAC further confirms the feasibility of capturing any bright but short-duration signals from GRBs using large-field-of-view instruments. It is foreseeable that prompt optical observation of short duration originating from neutron stars will be made using a similar technique in the near future.

## Methods

### Optical observations and data analysis

The GWAC system has been developed for a cosmic bright optical transient survey as one of the main ground-based facilities of a China-France satellite mission (SVOM)$^{10}$ dedicated to the detection and study of GRBs, aiming to detect various short-duration astronomical events including the electromagnetic counterparts of GRBs by imaging the sky at a cadence of 15 s down to R - 16.0 mag, under automatic observation management$^{30}$. A real-time pipeline for a short-duration transient alert system was developed in the GWAC system, named the GWAC transient alert system$^{31}$. The method of catalogue cross-matching is used to search any short-duration transients in the real-time pipeline for GWAC data. All candidates passing through the filters would be followed by two 60 cm optical telescopes (F60A and F60B) within 2 min after the alerts, and consequently confirmed or rejected automatically by another real-time pipeline developed for F60A/B data$^{31}$. The first four units of GWAC with 16 cameras (diameter D = 18 cm) have been built at Xinglong Observatory, China. The total field of view is currently about 2,200$^{22}$. The location of GRB 201223A was monitored during our survey on 23 December 2012 lasting from 16:48:31.9 to 18:23:41.9 universal time (UT), which covers the onset of the burst triggered by the Swift satellite (17:58:26 UT). When our system received the alerts, GWAC did not carry out point adjustment due to its large field of view, but compared the highly precise localization of the event provided by the instruments of the Swift satellite. The images for this event were not discontinued and 256 white-band images were obtained in total.

We performed the analysis of the GWAC images with standard aperture photometry at the location of the burst and for several nearby bright reference stars by using the IRAF$^{32}$ APPHOT package, including the corrections of bias, dark and flat field in a standard manner. Because of the faintness of the transient, a small radius of the aperture for the photometry was selected, 1 FWHM pixel for each image. The FWHM is the full-width at half-maximum, which is typically used to describe the energy centralization of an image. The FWHM for each frame was individually measured using the same nearby bright source list, yielding a typical value of 1.8 pixels with a variation of 0.1 pixels during our observations. After differential photometry, the finally calibrated brightness of the optical counterpart was transformed to the R band in the Johnson-Cousins system$^{33}$. For the images obtained before the trigger time, no signal was detected. We stacked four successive single images into one co-added image to deepen our detection capability.

No credible signal was detected in any of the combined images before the Swift trigger time.

The narrow-field optical telescope F60A has a rapid follow-up system for GRBs triggered by the Swift BAT instrument. This telescope is located near the GWAC facilities and jointly operated by Guangxi University and National Astronomical Observatories, CAS, China. The diameter of the telescope is 60 cm, its field of view is 19 arcmin and the pixel scale is 0.56 arcsec when equipped with a 2k × 2k astronomical CCD detector. When GRB 220213A was triggered, F60A pointed to the location of the alert rapidly and started to image the sky 45 s after the onset of the event. A series of R and I images was obtained with a predefined strategy depending on the delay for the first measurement. All the images are processed in a standard manner with correction of the bias, dark and flat field. All the images are aligned with a reference of the bright source list in the images. Aperture photometry was utilized with the same method for GWAC images. Because of the decaying nature of the optical afterglow, the images obtained at later time were combined to increase the signal-to-noise ratio. In Fig. 2, the I magnitude was shifted to the R band by adding 0.2 mag to normalize the optical light curves.

A smoothed broken power-law model, that is

$$f = f_0 \left[ \left( \frac{t}{t_b} \right)^{\omega a_1} + \left( \frac{t}{t_b} \right)^{\omega a_2} \right]^{\frac{1}{\omega}} \quad (1)$$

was utilized to model the optical light curve with the result shown in Fig. 2, where t is the time (in units of seconds) since the Swift BAT trigger, $f_0$ is the normalization constant, $a_1$ and $a_2$ are the temporal decay indices, $t_b$ is the broken time and $\omega$ is the smoothing parameter.

### Swift and Fermi GBM data analysis

We downloaded the Swift BAT data for GRB 201223A from the Swift archive website. batbinevt was used to extract the total light curve. The time-integrated spectrum near the Swift high-energy peak from -2.31 to 7.69 s after the Swift trigger time was derived. We also downloaded GRB 201223A archival data from the Fermi GBM website. The standard analysis was carried out with the Fermi data analysis tools and the HEASoft packages. GRB 201223A was detected by several detectors. We chose the data from the Nal detectors n7 and n8 and the BGO detector b1 on the basis of the signal-to-noise ratios of each detector. The light curve (Supplementary Fig. 2) in each detector relative to the Swift BAT trigger time was extracted with gtbin. The background was selected in the time ranges of [-60 s: -20 s] and [100 s: 140 s] relative to the Swift trigger time. A joint analysis was performed via Xspec12$^{34}$ for the GWAC data, the Swift BAT data and the Fermi GBM data with three models: the single power-law model

$$A(E) = KE^{-\alpha}, \quad (2)$$

where E is the energy in keV, $\alpha$ is the power-law photon index and K is the normalization constant in photons keV$^{-1}$ cm$^{-2}$ s$^{-1}$ at 1 keV; the cutoff power-law model

$$A(E) = KE^{-\alpha} e^{-E/\beta}, \quad (3)$$

where $\beta$ is the e-folding energy of the exponential roll-off in keV, and the Band function$^{35}$ model

$$A(E) = \begin{cases} K(E/100)^{\alpha_1} \exp(-E/E_c) & \text{if } E < E_c (\alpha_1 - \alpha_2) \\ K[(\alpha_1 - \alpha_2)E_c/100]^{(\alpha_1 - \alpha_2)}(E/100)^{\alpha_2} \exp[-(\alpha_1 - \alpha_2)] & \text{if } E > E_c (\alpha_1 - \alpha_2) \end{cases}, \quad (4)$$

where $\alpha_1$ and $\beta_1$ are the low-energy and high-energy spectral indices and $E_c$ is the characteristic energy in keV. The fitting results (Supplementary Table 1) suggest that the cutoff power-law model is the best model, and the result from this model is displayed in Fig. 4.
The Swift XRT data are downloaded from the Swift data archives. The light curve (Fig. 3) and spectrum (Fig. 5) at the time epoch between 100 and 300 s after the trigger were extracted via the HEAsoft packages and the Swift data analysis tools. The Swift UVOT data for GRB 201223A were downloaded from the Swift archive website. The standard data products were obtained. The photometries in each filter were derived to build the multiwavelength light curves (Fig. 2 and Supplementary Fig. 1). The UVOT data were modelled with the assumption of an aromatic decay in optical wavelengths during the forward shock phase (Supplementary Fig. 1), which resulted in the predicted brightness in Swift UVOT-u, Swift UVOT-b and Swift UVOT-v filters 200 s after the Swift trigger time (Fig. 5). During the procedure, UVOT-white-band data were excluded because of their broad wavelength coverage, and the data from UVOT-W1, UVOT-W2 and UVOT-M2 were not considered because of their non-detection (Fig. 2 and Supplementary Fig. 1).

## Isotropic energy

The parameters of the time-integrated spectrum were adopted from the Fermi GBM data¹⁴. With the same method³⁶, the isotropic energy could be estimated by integration of the GBM spectrum from 1 keV to 10,000 keV in the burst frame, under an upper limit of $z \approx 1.85$ on the basis of the detection of the Swift UVOT with a blue filter¹³. The isotropic gamma-ray energy is estimated to be $E_{\gamma,\text{kliso}} \approx 1.8 \times 10^{52}$ erg.

## Initial Lorentz factor and deceleration radius

We can calculate the initial Lorentz factor with the peak time of the onset of the afterglow¹, $\Gamma_0 \approx 0.93^{\frac{3}{8}}(\frac{3E_k(1+z)^3}{2\pi\text{f}\text{n}\text{m}_0c^3\text{t}_{\text{dec}}})^{\frac{1}{8}} \approx 470 t_{\text{dec},2}^{-3/8} (\frac{1+z}{2})^{3/8} E_{\text{k},52}^{1/8} n^{-1/8}$, where $E_k$ is the total isotropic kinetic energy in the fireball and $t_{\text{dec}}$ is the onset of the afterglow when the relativistic jet starts to decrease, which should be near the peak time of the bump. Taking $E_{\gamma,\text{iso}} = 1.8 \times 10^{52}$ erg, and $E_k = \zeta E_{\gamma,\text{iso}} = \frac{1-\eta_{\gamma}}{\eta_{\gamma}} E_{\gamma,\text{iso}}$, where $\eta_{\gamma} = E_{\gamma,\text{iso}}/(E_{\gamma,\text{iso}} + E_{\text{k,iso}})$ is the GRB radiative efficiency, we obtain $\Gamma_0 \approx 233\zeta^{1/8}n^{-1/8}(\frac{1+z}{2})^{3/8} \approx 267\zeta^{1/8}n^{-1/8}$ when $z=1.85$ is adopted. Consequently, $R_{\text{dec}} \approx \frac{2}{c}\Gamma_0^2 t_{\text{dec}}(1+z)$ would be $-2.2 \times 10^{17}$ cm for typical parameters ($\eta_{\gamma} = 0.5$, $\zeta = 1$, $n=1$ and $z=1.85$).

## Constraint on the parameter of stellar wind density

Assuming there is a stellar wind due to the massive stars, the wind-to-interstellar medium transition time $T_r$ at transition radius $R_t$ can be estimated²⁴,²⁵ with the relation $T_r = 1.5 h (\frac{1+z}{2}) E_{\text{k},53}^{-1} A_{*,-1}^2 n^{-1} \approx 50$ s. Thus, we have $A_{*-1}^2 n^{-1} \approx 6.5 \times 10^{-3} E_{\text{k},53}$. $A_*$ is a parameter of stellar wind density²³,³⁷ scaled with the typical values in terms of the wind from a Wolf-Rayet star. The GRB radiative efficiency has a typical value $\eta_{\gamma}$ (refs. 38–41) from 3% to -90%. Assuming that $\eta_{\gamma} \approx 50\%$ for GRB 201223A, $E_k \approx 1.8 \times 10^{52}$ erg would be obtained. Consequently, an upper limit could be inferred of $A_* \approx 3.4 \times 10^{-2} n^{1/2}$.

With the definition of the stellar wind density $A = \dot{M}/4\pi V_w = 5 \times 10^{11} A_* \text{ g cm}^{-1}$, we note that for a given $A_*$ the higher the velocity $V_w$ the higher the mass loss rate $\dot{M}$. On the basis of ref. 26, the velocities of the stellar wind for the Wolf-Rayet stars in our Galaxy are distributed in the range between 700 km s⁻¹ and 5,000 km s⁻¹. Taking the highest velocity of 5,000 km s⁻¹, the upper limit of the mass of the progenitor could be estimated to be 3.8 $M_\odot$ on the basis of the relation²⁷,⁴² between the mass loss rate and the mass of a Wolf-Rayet star $\dot{M} \approx 6 \times 10^{-8} (\frac{M_{\text{wr}}}{M_\odot})^{2.5} M_\odot \text{ yr}^{-1}$.

## Data availability

Data generated or analysed during this study are included in this Article (and its Supplementary Information). Source data are provided with this paper.

## Code availability

The analysis codes used to generate the data presented in this study are available from the corresponding authors upon reasonable request.

## References

1. Zhang, B. *The Physics of Gamma-Ray Bursts* (Cambridge Univ. Press, 2018).

2. Zhang, B. et al. Physical processes shaping gamma-ray burst X-ray afterglow light curves: theoretical implications from the Swift X-Ray Telescope observations. *Astrophys. J.* **642**, 354–370 (2006).

3. Nousek, J. A. et al. Evidence for a canonical gamma-ray burst afterglow light curve in the Swift XRT data. *Astrophys. J.* **642**, 389–400 (2006).

4. Vestrand, W. T. et al. A link between prompt optical and prompt γ-ray emission in γ-ray bursts. *Nature* **435**, 178–180 (2005).

5. Vestrand, W. T. et al. Energy input and response from prompt and early optical afterglow emission in γ-ray bursts. *Nature* **442**, 172–175 (2006).

6. Racusin, J. L. et al. Broadband observations of the naked-eye γ-ray burst GRB080319B. *Nature* **455**, 183–188 (2018).

7. Akerlof, C. et al. Observation of contemporaneous optical radiation from a γ-ray burst. *Nature* **398**, 400–402 (1999).

8. Vestrand, W. T. et al. The bright optical flash and afterglow from the gamma-ray burst GRB 130427A. *Science* **343**, 38–41 (2014).

9. Troja, E. et al. Significant and variable linear polarization during the prompt optical flash of GRB 160625B. *Nature* **547**, 425–427 (2017).

10. Wei, J. et al. The deep and transient Universe in the SVOM era: new challenges and opportunities—scientific prospects of the SVOM mission. Preprint at https://arxiv.org/abs/1610.06892 (2016).

11. Gehrels, N. et al. The Swift gamma-ray burst mission. *Astrophys. J.* **611**, 1005–1020 (2004).

12. Meegan, C. et al. The Fermi Gamma-Ray Burst Monitor. *Astrophys. J.* **702**, 791–804 (2009).

13. Gropp, J. D. et al. GRB 201223A: Swift detection of a burst with a bright optical counterpart. GRB Coord. Netw. **29158**, 1 (2020).

14. Wood, J. et al. GRB 201223A: Fermi GBM detection. GRB Coord. Netw. **29161**, 1 (2020).

15. Poole, T. S. et al. Photometric calibration of the Swift ultraviolet/optical telescope. *Mon. Not. R. Astron. Soc.* **383**, 627–645 (2008).

16. Evans, P. A. et al. Methods and results of an automatic analysis of a complete sample of Swift-XRT observations of GRBs. *Mon. Not. R. Astron. Soc.* **397**, 1177–1201 (2009).

17. Shen, R.-F. & Zhang, B. Prompt optical emission and synchrotron self-absorption constraints on emission site of GRBs. *Mon. Not. R. Astron. Soc.* **398**, 1936–1950 (2009).

18. Oganesyan, G., Nava, L., Ghirlanda, G., Melandri, A. & Celotti, A. Prompt optical emission as a signature of synchrotron radiation in gamma-ray bursts. *Astron. Astrophys.* **628**, A59 (2019).

19. Kumar, P. & Panaitescu, A. What did we learn from gamma-ray burst 080319B? *Mon. Not. R. Astron. Soc.* **391**, L19–L23 (2008).

20. Li, Z. & Waxman, E. Prompt optical emission from residual collisions in gamma-ray burst outflows. *Astrophys. J. Lett.* **674**, L65 (2008).

21. Fan, Y.-Z., Zhang, B. & Wei, D.-M. Naked-eye optical flash from gamma-ray burst 080319B: tracing the decaying neutrons in the outflow. *Phys. Rev. D* **79**, 021301 (2009).

22. Woosley, S. E. & Bloom, J. S. The supernova gamma-ray burst connection. *Annu. Rev. Astron. Astrophys.* **44**, 507–556 (2006).

23. Chevalier, R. A. & Li, Z.-Y. Wind interaction models for gamma-ray burst afterglows: the case for two types of progenitors. *Astrophys. J.* **536**, 195–212 (2000).

24. Chevalier, R. A., Li, Z.-Y. & Fransson, C. The diversity of gamma-ray burst afterglows and the surroundings of massive stars. *Astrophys. J.* **606**, 369–380 (2004).

25. Jin, Z. P. et al. The X-ray afterglow of GRB 081109A: clue to the wind bubble structure. *Mon. Not. R. Astron. Soc.* **400**, 1829–1834 (2009).
26. Nugis, T. & Lamers, H. J. G. L. M. Mass-loss rates of Wolf-Rayet stars as a function of stellar parameters. *Astron. Astrophys.* **360**, 227–244 (2000).

27. Langer, N. Mass-dependent mass loss rates of Wolf-Rayet stars. *Astron. Astrophys.* **220**, 135–143 (1989).

28. Zhang, B. & Kobayashi, S. Gamma-ray burst early afterglows: reverse shock emission from an arbitrarily magnetized ejecta. *Astrophys. J.* **628**, 315–334 (2005).

29. Jin, Z. P. & Fan, Y. Z. GRB 060418 and 060607A: the medium surrounding the progenitor and the weak reverse shock emission. *Mon. Not. R. Astron. Soc.* **378**, 1043–1048 (2007).

30. Han, X. et al. The automatic observation management system of the GWAC network. I. System architecture and workflow. *Publ. Astron. Soc. Pac.* **133**, 065001 (2021).

31. Xu, Y. et al. A real-time automatic validation system for optical transients detected by GWAC. *Publ. Astron. Soc. Pac.* **132**, 054502 (2020).

32. Tody, D. The IRAF Data Reduction and Analysis System. Proc. SPIE **627**, 733 (1986).

33. Bessell, M. S. Standard photometric systems. *Annu. Rev. Astron. Astrophys.* **43**, 293–336 (2005).

34. Arnaud, K. A. XSPEC: the first ten years. In *Astronomical Data Analysis Software and Systems V* (eds Jacoby, G. H. & Barnes, J.) 17 (Astronomical Society of the Pacific Conference Series Vol. 101, Astronomical Society of the Pacific, 1996).

35. Band, D. et al. BATSE observations of gamma-ray burst spectra. I. Spectral diversity. *Astrophys. J.* **413**, 281–292 (1993).

36. Bloom, J. S., Frail, D. A. & Sari, R. The prompt energy release of gamma-ray bursts using a cosmological k-correction. *Astron. J.* **121**, 2879–2888 (2001).

37. Dai, Z. G. & Lu, T. Gamma-ray burst afterglows and evolution of postburst fireballs with energy injection from strongly magnetic millisecond pulsars. *Astron. Astrophys.* **333**, L87–L90 (1998).

38. Zhang, B. et al. GRB radiative efficiencies derived from the Swift data: GRBs versus XRFs, long versus short. *Astrophys. J.* **655**, 989–1001 (2007).

39. Beniamini, P., Nava, L. & Piran, T. A revised analysis of gamma-ray bursts' prompt efficiencies. *Mon. Not. R. Astron. Soc.* **461**, 51–59 (2016).

40. Wang, X.-G. et al. How bad or good are the external forward shock afterglow models of gamma-ray bursts? *Astrophys. J. Suppl. Ser.* **219**, 9 (2015).

41. Li, L. et al. GRB 140423A: a case of stellar wind to interstellar medium transition in the afterglow. *Astrophys. J.* **900**, 176 (2020).

42. Sari, R. & Piran, T. Predictions for the very early afterglow and the optical flash. *Astrophys. J.* **520**, 641–649 (1999).

## Acknowledgements

This study is supported by the National Natural Science Foundation of China (grants 11973055, U1938201, 12133003, U1831207, U1931133)

and partially supported by the Strategic Pioneer Program on Space Science, Chinese Academy of Sciences, grants XDA15052600 and XDA15016500. J. Wang is supported by the National Natural Science Foundation of China (grant 12173009) and the Natural Science Foundation of Guangxi (2020GXNSFDA238018). X.-Y.W. is supported by the National Natural Science Foundation of China under grant 12121003. Y.Y. is supported by the National Natural Science Foundation of China under grant 11873003. This work made use of data supplied by the UK Swift Science Data Centre at the University of Leicester.

## Author contributions

L.X. led the project and paper writing. H.L., L.X., J. Wang, C.W., H.C. and Y.Q. reduced and analysed the optical data. L.X., D.T., L.Z. and X.Y. analysed the high-energy data. X.H., X.L. and L.H. performed GWAC and F60A observations. B.Z., L.X., J.D., H.G. and J.R. presented the interpretation of the data and B.Z. contributed to paper writing. E.L., X.-Y.W., Z.D., X.W. and Y.Y. partially funded the facilities. J. Wei is the principal investigator for the GWAC GRB project. All authors reviewed the paper.

## Competing interests

The authors declare no competing interests.

## Additional information

**Supplementary information** The online version contains supplementary material available at https://doi.org/10.1038/s41550-023-01930-0.

**Correspondence and requests for materials** should be addressed to Liping Xin, Bing Zhang or Jianyan Wei.

**Peer review information** *Nature Astronomy* thanks the anonymous reviewers for their contribution to the peer review of this work.

**Reprints and permissions information** is available at www.nature.com/reprints.

**Publisher's note** Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

© The Author(s), under exclusive licence to Springer Nature Limited 2023