Schemas

Input File

AMPy provides built-in classes and methods for reading photometry data from a CSV file. The description of the CSV file is provided below. Values may be entered using any units defined in astropy.units. See https://docs.astropy.org/en/stable/unitsarrow-up-right for more info on astropy units.

See Observation for instructions on how to read the input file.

See Also

Data groups, calibrations groups, host groups!

Columns

Required

Time

The time associated with the photometry value. The time can have any unit of time as long as it is defined in the TimeUnits column. AMPy does not support modeling uncertainties associated with time measurements.

TimeUnits

The units associated with the value in the Time column.

Value

The measurement value (flux or spectral index). The measurement value can have any (flux or spectral index) unit as long as it is defined in ValueUnits.

ValueLower

The lower uncertainty associated with Value. For example, if the measurement is 0.1 +/- 0.02, then 0.02 would be stored here, not 0.08.

ValueUpper

The upper uncertainty associated with Value. For example, if the measurement is 0.1 +/- 0.02, then 0.02 would be stored here, not 0.12.

ValueUnits

The units associated with the value in the Value column. For SpectralFlux and IntegratedFlux measurements only.

ValueType

The type of measurement. Must be SpectralFlux, IntegratedFlux , or SpectralIndex.

Wave

The effective band frequency or wavelength. For SpectralFlux measurements only.

WaveLower

The lower integration limit. For IntegratedFlux and SpectralIndex measurements only.

WaveUpper

The upper integration limit. For IntegratedFlux and SpectralIndex measurements only.

WaveUnits

The units associated with the Wave or WaveLower/WaveUpper column(s).

Optional

CalGroup

The name of the calibration offset group.

HostGroup

The name of the host group.

DataGroup

The name of the data group.

Filter

The name of the photometry band. Filter is not used in MCMC fitting, but can be useful for plotting routines.

Example


Input Parameter Config

One of the most powerful things about AMPy is that it can easily be used with any custom afterglow model. Custom models can have any arbitrary parameters with any naming convention.

The input parameter config tells AMPy what to model and what parameters to use with those models. Models are defined using the TOML tables while the parameters to use with those models are elements in those tables.

Parameters

Parameters are defined by creating key/value pairs that represent the MCMCParameter objects. See ?? for information.

Example

If you want to fit for two parameters, x and y, and use a fixed value for z, it would look like:

Tables

AMPy has built-in support for reading TOMLarrow-up-right configuration files. There is only one required table, but there are four optional tables that will be read in if present.

Model [required]

The items in the model table must have names that match the parameter names of the model class that will be used when running MCMC.

For example, if you have a model class:

Then the model table in the TOML file could look like:

When AMPy runs, it instantiates your chosen model by unpacking a dictionary with these names as keys. So, if the names in the the TOML file don't match the required model parameters, AMPy will not be able to instantiate the model and exit.

Extinction [optional]

AMPy optionally models dust extinction for both the source frame and Milky Way. The convention for the extinction tables in the TOML file is slightly less convenient than for the model table. This is because dust extinction is typically modeled using Ebv but the models in the dust_extinction package use Rv to instantiate the model, and then use Ebv to model the reddening.

So, rather than naming the parameters after the model parameters, you name them Ebv and AMPy will figure out what to do.

To model both using the CCM89 model from the dust_extinction package, the TOML file could look like this:

Offsets [optional]

circle-exclamation

To tell AMPy that you want to model a calibration offset, you can use the offsets table. For each band that you want to model, you can add an element to that table.

The name in the TOML file must match the name in the CalGroup column in the input CSV file. This is how AMPy knows where to apply the calibration offsets. Additionally, the value, or the prior values, need to be defined in magnitude space, not flux space.

Host [optional]

circle-exclamation

To tell AMPy that you want to model a host galaxy contribution, you can use the host table. For each band that you want to model, you can add an element to that table.

The name in the TOML file must match the name in the HostGroup column in the input CSV file. This is how AMPy knows where to apply the host galaxy contribution. Additionally, the value, or the prior values, need to be defined in flux space using mJy, not magnitude space.

In the example below, AMPy will add 1.2 mJy to all modeled data that had the g_host value in the HostGroup column in the input CSV file. See ?? for implementation details.

Slop [optional]

circle-exclamation

Last updated