Skip to main content

Bayesian Spectral Polarization Models

Project description

bayes_pol

publish tests Documentation Status codecov

Bayesian Spectral Polarization Models

bayes_pol implements models to infer the physics of the interstellar medium from radio continuum polarization observations.

Installation

Basic Installation

Install with pip in a conda virtual environment:

conda create --name bayes_pol -c conda-forge pymc>=5.20 pip
conda activate bayes_pol
pip install bayes_pol

Development installation

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

Install in a conda virtual environment:

conda env create -f environment.yml
conda activate bayes_pol-dev
pip install -e .

Models

The models provided by bayes_pol are implemented in the bayes_spec framework. bayes_spec assumes that the source of the polarization signal can be decomposed into a series of "clouds" with Gaussian-like Faraday depth distributions, each of which is defined by a set of model parameters. Here we describe the models available in bayes_pol.

FaradayModel

The FaradayModel predicts observations of Stokes Q, U, and Faraday depth (the Fourier transform of the complex polarization) by assuming the polarized intensity is modified by a series of "clouds" in Faraday depth space. 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.

faraday model graph

Cloud Parameter
variable
Parameter Units Prior, where
($p_0, p_1, \dots$) = prior_{variable}
Default
prior_{variable}
polarized_intensity Polarized intensity data brightness $P_I \sim {\rm HalfNormal}(\sigma=p)$ 100.0
faraday_depth_mean Mean Faraday depth rad/m2 $\langle F \rangle \sim {\rm Cauchy}(\alpha=p_0, \beta=p_1)$ [0.0, 1000.0]
faraday_depth_fwhm Faraday depth FWHM rad/m2 $\Delta F \sim {\rm HalfNormal}(\sigma=p)$ 10.0
pol_angle0 Polarization angle at $\lambda = 0$ rad $\phi_0 \sim {\rm Uniform}(-\pi/2, \pi/2)$

Syntax & Examples

See the various tutorial notebooks under docs/source/notebooks. Tutorials and the full API are available here: https://bayes-pol.readthedocs.io.

Issues and Contributing

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

License and Copyright

Copyright(C) 2025 by Trey V. Wenger

This code is licensed under MIT license (see LICENSE for details)

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_pol-1.0.tar.gz (25.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bayes_pol-1.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file bayes_pol-1.0.tar.gz.

File metadata

  • Download URL: bayes_pol-1.0.tar.gz
  • Upload date:
  • Size: 25.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for bayes_pol-1.0.tar.gz
Algorithm Hash digest
SHA256 bd04a03252bbd96d74085639ebc99a6bf0bd89c0398110dadf7dd99e010b6800
MD5 5829cc9a49b078113af6db51a7ae1433
BLAKE2b-256 419ea11d37ab2e946ca96f1b8e84bdc7e024f9e60d8fe6e114295ed5eaeacfb4

See more details on using hashes here.

Provenance

The following attestation bundles were made for bayes_pol-1.0.tar.gz:

Publisher: publish.yml on tvwenger/bayes_pol

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bayes_pol-1.0-py3-none-any.whl.

File metadata

  • Download URL: bayes_pol-1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for bayes_pol-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f7b3d0572dd15e5f7857d49399584ce29dab80d01809e5efdaddbf30d39e0175
MD5 dddcedde85921d25a48346b209fcbb09
BLAKE2b-256 58bc114aab594cb5c99972328ff72ae6a974637115f3e9303d52cf980ba088ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for bayes_pol-1.0-py3-none-any.whl:

Publisher: publish.yml on tvwenger/bayes_pol

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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