This python code is dedicated to compute the multi-band synchrotron emissions from the Forward-Reverse Shocks of a GRB or TDE jet.
fs.py
computes synchrotron emission from the forward shock of a jet/outflow. It includes:
- Synchrotron emission from relativistic jet or un-relativistic outflow;
- Jet/outflow dynamics cover Coasting, deceleration and Newtonian phases;
- Arbitrary medium density profile;
- Arbitrary viewing angles (on and off-axis);
- Self-absorbtion, SSC and EIC;
- Jet break effect;
- Energy injection;
- Density jump.
rs.py
computes synchrotron emission from the reverse shock of a jet/outflow.
Future:
- Neutrino emission
Clone the repository:
git clone https://github.com/leiwh/PyFRS
Or install with pip:
pip install PyFRS
It runs properly with anaconda and VS Code.
The forward and reverse shock modules can be used separately.
For forward shock (FS), import the library with import fs
in your python code.
The main function of interest isfs.FS_flux(t, nu, **Z)
. See LightCurve.ipynb
for a simple example.
-
t: a 1-D array of observer-frame times, in seconds (s)
-
nu: a 1-D array, the same shape as t, of observer-frame frequencies, in Hertz (Hz)
-
Fnu=fs.FS_flux(t, nu, **Z) is an array, same size as t and nu, the model flux in mJy at each time and frequency.
-
For forward shock afterglows
Z
has 12 required keyword arguments:
z
Redshiftk
Medium density profile indexSSC
SSCXIC
EICE0
Isotropic-equivalent energy in ergGamma0
Initial bulk Lorentz factortheta_j
Jet opening angletheta_obs
Viewing angle in degn18
CNM density at 10^18cmp
Electron energy distribution indexepsilon_e
Fraction of the shock energy into electronsepsilon_B
Fraction of the shock energy in magnetic field
For reverse shock (RS), import the library with import rs
in your python code.
The main function of interest isrs.RS_flux(t, nu, **Z)
. See LightCurve.ipynb
for a simple example.
-
t: a 1-D array of observer-frame times, in seconds (s)
-
nu: a 1-D array, the same shape as t, of observer-frame frequencies, in Hertz (Hz)
-
Fnu=rs.RS_flux(t, nu, **Z) is an array, same size as t and nu, the model flux in mJy at each time and frequency.
-
For forward shock afterglows
Z
has 12 required keyword arguments:
z
Redshiftk
Medium density profile indexSSC
SSCXIC
EICE0
Isotropic-equivalent energy in ergGamma0
Initial bulk Lorentz factortheta_j
Jet opening angletheta_obs
Viewing angle in degn18
CNM density at 10^18cmp
Electron energy distribution indexepsilon_e
Fraction of the shock energy into electronsepsilon_B
Fraction of the shock energy in magnetic field
Zhang, B. 2018, The Physics of Gamma-Ray Bursts
Gao, H., Lei, W.-H., Zou, Y.-C., Wu, X.-F., & Zhang, B. 2013, NewAR, 57, 141
Lei, W.-H., Yuan, Q., Zhang, B., & Wang, D. 2016, ApJ, 816, 20
Zhu, Z.-P., Xu, D., Fynbo, J. P. U., et al. 2023, ApJ, 948, 30