License: CC BY 4.0
arXiv:2401.12354v1 [astro-ph.HE] 22 Jan 2024

The Gravitational Wave AfterglowPy Analysis (GWAPA) webtool

R. A. J. Eyles-Ferris School of Physics and Astronomy, University of Leicester
University Road
Leicester, LE1 7RH, UK
H. van Eerten Department of Physics, University of Bath
Claverton Down
Bath, BA2 7AY , UK
E. Troja Dipartimento di Fisica, Università Degli Studi di Roma - Tor Vergata
via della Ricera Scientifica 1
00100 Rome, IT
P. T. O’Brien School of Physics and Astronomy, University of Leicester
University Road
Leicester, LE1 7RH, UK
Abstract

We present the first release of the Gravitational Wave AfterglowPy Analysis (GWAPA) webtool111Available at https://gwapa.web.roma2.infn.it/. GWAPA is designed to provide the community with an interactive tool for rapid analysis of gravitational wave afterglow counterparts and can be extended to the general case of gamma-ray burst afterglows seen at different angles. It is based on the afterglowpy package and allows users to upload observational data and vary afterglow parameters to infer the properties of the explosion. Multiple jet structures, including top hat, Gaussian and power laws, in addition to a spherical outflow model are implemented. A Python script for MCMC fitting is also available to download, with initial guesses taken from GWAPA.

Gamma-ray bursts (629) — Astronomy data analysis (1858) — Astronomy data modeling (1859)
software: afterglowpy (Ryan et al., 2020), Astropy (Astropy Collaboration et al., 2013, 2018, 2022), Bokeh (Bokeh Development Team, 2023), Django (Django Software Foundation, 2023), emcee (Foreman-Mackey et al., 2013)

1 Introduction

The Laser Interferometer Gravitational-Wave Observatory (LIGO), Virgo interferometer and Kamioka Gravitational Wave Detector (KAGRA) have begun their fourth observing run (O4), enabling us to search for electromagnetic (EM) counterparts of gravitational wave sources. During O4, it is crucial for the community to have tools to rapidly respond to and analyse possible EM counterparts. To that end, we introduce the first release of the Gravitational Wave AfterglowPy Analysis (GWAPA v0.9.17b) webtool.

This first release of GWAPA is designed to allow users to easily analyse the afterglows of gravitational wave counterparts and gamma-ray bursts (GRBs), and infer properties of the explosion and its environment. Such analysis can also aid in the rapid identification of kilonovae superimposed on the standard afterglow signal (e.g. Troja, 2023). To achieve these aims, GWAPA provides a data repository for GW and GRB afterglows and a web-based interactive access to the afterglowpy Python package (Ryan et al., 2020) and incorporate five jet structures and a spherical outflow222Referred to as a cocoon in earlier releases of afterglowpy. model into this release of GWAPA. GWAPA includes an intuitive interface powered by the Bokeh Python package (Bokeh Development Team, 2023) allowing interactive plotting and comparison of models and observed data.

2 Webtool design

2.1 Backend

GWAPA is built around the afterglowpy Python package (v0.7.3, Ryan et al., 2020). Afterglowpy uses the single shell approximation of van Eerten et al. (2010) and van Eerten (2018), which approximates the physics of the ejecta and forward shock as a single radially uniform fluid element. Jet spreading is also approximated and a trans-relativistic equation of state interpolates between the ultra-relativistic and non-relativistic regimes (van Eerten, 2013; Nava et al., 2013). Afterglowpy has been calibrated using the BoxFit code (van Eerten et al., 2012), which derives afterglows from the results of high resolution 2D hydrodynamics simulations.

Traditionally, GRB jets are assumed to be ‘top hat’ jets, with roughly constant energy across the jet and a precipitous decline at its edge. However, it is likely that jets have significantly more structure and afterglowpy includes several different possibilities. For instance, both Gaussian and power law structures are modelled. The energies of these jets varies with angle θ𝜃\thetaitalic_θ as

E(θ)=E0exp(θ22θc2)𝐸𝜃subscript𝐸0superscript𝜃22superscriptsubscript𝜃𝑐2E(\theta)=E_{0}\exp\left(-\frac{\theta^{2}}{2\theta_{c}^{2}}\right)italic_E ( italic_θ ) = italic_E start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT roman_exp ( - divide start_ARG italic_θ start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_ARG start_ARG 2 italic_θ start_POSTSUBSCRIPT italic_c end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_ARG ) (1)

and

E(θ)=E0(1+θ2bθc2)b/2𝐸𝜃subscript𝐸0superscript1superscript𝜃2𝑏superscriptsubscript𝜃𝑐2𝑏2E(\theta)=E_{0}\left(1+\frac{\theta^{2}}{b\theta_{c}^{2}}\right)^{-b/2}italic_E ( italic_θ ) = italic_E start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ( 1 + divide start_ARG italic_θ start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_ARG start_ARG italic_b italic_θ start_POSTSUBSCRIPT italic_c end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_ARG ) start_POSTSUPERSCRIPT - italic_b / 2 end_POSTSUPERSCRIPT (2)

respectively, where θcsubscript𝜃𝑐\theta_{c}italic_θ start_POSTSUBSCRIPT italic_c end_POSTSUBSCRIPT is the width and b𝑏bitalic_b is the power law index. To model a structured jet, afterglowpy breaks it down into many top hat components. The properties of the blast wave for each of these components, primarily the radial position of the shock, dimensionless four-velocity and time-dependent jet opening angle, are described by a set of ordinary differential equations. These are numerically integrated and solved and the top hat components are summed over to derive the resultant afterglow of the GRB.

We used afterglowpy to generate a grid of predefined models for five jet structures (top hat, Gaussian, Gaussian with core, smooth power law, power law with core) and a spherical outflow model. For each structure, we generated the model data at each point in a parameter grid covering the diverse population of GRBs, for example, Eγ,isosubscript𝐸𝛾isoE_{\rm\gamma,iso}italic_E start_POSTSUBSCRIPT italic_γ , roman_iso end_POSTSUBSCRIPT from 1049superscript104910^{49}10 start_POSTSUPERSCRIPT 49 end_POSTSUPERSCRIPT to 1055superscript105510^{55}10 start_POSTSUPERSCRIPT 55 end_POSTSUPERSCRIPT erg and observer angles from 0° to similar-to\sim45°. For the spherical outflow, a different parameter grid was used due to the nature of the physics involved. We note that these parameter grids are somewhat coarse, again to limit computational load, however the grid is still fine enough to allow inference of GRB properties to a reasonable degree of precision and identify significant outliers to typical afterglow behaviour. Interactive tools, described in Section 2.2, are used to select a model to be plotted and compared with observed data. This allows the user to infer properties of a GRB, again while minimising computational load.

2.2 User interface

Refer to caption
Figure 1: The user interface for GWAPA, built using the Bokeh package.

The user facing portion of the GWAPA webtool was developed using Bokeh v2.4.3, a Python package designed to provide exactly the type of interactive tool we desired (Bokeh Development Team, 2023). Bokeh provides both a dynamic plotting package and a selection of ‘widgets’, tools to control and interact with plots, which we have used to build a comprehensive user interface for GWAPA.

We show the user interface for GWAPA in Figure 1. It allows users to select a GRB from a small sample of examples to be plotted and downloaded, meaning GWAPA can also act as a data repository. While there are currently not plans to allow public uploads to this repository, it is a possibility that could be explored in future.. Alternatively, users can upload their own data which are automatically parsed assuming a specific format, details of which are given on GWAPA’s Tutorial page.

The bands to be plotted can also be selected and GWAPA provides a wide selection of options, ranging from X-ray to radio. All models include data for all bands allowing predictions for unobserved bands to be made with uploaded data. Both the flux density (Jy, mJy, μ𝜇\muitalic_μJy or erg s11{}^{-1}start_FLOATSUPERSCRIPT - 1 end_FLOATSUPERSCRIPT cm22{}^{-2}start_FLOATSUPERSCRIPT - 2 end_FLOATSUPERSCRIPT Hz11{}^{-1}start_FLOATSUPERSCRIPT - 1 end_FLOATSUPERSCRIPT) and time units (seconds or days) can also be changed for ease of interpretation.

The user can select a jet structure and vary the parameters of the GRB and afterglow using Bokeh widgets which dynamically change to appropriate options, for instance, when the spherical outflow model is selected. The widgets are fixed to the ranges in the parameter grids and the relevant model is loaded and plotted to be compared with the selected data. The redshift is free to vary to any value and GWAPA assumes a Planck cosmology when adjusting model fluxes (Planck Collaboration et al., 2020). The user can then vary parameters appropriately to approximate the behaviour seen in their data.

A dynamically generated Python fitting script can also be downloaded. This script uses the values inferred using GWAPA as an initial guess for a full Markov Chain Monte Carlo fitting procedure using the emcee module (Foreman-Mackey et al., 2013) and allows more accurate inference of the final parameters. This script is designed only as a starting point, and further refinement is likely required to produce publishable results. Nevertheless, it provides easy access to afterglow fitting with afterglowpy.

Finally, Bokeh includes some additional tools to interact with the plot, for instance, to zoom or to download and save the plot.

3 Conclusion

We have presented and described the first release of the Gravitational Wave AfterglowPy Analysis (GWAPA) webtool, designed to provide the community with an easy to use tool for rapid initial analysis of GRB afterglows. This release of GWAPA is now live and available at https://gwapa.web.roma2.infn.it/.

We thank Geoff Ryan for invaluable insight and discussion. This work was funded by the European Union’s Horizon 2020 Programme under the AHEAD2020 project (grant agreement number 871158), by the European Research Council through the Consolidator grant BHianca (grant agreement ID 101002761) and by the National Science Foundation (under award number 2108950).

References

  • Astropy Collaboration et al. (2013) Astropy Collaboration, Robitaille, T. P., Tollerud, E. J., et al. 2013, A&A, 558, A33, doi: 10.1051/0004-6361/201322068
  • Astropy Collaboration et al. (2018) Astropy Collaboration, Price-Whelan, A. M., Sipőcz, B. M., et al. 2018, AJ, 156, 123, doi: 10.3847/1538-3881/aabc4f
  • Astropy Collaboration et al. (2022) Astropy Collaboration, Price-Whelan, A. M., Lim, P. L., et al. 2022, ApJ, 935, 167, doi: 10.3847/1538-4357/ac7c74
  • Bokeh Development Team (2023) Bokeh Development Team. 2023, Bokeh: Python library for interactive visualization, v2.4.3. https://bokeh.org
  • Django Software Foundation (2023) Django Software Foundation. 2023, Django, v4.2.1. https://djangoproject.com
  • Foreman-Mackey et al. (2013) Foreman-Mackey, D., Hogg, D. W., Lang, D., & Goodman, J. 2013, PASP, 125, 306, doi: 10.1086/670067
  • Nava et al. (2013) Nava, L., Sironi, L., Ghisellini, G., Celotti, A., & Ghirlanda, G. 2013, MNRAS, 433, 2107, doi: 10.1093/mnras/stt872
  • Planck Collaboration et al. (2020) Planck Collaboration, Aghanim, N., Akrami, Y., et al. 2020, A&A, 641, A6, doi: 10.1051/0004-6361/201833910
  • Ryan et al. (2020) Ryan, G., van Eerten, H., Piro, L., & Troja, E. 2020, ApJ, 896, 166, doi: 10.3847/1538-4357/ab93cf
  • Troja (2023) Troja, E. 2023, Universe, 9, 245, doi: 10.3390/universe9060245
  • van Eerten (2013) van Eerten, H. 2013, arXiv e-prints, arXiv:1309.3869, doi: 10.48550/arXiv.1309.3869
  • van Eerten (2018) —. 2018, International Journal of Modern Physics D, 27, 1842002, doi: 10.1142/S0218271818420026
  • van Eerten et al. (2012) van Eerten, H., van der Horst, A., & MacFadyen, A. 2012, ApJ, 749, 44, doi: 10.1088/0004-637X/749/1/44
  • van Eerten et al. (2010) van Eerten, H., Zhang, W., & MacFadyen, A. 2010, ApJ, 722, 235, doi: 10.1088/0004-637X/722/1/235