DeepGlow: Neural Network emulation of BOXFIT
DeepGlow is a feed-forward neural network trained to emulate BOXFIT simulation data of gamma-ray burst (GRB) afterglows. This package provides an easy interface to generate GRB afterglow spectra and light curves mimicking those generated through BOXFIT with high accuracy. Details are provided in the published paper: doi.org/10.1017/pasa.2023.32.
This repository also contains the code used to generate the training data and to train the neural networks.
Installation
Installation is straightforward via pip:
pip install DeepGlow
DeepGlow specifically requires numpy, TensorFlow 2.x.x, and the importlib.resources package. For testing, pytest is needed as well.
Use
To generate light curves or spectra, create an instance of the Emulator class specifying the progenitor environment (either ism or wind):
from DeepGlow import Emulator
model = Emulator(simtype='ism')
The flux function of the Emulator class returns the flux values in mJy. It takes the three arguments params, t_obs and nu_obs corresponding to an array of the GRB afterglow parameters, observing times in seconds and observing frequencies in Hz. Each observing time value in the t_obs array must correspond to an observing frequency value in the nu_obs array. The afterglow parameters need to be specified in the following order in the params array:
- $z$ : redshift.
- $\log_{10} d_{L,28}$ : luminosity distance (log10 of 10^28 cm).
- $\log_{10} E_\mathrm{K,iso,53}$ : isotropic-equivalent energy (log10 of 10^53 erg).
- $\log_{10} n_\mathrm{ref}$ : circumburst medium density (log10 of cm^-3).
- $\theta_0$ : jet half-opening angle (rad).
- $\theta_\mathrm{obs} / \theta_0$ : off-axis observer angle as a fraction of the jet half-opening angle.
- $p$ : electron spectral index.
- $\log_{10} \bar{\epsilon}_e \equiv \frac{p-2}{p-1} \epsilon_e$ : energy fraction in accelerated electrons (in log10), with factor of $(p - 2) / (p - 1)$ absorbed.
- $\log_{10} \epsilon_B$ : energy fraction in magnetic field (in log10).
- $\log_{10} \xi_N$ : fraction of electrons accelerated (in log10).
For example:
import numpy as np
GRB_params = np.array([0,-1,0,0,0.1,0.1,2.2,-2,-2,0])
observing_times=np.array([1e5,1e6,1e7])
observing_frequencies = np.array([1e9,1e12,1e15])
flux_values = model.flux(params=GRB_params,t_obs=observing_times,nu_obs=observing_frequencies)
print(flux_values)
# [5.75068180e-01, 8.58790301e-01, 5.39014321e-05]
Training data
The training data generated with BOXFIT is provided through a Zenodo data package: https://zenodo.org/record/7472542
References
- DeepGlow paper: https://doi.org/10.1017/pasa.2023.32
- BOXFIT: van Eerten, H., Horst, A. v. d., & MacFadyen, A. 2012, The Astrophysical Journal, 749, 44
Metadata
Release files for DeepGlow 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| DeepGlow-1.1.0.tar.gz | 45.9 MB | Without provenance | Details for DeepGlow-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| DeepGlow-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for DeepGlow-1.1.0-py3-none-any.whl |
Total release size: 91.9 MB
Release files / DeepGlow-1.1.0.tar.gz
| Download URL | DeepGlow-1.1.0.tar.gz |
|---|---|
| Size | 45.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6986d0e2079afb2638bdebb9e41537bc94ae29db00df3f1bafc4706eb5b16480
|
|
BLAKE2b-256 checksum How to use checksums |
5acd1a3157b6629e3cf5cfb96a389365412cd79c77797c299a1b25b55bfb6292
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.18
|
Release files / DeepGlow-1.1.0-py3-none-any.whl
| Download URL | DeepGlow-1.1.0-py3-none-any.whl |
|---|---|
| Size | 45.9 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
053dc17f27fe550e0fe87e5b25cecfa93bf50809756a46bc56817f4e537b2fe8
|
|
BLAKE2b-256 checksum How to use checksums |
651fea4e242fa428286bbedd93e1ecf89cabc2e12f261379989c492249afef8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.18
|
Security for DeepGlow 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.