README.md 4.5 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-dev/badges/NIFTy_5/build.svg)](https://gitlab.mpcdf.mpg.de/ift/nifty-dev/commits/NIFTy_5)
[![coverage report](https://gitlab.mpcdf.mpg.de/ift/nifty-dev/badges/NIFTy_5/coverage.svg)](https://gitlab.mpcdf.mpg.de/ift/nifty-dev/commits/NIFTy_5)
Jait Dixit's avatar
Jait Dixit committed
5

Martin Reinecke's avatar
Martin Reinecke committed
6
**NIFTy** project homepage:
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 16 17
a versatile library designed to enable the development of signal
inference algorithms that operate regardless of the underlying spatial
grid and its resolution. Its object-oriented framework is written in
Martin Reinecke's avatar
updates  
Martin Reinecke committed
18
Python, although it accesses libraries written in C++ and C for
Jait Dixit's avatar
Jait Dixit committed
19 20
efficiency.

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
Martin Reinecke's avatar
Martin Reinecke committed
23
fields into classes. The correct normalization of operations on
Jait Dixit's avatar
Jait Dixit committed
24 25 26
fields is taken care of automatically without concerning the user. This
allows for an abstract formulation and programming of inference
algorithms, including those derived within information field theory.
Martin Reinecke's avatar
Martin Reinecke committed
27
Thus, NIFTy permits its user to rapidly prototype algorithms in 1D, and
Jait Dixit's avatar
Jait Dixit committed
28
then apply the developed code in higher-dimensional settings of real
Martin Reinecke's avatar
Martin Reinecke committed
29
world problems. The set of spaces on which NIFTy operates comprises
Jait Dixit's avatar
Jait Dixit committed
30 31 32 33 34 35 36 37 38 39
point sets, *n*-dimensional regular grids, spherical spaces, their
harmonic counterparts, and product spaces constructed as combinations of
those.


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

### Requirements

Martin Reinecke's avatar
Martin Reinecke committed
40
- [Python 3](https://www.python.org/) (3.5.x or later)
41
- [SciPy](https://www.scipy.org/)
Martin Reinecke's avatar
Martin Reinecke committed
42 43

Optional dependencies:
Martin Reinecke's avatar
Martin Reinecke committed
44
- [pyFFTW](https://pypi.python.org/pypi/pyFFTW) for faster Fourier transforms
Martin Reinecke's avatar
Martin Reinecke committed
45 46 47 48
- [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
49

Martin Reinecke's avatar
Martin Reinecke committed
50
### Sources
Jait Dixit's avatar
Jait Dixit committed
51

Philipp Arras's avatar
Philipp Arras committed
52 53
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
54 55 56

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

Martin Reinecke's avatar
Martin Reinecke committed
57
### Installation
Jait Dixit's avatar
Jait Dixit committed
58

Martin Reinecke's avatar
Martin Reinecke committed
59 60
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
61

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

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

Martin Reinecke's avatar
Martin Reinecke committed
67 68
Plotting support is added via:

Martin Reinecke's avatar
Martin Reinecke committed
69
    pip3 install --user matplotlib
Martin Reinecke's avatar
Martin Reinecke committed
70

Martin Reinecke's avatar
fixes  
Martin Reinecke committed
71 72
NIFTy uses Numpy's FFT implementation by default. For large problems FFTW may be
used because of its higher performance. It can be installed via::
Martin Reinecke's avatar
Martin Reinecke committed
73 74 75 76

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

Martin Reinecke's avatar
fixes  
Martin Reinecke committed
77
To enable FFTW usage in NIFTy, call::
Martin Reinecke's avatar
Martin Reinecke committed
78

Martin Reinecke's avatar
Martin Reinecke committed
79
    nifty5.fft.enable_fftw()
Martin Reinecke's avatar
Martin Reinecke committed
80 81 82 83 84 85 86 87

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
88
Support for spherical harmonic transforms is added via:
Jait Dixit's avatar
Jait Dixit committed
89

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

Martin Reinecke's avatar
Martin Reinecke committed
92 93 94
MPI support is added via:

    sudo apt-get install openmpi-bin libopenmpi-dev
Martin Reinecke's avatar
Martin Reinecke committed
95
    pip3 install --user mpi4py
Martin Reinecke's avatar
Martin Reinecke committed
96

Theo Steininger's avatar
Theo Steininger committed
97 98
### Running the tests

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

Martin Reinecke's avatar
fixes  
Martin Reinecke committed
101
    sudo apt-get install python3-pytest-cov
102

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

Martin Reinecke's avatar
Martin Reinecke committed
106
    pytest-3 --cov=nifty5 test
Theo Steininger's avatar
Theo Steininger committed
107 108


Jait Dixit's avatar
Jait Dixit committed
109 110
### First Steps

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

Martin Reinecke's avatar
Martin Reinecke committed
115
    python3 demos/getting_started_1.py
Jait Dixit's avatar
Jait Dixit committed
116

117 118

### Acknowledgement
Jait Dixit's avatar
Jait Dixit committed
119

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

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

126
and a citation to one of the [publications](http://ift.pages.mpcdf.de/NIFTy/citations.html).
127 128 129


### Release Notes
Jait Dixit's avatar
Jait Dixit committed
130

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