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

ordered_velocity

An additional parameter to set_priors for these models is ordered_velocity. 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_velocity=True, in which case the order of clouds is restricted to be increasing with velocity. This assumption can drastically improve sampling efficiency. When ordered_velocity=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.0.0.tar.gz (45.0 kB view details)

Uploaded Source

Built Distribution

bayes_yplus-1.0.0-py3-none-any.whl (31.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for bayes_yplus-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9cdb911485b7dbc286ea51ddad4f9d023fcf210e137fede3736fdc70f90f7cbf
MD5 a632b1529c8abe6b9498f1f1d83084ac
BLAKE2b-256 c3164ad359bab2a4dced6f9ab9539fdeab5d1bd9e54619d96ce2316a33b9549a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for bayes_yplus-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4678f0f6ae6be10d8009a461418a5995061ea4abc5a20e7ac91166310e709b4a
MD5 41143151658393364d4940b29ee5440d
BLAKE2b-256 bc55201ab9d8ecb7b7d9a77d9e3b3f36daae364ea422c91568ea20613cfc903d

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