Skip to main content

A Bayesian Model of Radio Recombination Line Emission

Project description

bayes_yplus

A Bayesian Model of Radio Recombination Line Emission

bayes_yplus implements models to infer the helium abundance (y+) from radio recombination line (RRL) observations.

Installation

Basic Installation

Install with pip:

pip install bayes_yplus

Development Installation

Alternatively, download and unpack the latest release, or fork the repository and contribute to the development of bayes_yplus!

Install in a conda virtual environment:

cd /path/to/bayes_yplus
conda env create -f environment.yml
conda activate bayes_yplus-dev
pip install -e .

Notes on Physics & Radiative Transfer

All models in bayes_yplus assume the emission is optically thin. The helium RRL is assumed to have a fixed centroid velocity -122.15 km/s from that of the hydrogen RRL.

Models

The models provided by bayes_yplus 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 bayes_yplus.

YPlusModel

The basic model is YPlusModel. The model assumes that the emission can be explained by hydrogen and helium RRL emission from discrete clouds. 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.

hfs model graph

Cloud Parameter
variable
Parameter Units Prior, where
($p_0, p_1, \dots$) = prior_{variable}
Default
prior_{variable}
H_area H RRL line area mK km s-1 $\int T_{B, \rm H} dV \sim {\rm Gamma}(\alpha=2.0, \beta=1.0/p)$ 1000.0
H_center H RRL center velocity km s-1 $V_{\rm LSR, H} \sim {\rm Normal}(\mu=p_0, \sigma=p_1)$ [0.0, 25.0]
H_fwhm H RRL FWHM line width km s-1 $\Delta V_{\rm H} \sim {\rm Gamma}(\alpha=3.0, \beta=2.0/p)$ 20.0
He_H_fwhm_ratio He/H FWHM line width ratio `` $\Delta V_{\rm He}/\Delta V_{\rm H} \sim {\rm Normal}(\mu=1.0, \sigma=p)$ 0.1
yplus He abundance by number `` $y^+ \sim {\rm Gamma}(\alpha=3.0, \beta=2.0/p)$ 0.1
Hyper Parameter
variable
Parameter Units Prior, where
($p_0, p_1, \dots$) = prior_{variable}
Default
prior_{variable}
rms Spectral rms noise mK ${\rm rms} \sim {\rm HalfNormal}(\sigma=p)$ 0.01
baseline_coeffs Normalized polynomial baseline coefficients `` $\beta_i \sim {\rm Normal}(\mu=0.0, \sigma=p_i)$ [1.0]*baseline_degree

ordered

An additional parameter to set_priors for these models is velocity. By default, this parameter is False, in which case the order of the clouds is arbitrary. 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 Parameter
variable
Parameter Units Prior, where
($p_0, p_1, \dots$) = prior_{variable}
Default
prior_{variable}
H_center H RRL center velocity km s-1 $V_i \sim p_0 + \sum_0^{i-1} V_i + {\rm Gamma}(\alpha=2, \beta=1.0/p_1)$ [0.0, 25.0]

Syntax & Examples

See the various notebooks under examples for demonstrations of these models.

Issues and Contributing

Anyone is welcome to submit issues or contribute to the development of this software via Github.

License and Copyright

Copyright (c) 2024 Trey Wenger

GNU General Public License v3 (GNU GPLv3)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bayes_yplus-1.1.0.tar.gz (44.9 kB view details)

Uploaded Source

Built Distribution

bayes_yplus-1.1.0-py3-none-any.whl (31.5 kB view details)

Uploaded Python 3

File details

Details for the file bayes_yplus-1.1.0.tar.gz.

File metadata

  • Download URL: bayes_yplus-1.1.0.tar.gz
  • Upload date:
  • Size: 44.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for bayes_yplus-1.1.0.tar.gz
Algorithm Hash digest
SHA256 b7f1571212abfd5143b04033eb84e2e0ed23106eb86a38865d9eb5a6cd5fd0a8
MD5 9b76cf3f8e29c0e8f9ee6189bc51ff24
BLAKE2b-256 c23a9e56e1ea6f79257e6121628f254e186cffda55dd560aaf3fc76b658c397a

See more details on using hashes here.

File details

Details for the file bayes_yplus-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: bayes_yplus-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 31.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for bayes_yplus-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8725b3f37c031277cafb23e2ba6adf405d2e87fe8bef923406dc6eda2d648f40
MD5 5229b1017e8c3f4b1fecfd3adef9405f
BLAKE2b-256 a63f16920184acff8f08178622984392587aaa3a2068338ec2ee53a9c6b2778d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page