Skip to main content

Torch Planck 2018 Lite

Torch Planck 2018 Lite is a PyTorch implementation of the Planck 2018 Lite likelihood for the Cosmic Microwave Background (CMB) power spectra. This package provides a convenient and efficient way to compute the log-likelihood of CMB power spectra given a cosmological model.

Installation

You can install Torch Planck 2018 Lite via pip from PyPI:

pip install torch-planck2018-lite

This package requires Python 3.6 or later and PyTorch 1.7 or later.

Usage

To use the Torch Planck 2018 Lite package, you can import the PlanckLitePy class and create an instance with the desired settings:

from torch_planck2018_lite import PlanckLitePy

# Initialize the PlanckLitePy object
planck = PlanckLitePy(year=2018, spectra="TTTEEE", use_low_ell_bins=False)

# Load the power spectra
import numpy as np
ls, Dltt, Dlte, Dlee = np.genfromtxt("path/to/your/data/Dl_planck2015fit.dat", unpack=True)

# Compute the log-likelihood
ellmin = int(ls[0])
loglikelihood = planck.loglike(Dltt, Dlte, Dlee, ellmin)

You can customize the behavior of the PlanckLitePy object by changing its constructor parameters:

  • year: The Planck data release year (2015 or 2018).
  • spectra: The CMB power spectra to use ("TTTEEE" for TT, TE, and EE or "TT" for TT only).
  • use_low_ell_bins: Whether to include low-ell bins in the likelihood calculation (True or False).

Running Tests

To run the tests, you can use the unittest module:

python -m unittest discover tests

this will run all the test cases defined in the tests directory.

Licesnse

This project is under the MIT License. See the LICENSE file for more details.

Credit

This is a PyTorch implementation of the planck-lite-py code by Heather Prince.

Release files for torch-planck2018-lite 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for torch-planck2018-lite 0.1.0
File Size Uploaded
torch-planck2018-lite-0.1.0.tar.gz 3.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for torch-planck2018-lite 0.1.0
File Interpreter ABI Platform
torch_planck2018_lite-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 3.2 MB

Release files / torch-planck2018-lite-0.1.0.tar.gz

Download URL torch-planck2018-lite-0.1.0.tar.gz
Size 3.2 MB
Tags Source
SHA-256 checksum
How to use checksums
511834f706289ca08f2c5fe48e6e2774454d9c4e419a84c13e0adfeb8c380554
BLAKE2b-256 checksum
How to use checksums
fc66d3cf9de3768f337d0acda489ce83deb6f67882da563b817a3f20d4b6e927
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Release files / torch_planck2018_lite-0.1.0-py3-none-any.whl

Download URL torch_planck2018_lite-0.1.0-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5b28fad3180df1f42dc6b978eae5b1d138979ea41db2c6c1a952f7871f5fdf82
BLAKE2b-256 checksum
How to use checksums
07b805f05fb8d11b9385e41348d98cf013602571de5ce428e3f9f23b67a794aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page