Metadata-Version: 2.4
Name: wlcovpy
Version: 1.0.1
Summary: Python interface to the 3ptWL-cov covariance code
Home-page: https://github.com/sadirs/3ptWL-cov
Author: Sofia Samario-Nava and Alejandro Aviles
Author-email: ssamario@icf.unam.mx, aviles@icf.unam.mx
License: MIT
Project-URL: Documentation, https://3ptwl-cov.readthedocs.io/en/latest/
Project-URL: Source, https://github.com/sadirs/3ptWL-cov
Project-URL: Issues, https://github.com/sadirs/3ptWL-cov/issues
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: C
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Scientific/Engineering :: Astronomy
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.22
Requires-Dist: scipy>=1.8
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: license-file
Dynamic: project-url
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# 3ptWL-cov

[![Documentation Status](https://readthedocs.org/projects/3ptwl-cov/badge/?version=latest)](https://3ptwl-cov.readthedocs.io/en/latest/?badge=latest)

**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](https://3ptwl-cov.readthedocs.io/en/latest/)

## Authors

- **Sofia Samario-Nava**  
  ssamario@icf.unam.mx
- **Alejandro Aviles**  
  aviles@icf.unam.mx

## Contributors

- **Sadi Ramirez Solano** - [sadi@icf.unam.mx](mailto:sadi@icf.unam.mx)
- **Mario A. Rodriguez-Meza** - [marioalberto.rodriguezmeza@gmail.com](mailto:marioalberto.rodriguezmeza@gmail.com)

## Install with pip

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

```bash
sudo apt-get install build-essential libgsl-dev
```

Then install the Python interface from PyPI:

```bash
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:

```bash
make clean
make PYTHON=python3 all
```

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

```bash
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

```bash
./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

```python
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:

```bash
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](LICENSE).
