Skip to main content

Wavelet Phase Harmonics in Python with GPU acceleration.

Project description

PyWPH : Wavelet Phase Harmonics in Python

PyWPH is a Python package designed for the computation and handling of the Wavelet Phase Harmonic (WPH) statistics. These statistics can be computed from real or complex-valued images (2D data). Calculations are GPU-accelerated using PyTorch/CUDA (torch>=1.9.0). See the PyTorch installation guide if needed.

Install PyWPH and check out our tutorial as well as the examples scripts located in the examples/ folder. Example scripts include basic examples to compute WPH coefficients from an image, as well as more complex scripts for synthesis or statistical denoising. Examples of multi-channel syntheses are provided here.

We refer to arXiv:2208.03538 for a presentation of the WPH statistics computed in this package.

If you use this package, please cite the following paper:

  • Regaldo-Saint Blancard, B., Allys, E., Boulanger, F., Levrier, F., & Jeffrey, N. (2021). A new approach for the statistical denoising of Planck interstellar dust polarization data. arXiv:2102.03160

Related references:

  • Mallat, S., Zhang, S., & Rochette, G. (2020). Phase harmonic correlations and convolutional neural networks. Information and Inference: A Journal of the IMA, 9(3), 721–747. https://doi.org/10.1093/imaiai/iaz019 arXiv:1810.12136
  • Allys, E., Marchand, T., Cardoso, J.-F., Villaescusa-Navarro, F., Ho, S., & Mallat, S. (2020). New Interpretable Statistics for Large Scale Structure Analysis and Generation. Physical Review D, 102(10), 103506. arXiv:2006.06298
  • Zhang, S., & Mallat, S. (2021). Maximum Entropy Models from Phase Harmonic Covariances. Applied and Computational Harmonic Analysis, 53, 199–230. https://doi.org/10.1016/j.acha.2021.01.003 arXiv:1911.10017
  • Régaldo-Saint Blancard, B., Allys, E., Auclair, C., Boulanger, F., Eickenberg, M., Levrier, F., Vacher, L. & Zhang, S. (2022). Generative Models of Multi-channel Data from a Single Example - Application to Dust Emission. arXiv:2208.03538. Code.

This code originally takes inspiration from https://github.com/Ttantto/wph_quijote.

Install/Uninstall

Standard installation (from the Python Package Index)

pip install pywph

Install from source

Clone the repository and type from the main directory:

pip install -r requirements.txt
pip install .

Uninstall

pip uninstall pywph

Changelog

v1.1

  • New default discretization grid for the shift vector $\tau$
  • New set of scaling moments $L$ (which replaced the old ones)

Version of the code used for arXiv:2208.03538.

v1.0

  • Cross-WPH statistics added
  • Smarter way to evaluate moments at different $\tau$
  • Improved computation for non periodic boundary conditions data

v0.9

First release. Version of the code used for arXiv:2102.03160.

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

pywph-1.1.1.tar.gz (24.2 kB view details)

Uploaded Source

Built Distribution

pywph-1.1.1-py3-none-any.whl (23.4 kB view details)

Uploaded Python 3

File details

Details for the file pywph-1.1.1.tar.gz.

File metadata

  • Download URL: pywph-1.1.1.tar.gz
  • Upload date:
  • Size: 24.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.7

File hashes

Hashes for pywph-1.1.1.tar.gz
Algorithm Hash digest
SHA256 ee5911d03bab4dddc69c10c8bc0b9df33ecab23e0fc84c3bab5285823c6898d3
MD5 058f930ccee5fde0639bfd1dbe6c4710
BLAKE2b-256 ddffacfb66c501abfd66e9c2923b15c9f2b245c8c95595b6946406587dd009e9

See more details on using hashes here.

File details

Details for the file pywph-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: pywph-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 23.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.7

File hashes

Hashes for pywph-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 874ec72b99ba496847f5280cf56cca8c536877efed95690762f1600593f8b5b9
MD5 04af87fd0df49b9d97be3e50e4b16b8f
BLAKE2b-256 d466ca8aaa5481d9b55332da7d086435fbdf93dbc6f8b158ce2dde255be83f02

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page