GRB Afterglow Models
Project description
Semi-analytic GRB Afterglow models
A Python module to calculate GRB afterglow light curves and spectra. Makes liberal use of van Eerten & MacFadyen 2010 and van Eerten 2018. This code is under active development.
Attribution
If you use this code in a publication, please refer to the package by name and cite "Ryan, G., van Eerten, H., Troja, E., and Piro, L. (in prep)". A publication describing the code is forthcoming in the very near future.
Features
afterglowpy computes synchrotron emission from the forward shock of a relativistic blast wave. It includes:
- Fully trans-relativistic shock evolution through a constant density medium.
- On-the-fly integration over the equal-observer-time slices of the shock surface.
- Approximate prescription for jet spreading.
- Arbitrary viewing angles.
- Angularly structured jets, ie. E(θ)
- Spherical velocity-stratified outflows, ie. E(u)
- Counter-jet emission.
It has limited support (these should be considered experimental) for:
- Initial energy injection
- Inverse comption spectra
- Spatially-resolved intensity maps
- Early coasting phase
It does not include (yet):
- External wind medium, ie. n ∝ r-2
- Synchrotron self-absorbtion
- Reverse shock emission
afterglowpy has been calibrated to the BoxFit code (van Eerten, van der Horst, & Macfadyen 2011, available at the Afterglow Library) and produces similar light curves for top hat jets (within 50% when same parameters are used) both on- and off-axis. Its jet models by default do not include an initial coasting phase, which may effect predictions for early observations.
Installation/Building
To install for development
$ python3 setup.py develop
To install
$ python3 setup.py install
Using
This interface will be updated to be more sensible in the VERY near future
In your python code, import the library with import afterglowpy as grb.
The main function of interest isgrb.fluxDensity(t, nu, jetType, specType, *pars, **kwargs). See tests/plotLC.py for a simple example.
jetType can be -1 (top hat), 0 (Gaussian), 1 (Power Law w/ core), 2 (Gaussian w/ core), 3 (Cocoon), or 4 (Smooth Power Law).
specType can be 0 (global cooling time, no inverse compton) or 1 (global cooling time, inverse compton).
For jet-like afterglows (jetTypes -2, -1, 0, 1, 2, and 4) pars has 14 positional arguments:
0 thetaVviewing angle in radians1 E0on-axis isotropic equivalent energy in erg2 thetaChalf-width of the jet core in radians (jetType specific)3 thetaW"wing" truncation angle of the jet, in radians4 bpower for power-law structure, θ-b5 L0Fiducial luminosity for energy injection, in erg/s, typically 0.6 qTemporal power-law index for energy injection, typically 0.7 tsFiducial time-scale for energy injection, in seconds, typically 0.8 n0Number density of ISM, in cm-39 pElectron distribution power-law index (p>2)10 epsilon_eThermal energy fraction in electrons11 epsilon_BThermal energy fraction in magnetic field12 xi_NFraction of electrons that get accelerated13 d_LLuminosity distance in cm
For cocoon-like afterglows (jetType 3) pars has 14 positional arguments:
0 umaxInitial maximum outflow 4-velocity1 uminMinium outflow 4-velocity2 EiFiducial energy in velocity distribution, E(>u) = Ei u-k.3 kPower-law index of energy velocity distribution4 MejMass of material at `umax' in solar masses5 L0Fiducial luminosity for energy injection, in erg/s, typically 0.6 qTemporal power-law index for energy injection, typically 0.7 tsFiducial time-scale for energy injection, in seconds, typically 0.8 n0Number density of ISM, in cm-39 pElectron distribution power-law index (p>2)10 epsilon_eThermal energy fraction in electrons11 epsilon_BThermal energy fraction in magnetic field12 xi_NFraction of electrons that get accelerated13 d_LLuminosity distance in cm
Keyword arguments are:
zredshift (defaults to 0)tRestime resolution of shock-evolution scheme, number of sample points per decade in timelatReslatitudinal resolution for structured jets, number of shells perthetaCrtoltarget relative tolerance of flux integrationspreadboolean (defaults to True), whether to allow the jet to spread.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file afterglowpy-0.5.0.tar.gz.
File metadata
- Download URL: afterglowpy-0.5.0.tar.gz
- Upload date:
- Size: 27.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
519ad320dac3fbb847c7a61f6f65a132b85bc8fce8b5dde5d221bc659314844c
|
|
| MD5 |
c7c1d6af322f8c747f643fb743e85c62
|
|
| BLAKE2b-256 |
ea03bf763304fcdc63300a355ceae143c72f09b89387d6bcc6f92e7d9712622d
|
File details
Details for the file afterglowpy-0.5.0-cp37-cp37m-macosx_10_13_x86_64.whl.
File metadata
- Download URL: afterglowpy-0.5.0-cp37-cp37m-macosx_10_13_x86_64.whl
- Upload date:
- Size: 54.1 kB
- Tags: CPython 3.7m, macOS 10.13+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a03938dfbf27218613ae40d5283dd55b976a8cf378ae67b3b992665d53b342fd
|
|
| MD5 |
e5532f2ed148dbea5d4a9771abbf1ea2
|
|
| BLAKE2b-256 |
574a4c843527bc77b9449b976d21203476c874406a371e8b4109feafb10675e7
|