OnePower
The One Tool to Predict All Power Spectra.
OnePower is a Python package for computing power spectra and one-point statistics using the halo model framework. It is designed for studying the galaxy-matter connection, cosmological structure formation, and intrinsic alignments, especially in the non-linear regime.
Features
- Non-linear matter-matter, galaxy-galaxy, and galaxy-matter power spectra
- Predictions of stellar mass functions and/or luminosity functions
- Modeling of intrinsic alignments using the halo model approach
- Built on a flexible, extensible halo model architecture
- Includes an interface module for CosmoSIS (cloning of GitHub repository required for ease of use)
OnePower is ideal for:
- Modeling of galaxy surveys
- Cosmological parameter inference
- Understanding the galaxy-halo connection in nonlinear regimes
Example usage
As OnePower has defaults for all of its parameters, a reasonable resulting power spectrum can be calculated by passing no parameters:
from onepower import Spectra
ps = Spectra()
pk_mm = ps.power_spectrum_mm.pk_tot
pk_mm_1h = ps.power_spectrum_mm.pk_1h
pk_mm_2h = ps.power_spectrum_mm.pk_2h
You can also use the accompanying CosmoSIS interface to predict the power spectra in the CosmoSIS framework.
That opens up many more options, specifically on the observables and statistics to predict.
See the .yaml file in the CosmoSIS Standard Library or the cosmosis_modules folder for examples.
If you want to calculate the covariance matrix for the power spectra calculated using OnePower, you can use the sister package OneCovariance!
Attribution
This code originated from the merger of the IA halo model repository of Maria-Cristina Fortuna (used in Fortuna et al. 2021) and the halo model code used in Dvornik et al. 2023 and earlier papers. It is designed to natively interact with the CosmoSIS standard library.
Please cite the above papers if you find this code useful in your research:
@ARTICLE{Fortuna2021,
author = {{Fortuna}, Maria Cristina and {Hoekstra}, Henk and {Joachimi}, Benjamin and {Johnston}, Harry and {Chisari}, Nora Elisa and {Georgiou}, Christos and {Mahony}, Constance},
title = "{The halo model as a versatile tool to predict intrinsic alignments}",
journal = {\mnras},
keywords = {gravitational lensing: weak, galaxies: haloes, galaxies: statistics, cosmology: theory, Astrophysics - Cosmology and Nongalactic Astrophysics, Astrophysics - Astrophysics of Galaxies},
year = 2021,
month = feb,
volume = {501},
number = {2},
pages = {2983-3002},
doi = {10.1093/mnras/staa3802},
archivePrefix = {arXiv},
eprint = {2003.02700},
primaryClass = {astro-ph.CO},
adsurl = {https://ui.adsabs.harvard.edu/abs/2021MNRAS.501.2983F},
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}
@ARTICLE{Dvornik2023,
author = {{Dvornik}, Andrej and {Heymans}, Catherine and {Asgari}, Marika and {Mahony}, Constance and {Joachimi}, Benjamin and {Bilicki}, Maciej and {Chisari}, Elisa and {Hildebrandt}, Hendrik and {Hoekstra}, Henk and {Johnston}, Harry and {Kuijken}, Konrad and {Mead}, Alexander and {Miyatake}, Hironao and {Nishimichi}, Takahiro and {Reischke}, Robert and {Unruh}, Sandra and {Wright}, Angus H.},
title = "{KiDS-1000: Combined halo-model cosmology constraints from galaxy abundance, galaxy clustering, and galaxy-galaxy lensing}",
journal = {\aap},
keywords = {gravitational lensing: weak, methods: statistical, cosmological parameters, galaxies: halos, dark matter, large-scale structure of Universe, Astrophysics - Cosmology and Nongalactic Astrophysics},
year = 2023,
month = jul,
volume = {675},
eid = {A189},
pages = {A189},
doi = {10.1051/0004-6361/202245158},
archivePrefix = {arXiv},
eprint = {2210.03110},
primaryClass = {astro-ph.CO},
adsurl = {https://ui.adsabs.harvard.edu/abs/2023A&A...675A.189D},
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}
Disclaimer
This software is not affiliated with Tolkien Enterprises or any related franchise. The name "OnePower" is used solely as a thematic reference.
Metadata
Release files for onepower 0.8.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| onepower-0.8.0.tar.gz | 7.3 MB | With provenance | Details for onepower-0.8.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| onepower-0.8.0-py3-none-any.whl | Python 3 | none | any | Details for onepower-0.8.0-py3-none-any.whl |
Total release size: 7.3 MB
Release files / onepower-0.8.0.tar.gz
| Download URL | onepower-0.8.0.tar.gz |
|---|---|
| Size | 7.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5ec9d4c25a82377301fc555c5988c69e088fc698f5e72237ddcb5aaad487b3cf
|
|
BLAKE2b-256 checksum How to use checksums |
b60e7f4bd3a7170afd3d67dc76d3974e812ffd506d83cac2aed37ff67c4bd92a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 8, 2026.
Transparency logRelease files / onepower-0.8.0-py3-none-any.whl
| Download URL | onepower-0.8.0-py3-none-any.whl |
|---|---|
| Size | 49.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b617fbc8ff4d96853bdf68965891c1d879672bcb23a9ffb8d17c7c59a341f382
|
|
BLAKE2b-256 checksum How to use checksums |
74bd50e495f4dd8187b85e3789327b2685f878e0b9cf6d97247fe5bf543d2626
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 8, 2026.
Transparency logSecurity for onepower 0.8.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for onepower-0.8.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 8, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.