Skip to content

Warning

This website is still under active development. Features and documentation are being continuously updated and expanded.

PrimeFeat

primefeat Logo

Detect and characterize features in the primordial power spectrum from MCMC cosmological parameter chains

image image Docs Source Code


Key Features

  • Fast power spectrum computation from MCMC chains with intelligent caching
  • Statistical significance testing using Gaussian Process methods
  • Dimensionality reduction with PCA to reveal dominant modes
  • Publication-ready plots with custom matplotlib styling
  • YAML-based workflow for managing multiple chains

Quick Start

import primefeat as pf
import numpy as np

# Load chains from config
chains = pf.get_chains(kmin=1e-4)

# Compute power spectrum posteriors
k = np.logspace(-4, 0, 100)
samples = {
    label: pf.compute_Pk_samples(
        k, chain,
        nbins=20,
        k_start=1e-4,
        k_end=0.23,
        include_powerlaw=True
    )
    for label, chain in chains.items()
}

# Plot
fig = pf.plot.posteriors_PPS(
    k, samples,
    colors=['#2E86AB', '#A23B72', '#F18F01'],
    mode="full"
)

Installation

pip install primefeat

Or from source:

git clone https://github.com/rcalderonb6/primefeat.git
cd primefeat
pip install -e .

Citation

If you use PrimeFeat in your research, please cite:

@software{primefeat2025,
  author = {Calderon, Rodrigo},
  title = {PrimeFeat: Primordial Power Spectrum Feature Analysis},
  year = {2025},
  url = {https://github.com/rcalderonb6/primefeat}
}

License

MIT License - see LICENSE for details.