Automated Molecular Excitation Bayesian line-fitting Algorithm
amoeba2
is a Bayesian model of the 1612, 1665, 1667, and 1720 MHz hyperfine transitions of OH written in the bayes_spec
spectral line modeling framework. amoeba2
is inspired by AMOEBA and Petzler et al. (2021).
Read below to get started, and check out the tutorials here: https://amoeba2.readthedocs.io
- Installation
- Notes on Physics & Radiative Transfer
- Models
- Syntax & Examples
- Issues and Contributing
- License and Copyright
Install with pip
in a conda
virtual environment:
conda create --name amoeba2 -c conda-forge pymc pytensor pip
conda activate amoeba2
pip install amoeba2
Alternatively, download and unpack the latest release, or fork the repository and contribute to the development of amoeba2
!
Install in a conda
virtual environment:
cd /path/to/amoeba2
conda env create -f environment.yml
conda activate amoeba2-dev
pip install -e .
All models in amoeba2
apply the same physics and equations of radiative transfer.
The transition optical depth is taken from Magnum & Shirley (2015) equation 29. The excitation temperature is allowed to vary between transitions (a non-LTE assumption) and clouds. The excitation temperatures of the 1612, 1665, and 1667 MHz transitions are free, whereas that of the 1720 MHz transition is derived from the excitation temperature sum rule.
The radiative transfer is calculated explicitly assuming an off-source background temperature bg_temp
(see below) similar to Magnum & Shirley (2015) equation 23. By default, the clouds are ordered from nearest to farthest, so optical depth effects (i.e., self-absorption) may be present.
Notably, since these are forward models, we do not make assumptions regarding the optical depth or the Rayleigh-Jeans limit. These effects are predicted by the model. There is one exception: the ordered
argument, described below.
The models provided by amoeba2
are implemented in the bayes_spec
framework. bayes_spec
assumes that the source of spectral line emission can be decomposed into a series of "clouds", each of which is defined by a set of model parameters. Here we define the models available in amoeba2
.
AbsorptionModel
is a model that predicts the OH hyperfine absorption (1-exp(-tau)
) spectra. The SpecData
keys for this model must be "absorption_1612", "absorption_1665", "absorption_1667", and "absorption_1720". The following diagram demonstrates the relationship between the free parameters (empty ellipses), deterministic quantities (rectangles), model predictions (filled ellipses), and observations (filled, round rectangles). Many of the parameters are internally normalized (and thus have names like _norm
). The subsequent tables describe the model parameters in more detail.
Cloud Parametervariable
|
Parameter | Units | Prior, where ( prior_{variable}
|
Defaultprior_{variable}
|
---|---|---|---|---|
tau |
Line-center optical depth | `` | [0.1, 0.1] |
|
log10_depth |
log10 line-of-sight depth | pc |
[0.0, 0.25] |
|
log10_Tkin |
log10 kinetic temperature | K |
[2.0, 1.0] |
|
velocity |
Velocity | km s-1 |
[0.0, 10.0] |
Hyper Parametervariable
|
Parameter | Units | Prior, where ( prior_{variable}
|
Defaultprior_{variable}
|
---|---|---|---|---|
log10_nth_fwhm_1pc |
Non-thermal broadening at 1 pc | km s-1 |
[0.2, 0.1] |
|
log10_depth_nth_fwhm_power |
Non-thermal broadening vs. depth power law index | `` | [0.4, 0.1] |
|
baseline_coeffs |
Normalized polynomial baseline coefficients | `` | [1.0]*(baseline_degree + 1) |
An additional parameter to AbsorptionModel
is mainline_pos_tau
. If True
, then the mainline (1665 MHz and 1667 MHz) optical depths are required to be positive by changing the prior distribution as follows.
Cloud Parametervariable
|
Parameter | Units | Prior, where ( prior_{variable}
|
Defaultprior_{variable}
|
---|---|---|---|---|
tau |
Line-center optical depth | `` | [0.1, 0.1] |
EmissionAbsorptionModel
is a more physically motivated model that also predicts the brightness temperature spectra assuming a given background source brightness temperature (where bg_temp
is in K
and is supplied during model initialization; EmissionAbsorptionModel(bg_temp=3.77)
is the default). The SpecData
keys for this model must be "absorption_1612", "absorption_1665", "absorption_1667", "absorption_1720", "emission_1612", "emission_1665", "emission_1667", and "emission_1720". The following diagram demonstrates the model, and the subsequent table describe the additional model parameters.
Cloud Parametervariable
|
Parameter | Units | Prior, where ( prior_{variable}
|
Defaultprior_{variable}
|
---|---|---|---|---|
log10_N0 |
log10 column density in lowest energy state | cm-2 |
[13.0, 1.0] |
|
log_boltz_factor |
log Boltzmann factor (-h*freq/(k*Tex) ) |
`` | $\ln B \sim {\rm Normal}(\mu=p_0, \sigma=p_1) | [-0.1, 0.1] |
log10_depth |
log10 line-of-sight depth | pc |
[0.0, 0.25] |
|
log10_Tkin |
log10 kinetic temperature | K |
[2.0, 1.0] |
|
velocity |
Velocity | km s-1 |
[0.0, 10.0] |
Hyper Parametervariable
|
Parameter | Units | Prior, where ( prior_{variable}
|
Defaultprior_{variable}
|
---|---|---|---|---|
log10_nth_fwhm_1pc |
Non-thermal broadening at 1 pc | km s-1 |
[0.2, 0.1] |
|
log10_depth_nth_fwhm_power |
Non-thermal broadening vs. depth power law index | `` | [0.4, 0.1] |
|
baseline_coeffs |
Normalized polynomial baseline coefficients | `` | [1.0]*(baseline_degree + 1) |
An additional parameter to EmissionAbsorptionModel
is mainline_pos_tau
. If True
, then the mainline (1665 MHz and 1667 MHz) optical depths are required to be positive by changing the prior distribution as follows.
Cloud Parametervariable
|
Parameter | Units | Prior, where ( prior_{variable}
|
Defaultprior_{variable}
|
---|---|---|---|---|
log_boltz_factor |
log Boltzmann factor (h*freq/(k*Tex) ) |
`` | $\ln B \sim {\rm HalfNormal}(\sigma=p_1) | [0.1, 0.1] |
An additional parameter to set_priors
for both the AbsorptionModel
and EmissionAbsorptionModel
is ordered
. By default, this parameter is False
, in which case the order of the clouds is from nearest to farthest. Sampling from these models can be challenging due to the labeling degeneracy: if the order of clouds does not matter (i.e., the emission is optically thin), then each Markov chain could decide on a different, equally-valid order of clouds.
If we assume that the emission is optically thin, then we can set ordered=True
, in which case the order of clouds is restricted to be increasing with velocity. This assumption can drastically improve sampling efficiency. When ordered=True
, the velocity
prior is defined differently:
Cloud Parametervariable
|
Parameter | Units | Prior, where ( prior_{variable}
|
Defaultprior_{variable}
|
---|---|---|---|---|
velocity |
Velocity | km s-1 |
[0.0, 1.0] |
See the various tutorial notebooks under docs/source/notebooks. Tutorials and the full API are available here: https://amoeba2.readthedocs.io.
Anyone is welcome to submit issues or contribute to the development of this software via Github.
Copyright(C) 2024 by Trey V. Wenger; [email protected]. This code is licensed under MIT license (see LICENSE for details)