pynkowski

Welcome to Pynkowski's documentation!

A Python package to compute Minkowski Functionals and other higher order statistics of input fields, as well as their expected values for different kinds of fields.

The statistics currently supported by this package are:

  • Minkowski functionals.
  • Maxima and minima distributions.

The formats currently supported for input data are the following:

  • Scalar HEALPix maps, as the ones used by healpy, such as $T, \kappa, P^2$ (see paper 1).
  • Polarisation HEALPix maps in the $SO(3)$ formalism (see paper 2).
  • 2D and 3D numpy arrays (coming soon).

The theoretical expectation of some statistics is currently supported for the following theoretical fields:

  • Gaussian fields (such as CMB $T$ or the initial density field, see paper 1).
  • $\chi^2$ fields (such as CMB $P^2$, see paper 1).
  • Spin 2 maps in the $SO(3)$ formalism (see paper 2).

We are actively working on the implementation of more statistics, data formats, and theoretical fields. If you want to contribute, we welcome and appreciate pull requests. If you have any comments or suggestions, please feel free to contact us by email (1 and 2) or by opening a discussion thread or issue.

The repository can be found on https://github.com/javicarron/pynkowski.

Installation

This package can be installed with:

pip install pynkowski

The dependencies are:

Documentation

The documentation can be found on https://javicarron.github.io/pynkowski.

This package is divided into three modules: stats, data, and theory. Each module has a submodule for each kind of object, plus a general utilities submodule and a base submodule for the definition of the base class. In this way, extending the code to a new usecase is reduced to creating a new submodule. The structure is the following:

The documentation for each submodule can be found by clicking on the links above or navigating the menu on the left.

Example notebooks

Authors

This package has been developed by Javier Carrón Duque and Alessandro Carones.

  1'''# Welcome to Pynkowski's documentation!
  2
  3A Python package to compute Minkowski Functionals and other higher order statistics of input fields, as well as their expected values for different kinds of fields.
  4
  5The **statistics** currently supported by this package are:
  6
  7- Minkowski functionals.
  8- Maxima and minima distributions.
  9
 10The formats currently supported for **input data** are the following:
 11
 12- Scalar HEALPix maps, as the ones used by [healpy](https://healpy.readthedocs.io/), such as $T, \kappa, P^2$ (see [paper 1](https://arxiv.org/abs/2211.07562)).
 13- Polarisation HEALPix maps in the $SO(3)$ formalism (see [paper 2](https://arxiv.org/abs/2301.13191)).
 14- 2D and 3D numpy arrays (coming soon).
 15
 16The theoretical expectation of some statistics is currently supported for the following **theoretical fields**:
 17
 18- Gaussian fields (such as CMB $T$ or the initial density field, see [paper 1](https://arxiv.org/abs/2211.07562)).
 19- $\chi^2$ fields (such as CMB $P^2$, see [paper 1](https://arxiv.org/abs/2211.07562)).
 20- Spin 2 maps in the $SO(3)$ formalism (see [paper 2](https://arxiv.org/abs/2301.13191)).
 21
 22We are actively working on the implementation of more statistics, data formats, and theoretical fields. If you want to contribute, we welcome and appreciate pull requests. 
 23If you have any comments or suggestions, please feel free to contact us by email ([1](mailto:javier.carron@csic.es) and [2](mailto:alessandro.carones@roma2.infn.it )) or by opening a discussion thread or issue.
 24
 25The repository can be found on [https://github.com/javicarron/pynkowski](https://github.com/javicarron/pynkowski).
 26
 27# Installation
 28
 29This package can be installed with: 
 30```
 31pip install pynkowski
 32```
 33
 34The dependencies are:
 35
 36- [numpy](https://numpy.org/)
 37- [scipy](https://scipy.org/)
 38- [healpy](https://healpy.readthedocs.io/)
 39- [tqdm](https://github.com/tqdm/tqdm) (optional)
 40
 41# Documentation
 42
 43The documentation can be found on [https://javicarron.github.io/pynkowski](https://javicarron.github.io/pynkowski).
 44
 45This package is divided into three modules: `stats`, `data`, and `theory`. Each module has a submodule for each kind of object, plus a general utilities submodule and a base submodule for the definition of the base class. In this way, extending the code to a new usecase is reduced to creating a new submodule. The structure is the following:
 46
 47- [`stats`](https://javicarron.github.io/pynkowski/pynkowski/stats.html)
 48    - [`minkowski`](https://javicarron.github.io/pynkowski/pynkowski/stats/minkowski.html)
 49    - [`extrema`](https://javicarron.github.io/pynkowski/pynkowski/stats/extrema.html)
 50    - [`utils_st`](https://javicarron.github.io/pynkowski/pynkowski/stats/utils_st.html)
 51
 52- [`data`](https://javicarron.github.io/pynkowski/pynkowski/data.html)
 53    - [`base_da`](https://javicarron.github.io/pynkowski/pynkowski/data/base_da.html)
 54    - [`array`](https://javicarron.github.io/pynkowski/pynkowski/data/array.html)
 55    - [`healpix`](https://javicarron.github.io/pynkowski/pynkowski/data/healpix.html)
 56    - [`utils_da`](https://javicarron.github.io/pynkowski/pynkowski/data/utils_da.html)
 57  
 58- [`theory`](https://javicarron.github.io/pynkowski/pynkowski/theory.html)
 59    - [`base_th`](https://javicarron.github.io/pynkowski/pynkowski/theory/base_th.html)
 60    - [`gaussian`](https://javicarron.github.io/pynkowski/pynkowski/theory/gaussian.html)
 61    - [`spingaussian`](https://javicarron.github.io/pynkowski/pynkowski/theory/spingaussian.html)
 62    - [`chi2`](https://javicarron.github.io/pynkowski/pynkowski/theory/chi2.html)
 63    - [`utils_th`](https://javicarron.github.io/pynkowski/pynkowski/theory/utils_th.html)
 64
 65The documentation for each submodule can be found by clicking on the links above or navigating the menu on the left.
 66
 67# Example notebooks
 68
 69- [Minkowski Functionals of a CMB temperature map and comparison with theory](https://github.com/javicarron/pynkowski/blob/main/examples/Temperature.ipynb).
 70- [Minkowski Functionals of a CMB polarization P² map and comparison with theory](https://github.com/javicarron/pynkowski/blob/main/examples/P2.ipynb).
 71
 72# Authors
 73
 74This package has been developed by [Javier Carrón Duque](https://www.javiercarron.com) and Alessandro Carones.
 75
 76'''
 77
 78from .data import (DataField, 
 79                   Healpix,
 80                   HealpixP2,
 81                   DataArray,
 82                   SO3Healpix,
 83                   SO3Patch)
 84
 85from .theory import (TheoryField,
 86                     Gaussian,
 87                     SphericalGaussian,
 88                    #  EuclideanGaussian,
 89                     SpinGaussian,
 90                     Chi2,
 91                     SphericalChi2)
 92
 93from .stats import (V0, V1, V2, V3, maxima, minima)
 94
 95from .__version import __version__
 96
 97
 98
 99
100__docformat__ = "numpy"