Skip to main content

Python interface to the 3ptWL-cov covariance code

Project description

3ptWL-cov

Documentation Status

3ptWL-cov computes the Gaussian contribution to weak-lensing three-point covariance terms in a harmonic basis on the sphere under the Limber approximation. The repository provides a C command-line executable, a static library, a Cython wrapper (wlcovpy), and small Python examples.

Documentation: 3ptWL-cov documentation

Authors

Contributors

Install with pip

Install the GSL development library first. On Debian or Ubuntu:

sudo apt-get install build-essential libgsl-dev

Then install the Python interface from PyPI:

python3 -m pip install wlcovpy

This installs the wlcovpy module and compiles its native extension; no separate make command is needed. To install the unreleased development version, use python3 -m pip install "git+https://github.com/sadirs/3ptWL-cov.git". From an existing source checkout, use python3 -m pip install .. The standalone wlcov command-line executable is built separately with make, as described below.

Native C build (optional)

Build the standalone executable and static library from a source checkout:

make clean
make PYTHON=python3 all

The Makefile uses gsl-config by default. For a custom GSL installation:

make PYTHON=python3 GSL_INCLUDE=/path/to/gsl/include GSL_LIB=/path/to/gsl/lib all

Native build artifacts:

  • wlcov: command-line executable
  • libwlcov.a: static C library
  • wlcovpy: Cython extension installed by pip install .

Native CLI quick run

./wlcov clsfile=tests/input/Cls_ep2.txt rootDir=Output_quick \
   r=0.01 theta1=0.01 theta2=0.012 thetap1=0.011 thetap2=0.013 \
   m=0 mp=0 ellmin=1 ellmax=25 ppp=4 Nr=8 rmin=0.00232711 rmax=0.02 \
   verbose=0 verbose_log=0

The main input table is supplied with clsfile and must contain two columns: ell and C_ell.

Python Wrapper

from wlcovpy import wlcov

model = wlcov(default=False)
model.set({
    "clsfile": "tests/input/Cls_ep2.txt",
    "rootDir": "Output_python",
    "r": 0.01,
    "theta1": 0.01,
    "theta2": 0.012,
    "thetap1": 0.011,
    "thetap2": 0.013,
    "m": 0,
    "mp": 0,
    "ppp": 4,
    "ellmin": 1.0,
    "ellmax": 25.0,
    "Nr": 8,
    "rmin": 0.00232711,
    "rmax": 0.02,
    "numberThreads": 1,
    "verbose": 0,
    "verbose_log": 0,
    "options": "",
})
try:
    model.Run()
    integral = model.getIntegral()
finally:
    model.clean_all()

See docs/examples/python_wrapper.py, tests/python/, and the main notebook example in tests/notebooks/example.ipynb for runnable examples. The notebook saves its figures in tests/notebooks/plots/.

Documentation

The documentation is built with Sphinx:

python3 -m pip install --user -r docs/requirements.txt
cd docs
make html
make man
make latexpdf

Generated outputs:

  • docs/_build/html/index.html
  • docs/_build/man/wlcov.1
  • docs/_build/latex/3ptWL-cov.pdf

Configuration

Main build switches live in Makefile_settings:

  • USEGSL = 1: required for current GSL Bessel routines
  • OPENMPMACHINE = 0: set to 1 for OpenMP builds
  • ADDONSON = 1: required for the current wrapper path

Addon switches live in addons/Makefile_addons_settings:

  • CLASSLIBON = 1
  • PXDON = 1
  • COSMOLIBON = 0 by default

Citation

If you use this program in research that results in publications, please cite Sofia Samario et al., arXiv:2506.19811, and record the code version, compiler, GSL version, Python environment, and runtime configuration used for the analysis.

License

3ptWL-cov is distributed under the MIT license. See LICENSE.

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

wlcovpy-1.0.1.tar.gz (71.9 kB view details)

Uploaded Source

File details

Details for the file wlcovpy-1.0.1.tar.gz.

File metadata

  • Download URL: wlcovpy-1.0.1.tar.gz
  • Upload date:
  • Size: 71.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wlcovpy-1.0.1.tar.gz
Algorithm Hash digest
SHA256 17330e73d4c6366d6c0c70718b9d8601ba853bc8376f715397f6d61f2d1c64a0
MD5 a48db317221269efa8d1ac33fab591ae
BLAKE2b-256 a66c4c256b9ebed7af5756a0ea7a54773619a2c1c5e58ba7a88b93893d881132

See more details on using hashes here.

Provenance

The following attestation bundles were made for wlcovpy-1.0.1.tar.gz:

Publisher: publish.yml on sadirs/3ptWL-cov

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