Bayesian Spectral Polarization Models
Project description
bayes_pol
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.
Cloud Parametervariable |
Parameter | Units | Prior, where ($p_0, p_1, \dots$) = prior_{variable} |
Defaultprior_{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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bayes_pol-1.1.tar.gz.
File metadata
- Download URL: bayes_pol-1.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b398607cc933d1727d21547d316102f4bbc115c8a8f5c7d4f932b52171803205
|
|
| MD5 |
3564d9eaaf1bfef8005c8a44ce235657
|
|
| BLAKE2b-256 |
ded47f72359e365f25c5f9a22cff99cc18740e9d5b92fb83a4861034487537cc
|
Provenance
The following attestation bundles were made for bayes_pol-1.1.tar.gz:
Publisher:
publish.yml on tvwenger/bayes_pol
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bayes_pol-1.1.tar.gz -
Subject digest:
b398607cc933d1727d21547d316102f4bbc115c8a8f5c7d4f932b52171803205 - Sigstore transparency entry: 168703993
- Sigstore integration time:
-
Permalink:
tvwenger/bayes_pol@a2c0154404f3b8c6e61dc23b0c94a5136d7b7eb8 -
Branch / Tag:
refs/tags/v1.1 - Owner: https://github.com/tvwenger
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a2c0154404f3b8c6e61dc23b0c94a5136d7b7eb8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file bayes_pol-1.1-py3-none-any.whl.
File metadata
- Download URL: bayes_pol-1.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b24919e5e2fc78f8fae4d4e44cfeda8c0ae4818fcf31725b2a11d6a287abf2f
|
|
| MD5 |
c9a8b73a4cee918039efd5c1aae7bc9e
|
|
| BLAKE2b-256 |
d0b4a7667ed340905dec3ea94b0fd6fd0e05b3dd7ba37e306e235cb5aaa98aba
|
Provenance
The following attestation bundles were made for bayes_pol-1.1-py3-none-any.whl:
Publisher:
publish.yml on tvwenger/bayes_pol
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bayes_pol-1.1-py3-none-any.whl -
Subject digest:
5b24919e5e2fc78f8fae4d4e44cfeda8c0ae4818fcf31725b2a11d6a287abf2f - Sigstore transparency entry: 168703994
- Sigstore integration time:
-
Permalink:
tvwenger/bayes_pol@a2c0154404f3b8c6e61dc23b0c94a5136d7b7eb8 -
Branch / Tag:
refs/tags/v1.1 - Owner: https://github.com/tvwenger
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a2c0154404f3b8c6e61dc23b0c94a5136d7b7eb8 -
Trigger Event:
release
-
Statement type: