AMPy
Afterglow Modeling in Python
Overview
Afterglow Modeling in Python (AMPy) is a Python package for performing Markov Chain Mote Carlo simulations on Gamma-Ray Burst (GRB) light curves. AMPy includes its own fully analytic afterglow models as well as some of the most commonly used templated light curve models like afterglowpy [1] and the Boosted Fireball Model [2].
Features
General
Ready to use. AMPy is beginner friendly, well-documented, and works out of the box. See HERE for installation instructions.
Models are easily integrated. Have your own afterglow model? As long as the model is written in Python and has a call method that accepts AMPy's custom
observationobject, then AMPy will work with your model with no modifications to the code required. See HERE for info on integrating custom models.Convenient inputs. AMPy is most easily used with an input CSV file. Values in the CSV file can be provided in any unit system as long as they are specified in the file. For example, the photometry can be provided as
ABmags, inmJy,erg cm-2 s-2, or any other flux unit. Frequencies can even be reported in units of energy such aseV.Data groups. AMPy allows fitting different parameters to different subsets of the data via data groups.
Supports configs. Most classes have a
classmethodthat allows instantiation from a dictionary, JSON file, or TOML file. This makes running simulations simple without needing to modify the code. See HERE for an example.
Physics
Models general power-law index. GRBs are almost always modeled assuming a power-law index of 0 (ISM) or 2 (wind). AMPy's built in models allow for fitting of the power-law index rather than assuming a value. See HERE for model description.
Models stratified media. In addition to fitting for a power-law index, AMPy's built-in model supports modeling a non-uniform medium such that the power-law index and density vary with radius.
Models self absorption. AMPy's built in models model the self-absorption frequency in all regimes except when the self-absorption frequency is above both the synchrotron and cooling frequency. Modeling self absorption is optional and can easily toggled with a single boolean.
Models extinction. AMPy models both the source-frame and Milky Way extinction. AMPy supports all extinction models from the
dust_extinctionpackage [3] as well as custom extinction models that are callable via the__call__method. See HERE for an example.Models host galaxy. AMPy models the host galaxy contribution for each specified band.
Models flux types. Both spectral flux (flux density) and integrated flux are fully supported.
Models spectral indices. The Swift team often reports photon indices for GRBs that they observed. These are easily converted to spectral indices which can be modeled along with the photometry values.
Statistical
Calibration offsets (optional). Reported uncertainties often ignore uncertainties due to the photometric calibration process which leads to underestimated uncertainties. This in turn leads to over-constrained parameters. AMPy models these systematic offsets.
Slop (optional). To account for the so-called unknown unknowns, AMPy models a "slop". The slop introduces a new term in the chi-squared calculation that allows for a looser fit, but at a cost. See HERE for details.
References
[1] https://github.com/geoffryan/afterglowpy
[2] https://ui.adsabs.harvard.edu/abs/2013ApJ...776L...9D/abstract
Last updated