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/units 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
TimeThe time associated with the photometry value. The time can have any unit of time as long as it is defined in the
TimeUnitscolumn. AMPy does not support modeling uncertainties associated with time measurements.
TimeUnitsThe units associated with the value in the
Timecolumn.
ValueThe 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.
ValueLowerThe 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.
ValueUpperThe 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.
ValueUnitsThe units associated with the value in the
Valuecolumn. ForSpectralFluxandIntegratedFluxmeasurements only.
ValueTypeThe type of measurement. Must be
SpectralFlux,IntegratedFlux, orSpectralIndex.
WaveThe effective band frequency or wavelength. For
SpectralFluxmeasurements only.
WaveLowerThe lower integration limit. For
IntegratedFluxandSpectralIndexmeasurements only.
WaveUpperThe upper integration limit. For
IntegratedFluxandSpectralIndexmeasurements only.
WaveUnitsThe units associated with the
WaveorWaveLower/WaveUppercolumn(s).
Optional
CalGroupThe name of the calibration offset group.
HostGroupThe name of the host group.
DataGroupThe name of the data group.
FilterThe name of the photometry band.
Filteris 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 TOML 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]
This section is only meant to describe how to define calibration offsets in the configuration file. To learn what calibration offsets are and why you may want to model them, see ??.
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]
This section is only meant to describe how to define host galaxy contributions in the configuration file. To learn what host galaxy contributions are and why you may want to model them, see ??.
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]
This section is only meant to describe how to define slop in the configuration file. To learn what slop is and why you may want to model it, see ??.
Last updated