README.md 4.91 KB
Newer Older
Martin Reinecke's avatar
Martin Reinecke committed
1
NIFTy - Numerical Information Field Theory
Jait Dixit's avatar
Jait Dixit committed
2
==========================================
Martin Reinecke's avatar
Martin Reinecke committed
3 4
[![build status](https://gitlab.mpcdf.mpg.de/ift/NIFTy/badges/NIFTy_5/build.svg)](https://gitlab.mpcdf.mpg.de/ift/NIFTy/commits/NIFTy_5)
[![coverage report](https://gitlab.mpcdf.mpg.de/ift/NIFTy/badges/NIFTy_5/coverage.svg)](https://gitlab.mpcdf.mpg.de/ift/NIFTy/commits/NIFTy_5)
Jait Dixit's avatar
Jait Dixit committed
5

Martin Reinecke's avatar
Martin Reinecke committed
6
**NIFTy** project homepage:
Martin Reinecke's avatar
Martin Reinecke committed
7
[http://ift.pages.mpcdf.de/nifty](http://ift.pages.mpcdf.de/nifty)
Jait Dixit's avatar
Jait Dixit committed
8 9 10 11 12 13

Summary
-------

### Description

Martin Reinecke's avatar
Martin Reinecke committed
14
**NIFTy**, "**N**umerical **I**nformation **F**ield **T**heor<strong>y</strong>", is
Jait Dixit's avatar
Jait Dixit committed
15
a versatile library designed to enable the development of signal
16 17 18 19
inference algorithms that operate regardless of the underlying grids
(spatial, spectral, temporal, …) and their resolutions.
Its object-oriented framework is written in Python, although it accesses
libraries written in C++ and C for efficiency.
Jait Dixit's avatar
Jait Dixit committed
20

Martin Reinecke's avatar
Martin Reinecke committed
21
NIFTy offers a toolkit that abstracts discretized representations of
Jait Dixit's avatar
Jait Dixit committed
22
continuous spaces, fields in these spaces, and operators acting on
23 24
these fields into classes.
This allows for an abstract formulation and programming of inference
Jait Dixit's avatar
Jait Dixit committed
25
algorithms, including those derived within information field theory.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
NIFTy's interface is designed to resemble IFT formulae in the sense
that the user implements algorithms in NIFTy independent of the topology
of the underlying spaces and the discretization scheme.
Thus, the user can develop algorithms on subsets of problems and on
spaces where the detailed performance of the algorithm can be properly
evaluated and then easily generalize them to other, more complex spaces
and the full problem, respectively.

The set of spaces on which NIFTy operates comprises point sets,
*n*-dimensional regular grids, spherical spaces, their harmonic
counterparts, and product spaces constructed as combinations of those.
NIFTy takes care of numerical subtleties like the normalization of
operations on fields and the numerical representation of model
components, allowing the user to focus on formulating the abstract
inference procedures and process-specific model properties.
Jait Dixit's avatar
Jait Dixit committed
41 42 43 44 45 46 47


Installation
------------

### Requirements

Martin Reinecke's avatar
Martin Reinecke committed
48
- [Python 3](https://www.python.org/) (3.5.x or later)
49
- [SciPy](https://www.scipy.org/)
Martin Reinecke's avatar
Martin Reinecke committed
50 51

Optional dependencies:
Martin Reinecke's avatar
Martin Reinecke committed
52
- [pyFFTW](https://pypi.python.org/pypi/pyFFTW) for faster Fourier transforms
Martin Reinecke's avatar
Martin Reinecke committed
53 54 55 56
- [pyHealpix](https://gitlab.mpcdf.mpg.de/ift/pyHealpix) (for harmonic
    transforms involving domains on the sphere)
- [mpi4py](https://mpi4py.scipy.org) (for MPI-parallel execution)
- [matplotlib](https://matplotlib.org/) (for field plotting)
Jait Dixit's avatar
Jait Dixit committed
57

Martin Reinecke's avatar
Martin Reinecke committed
58
### Sources
Jait Dixit's avatar
Jait Dixit committed
59

Philipp Arras's avatar
Philipp Arras committed
60 61
The current version of Nifty5 can be obtained by cloning the repository and
switching to the NIFTy_5 branch:
Jait Dixit's avatar
Jait Dixit committed
62 63 64

    git clone https://gitlab.mpcdf.mpg.de/ift/NIFTy.git

Martin Reinecke's avatar
Martin Reinecke committed
65
### Installation
Jait Dixit's avatar
Jait Dixit committed
66

Martin Reinecke's avatar
Martin Reinecke committed
67 68
In the following, we assume a Debian-based distribution. For other
distributions, the "apt" lines will need slight changes.
Martin Reinecke's avatar
Martin Reinecke committed
69

Philipp Arras's avatar
Philipp Arras committed
70
NIFTy5 and its mandatory dependencies can be installed via:
Martin Reinecke's avatar
Martin Reinecke committed
71

Martin Reinecke's avatar
Martin Reinecke committed
72
    sudo apt-get install git python3 python3-pip python3-dev
Martin Reinecke's avatar
Martin Reinecke committed
73
    pip3 install --user git+https://gitlab.mpcdf.mpg.de/ift/NIFTy.git@NIFTy_5
Martin Reinecke's avatar
Martin Reinecke committed
74

Martin Reinecke's avatar
Martin Reinecke committed
75 76
Plotting support is added via:

Martin Reinecke's avatar
Martin Reinecke committed
77
    sudo apt-get install python3-matplotlib
Martin Reinecke's avatar
Martin Reinecke committed
78

Martin Reinecke's avatar
fixes  
Martin Reinecke committed
79
NIFTy uses Numpy's FFT implementation by default. For large problems FFTW may be
Martin Reinecke's avatar
Martin Reinecke committed
80
used because of its higher performance. It can be installed via:
Martin Reinecke's avatar
Martin Reinecke committed
81 82 83 84

    sudo apt-get install libfftw3-dev
    pip3 install --user pyfftw

Martin Reinecke's avatar
Martin Reinecke committed
85
To enable FFTW usage in NIFTy, call
Martin Reinecke's avatar
Martin Reinecke committed
86

Martin Reinecke's avatar
Martin Reinecke committed
87
    nifty5.fft.enable_fftw()
Martin Reinecke's avatar
Martin Reinecke committed
88 89 90 91 92 93 94 95

at the beginning of your code.

(Note: If you encounter problems related to `pyFFTW`, make sure that you are
using a pip-installed `pyFFTW` package. Unfortunately, some distributions are
shipping an incorrectly configured `pyFFTW` package, which does not cooperate
with the installed `FFTW3` libraries.)

Martin Reinecke's avatar
Martin Reinecke committed
96
Support for spherical harmonic transforms is added via:
Jait Dixit's avatar
Jait Dixit committed
97

Martin Reinecke's avatar
Martin Reinecke committed
98
    pip3 install --user git+https://gitlab.mpcdf.mpg.de/ift/pyHealpix.git
Jait Dixit's avatar
Jait Dixit committed
99

Martin Reinecke's avatar
Martin Reinecke committed
100 101
MPI support is added via:

Martin Reinecke's avatar
Martin Reinecke committed
102
    sudo apt-get install python3-mpi4py
Martin Reinecke's avatar
Martin Reinecke committed
103

Theo Steininger's avatar
Theo Steininger committed
104 105
### Running the tests

Martin Reinecke's avatar
Martin Reinecke committed
106 107
To run the tests, additional packages are required:

Martin Reinecke's avatar
fixes  
Martin Reinecke committed
108
    sudo apt-get install python3-pytest-cov
109

Martin Reinecke's avatar
Martin Reinecke committed
110 111
Afterwards the tests (including a coverage report) can be run using the
following command in the repository root:
112

Martin Reinecke's avatar
Martin Reinecke committed
113
    pytest-3 --cov=nifty5 test
Theo Steininger's avatar
Theo Steininger committed
114 115


Jait Dixit's avatar
Jait Dixit committed
116 117
### First Steps

Martin Reinecke's avatar
Martin Reinecke committed
118
For a quick start, you can browse through the [informal
Martin Reinecke's avatar
Martin Reinecke committed
119
introduction](http://ift.pages.mpcdf.de/nifty/code.html) or
Martin Reinecke's avatar
Martin Reinecke committed
120
dive into NIFTy by running one of the demonstrations, e.g.:
Jait Dixit's avatar
Jait Dixit committed
121

Martin Reinecke's avatar
Martin Reinecke committed
122
    python3 demos/getting_started_1.py
Jait Dixit's avatar
Jait Dixit committed
123

124

Martin Reinecke's avatar
fixes  
Martin Reinecke committed
125
### Acknowledgements
Jait Dixit's avatar
Jait Dixit committed
126

Martin Reinecke's avatar
Martin Reinecke committed
127
Please acknowledge the use of NIFTy in your publication(s) by using a
Jait Dixit's avatar
Jait Dixit committed
128 129
phrase such as the following:

Martin Reinecke's avatar
Martin Reinecke committed
130
> "Some of the results in this publication have been derived using the
131 132
> NIFTy package [(https://gitlab.mpcdf.mpg.de/ift/NIFTy)](https://gitlab.mpcdf.mpg.de/ift/NIFTy)"

Martin Reinecke's avatar
Martin Reinecke committed
133
and a citation to one of the [publications](http://ift.pages.mpcdf.de/nifty/citations.html).
134 135


Martin Reinecke's avatar
fixes  
Martin Reinecke committed
136
### Licensing terms
Jait Dixit's avatar
Jait Dixit committed
137

Martin Reinecke's avatar
Martin Reinecke committed
138
The NIFTy package is licensed under the terms of the
Martin Reinecke's avatar
Martin Reinecke committed
139
[GPLv3](https://www.gnu.org/licenses/gpl.html) and is distributed
Jait Dixit's avatar
Jait Dixit committed
140
*without any warranty*.