Magglow is a Julia module to calculate Gamma-ray Burst (GRB) afterglow light curves and spectra based on Magnetic Bullet model Y. Kusafuka & K. Asano (2024). The framework implements semi-analytic models for forward and reverse shock dynamics propagating in a stratified CSM and leptonic (synchrotron with self-absorption and self-Compton scattering with Klein-Nishina corrections) and hadronic (pp colisions and photomeson interactions) multimessenger emission mechanisms observed from arbitrary viewing angle.
Details of the methods can be found in Y. Kusafuka, K. Obayashi, K. Asano, & R. Yamazaki (2025).
The Magnetic Bullet model used in this code is successfully applied several afterglows, some of which can be found in the following works.
- GRB 221009A: Y. Kusafuka & K. Asano (2025)
- GRB 110213A: Y. Kusafuka, K. Obayashi, K. Asano, & R. Yamazaki (2025) ...
If you use this code in your research, please cite the relevant papers:
Magglow computes leptonic & hadronic emission from both forward & reverse shocks of a relativistic magnetized jet based on Magnetic Bullet model.
It includes:
- Relativistic forward and reverse shock evolution
- Any stratified density medium
- Equal arrival time surface
- Arbitrary viewing angles
- leptonic photon emission (synchrotron/SSC)
- hadronic neutrino production (pp collision/photo-meson interaction)
- Internal absorption processes (SSA/gg absorption)
- Klien-Nishina effects
It does not include (yet):
- Lateral spreading
- Structured jet
- Sedov-Taylor solution
- Polarization
- EBL absorption
If you are working on a local copy of this repo and would like to install from source, you can the run the following from the top level directory of the project.
$ git clone https://github.com/yo3-sun/Magglow.gitIn your Julia code, import the library with
include("PATH to Magglow.jl")
using .Magglow
The main function of interest is MagneticBulletAfterglow!(z,DL,t_in,nu_in,Input,Output).
See example/LC_sample.jl for a simple example.
z is a source redshift.
DL is a source luminosity distance.
t_in is an array of observed time.
nu_in is an array of observed frequency.
Input has 20 macro- and microphysics arguments.
parameters list (click to expand/collapse)
1 E0isotropic equivalent energy in erg2 G0initial Loretnz factor3 S0initial magnetization4 D0initial thickness, in cm5 n0CSM number density, in cm-36 kdensity slope (ISM:0 --- 2:wind)7 tsFiducial time-scale for energy injection, in seconds, typically 0.8 n0Number density of ISM, in cm-39 epsiron_ethermal energy fraction in electrons for FS10 epsilon_Bthermal energy fraction in magnetic field for FS11 pparticle spectral index for FS (p>2)12 fefraction of electrons that get accelerated for FS13 theta_jopening angle, in rad14 theta_oviewing angle, in rad15 epsiron_e,RSthermal energy fraction in electrons for RS16 epsilon_B,RSthermal energy fraction in magnetic field for RS17 p_RSparticle spectral index for RS (p>2)18 fe_RSfraction of electrons that get accelerated for RS19 epsiron_p,RSthermal energy fraction in protons for RS20 fp_RSfraction of protons that get accelerated for RS
Output is an array of output observed flux.
arguments list (click to expand/collapse)
1 FS e-synchrotron2 FS p-synchrotron3 FS e-SSC4 RS e-synchrotron5 RS p-synchrotron6 RS e-SSC7 FS pp e-neutrino8 FS pp mu-neutrino9 FS pp pi0 gamma10 FS pg e-neutrino11 FS pg mu-neutrino12 FS pg pi0 gamma13 RS pp e-neutrino14 RS pp mu-neutrino15 RS pp pi0 gamma16 RS pg e-neutrino17 RS pg mu-neutrino18 RS pg pi0 gamma
is_calc expresses the radiation processes.
arguments list (click to expand/collapse)
1 electron synchrotron2 proton synchrotron3 electron SSC4 pp collision5 photo-meson interaction
You can estimate several parameters using Magglow by incorporated with statistical analysis tools such as Monte Carlo or nested sampling method.
MagglowNest is a sample parameter estimation Bayesian interface by MultiNest.
We provide some example data files in the data folder. Please keep your copy as the original repository to ensure all data paths work correctly.
A sample job script file in example/MagglowNest_sample.sh may also be useful.