README.md 5.14 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
- [pyHealpix](https://gitlab.mpcdf.mpg.de/ift/pyHealpix) (for harmonic
    transforms involving domains on the sphere)
Martin Reinecke's avatar
Martin Reinecke committed
55 56
- [nifty_gridder](https://gitlab.mpcdf.mpg.de/ift/nifty_gridder) (for radio
    interferometry responses)
Martin Reinecke's avatar
Martin Reinecke committed
57 58
- [mpi4py](https://mpi4py.scipy.org) (for MPI-parallel execution)
- [matplotlib](https://matplotlib.org/) (for field plotting)
Jait Dixit's avatar
Jait Dixit committed
59

Martin Reinecke's avatar
Martin Reinecke committed
60
### Sources
Jait Dixit's avatar
Jait Dixit committed
61

Philipp Arras's avatar
Philipp Arras committed
62 63
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
64

Martin Reinecke's avatar
Martin Reinecke committed
65
    git clone https://gitlab.mpcdf.mpg.de/ift/nifty.git
Jait Dixit's avatar
Jait Dixit committed
66

Martin Reinecke's avatar
Martin Reinecke committed
67
### Installation
Jait Dixit's avatar
Jait Dixit committed
68

Martin Reinecke's avatar
Martin Reinecke committed
69 70
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
71

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

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

Martin Reinecke's avatar
Martin Reinecke committed
77 78
Plotting support is added via:

Martin Reinecke's avatar
Martin Reinecke committed
79
    sudo apt-get install python3-matplotlib
Martin Reinecke's avatar
Martin Reinecke committed
80

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

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

Martin Reinecke's avatar
Martin Reinecke committed
87
To enable FFTW usage in NIFTy, call
Martin Reinecke's avatar
Martin Reinecke committed
88

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

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

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

Martin Reinecke's avatar
Martin Reinecke committed
102 103 104 105
Support for the radio interferometry gridder is added via:

    pip3 install git+https://gitlab.mpcdf.mpg.de/ift/nifty_gridder.git

Martin Reinecke's avatar
Martin Reinecke committed
106 107
MPI support is added via:

Martin Reinecke's avatar
Martin Reinecke committed
108
    sudo apt-get install python3-mpi4py
Martin Reinecke's avatar
Martin Reinecke committed
109

Theo Steininger's avatar
Theo Steininger committed
110 111
### Running the tests

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

Martin Reinecke's avatar
fixes  
Martin Reinecke committed
114
    sudo apt-get install python3-pytest-cov
115

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

Martin Reinecke's avatar
Martin Reinecke committed
119
    pytest-3 --cov=nifty5 test
Theo Steininger's avatar
Theo Steininger committed
120 121


Jait Dixit's avatar
Jait Dixit committed
122 123
### First Steps

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

Martin Reinecke's avatar
Martin Reinecke committed
128
    python3 demos/getting_started_1.py
Jait Dixit's avatar
Jait Dixit committed
129

130

Martin Reinecke's avatar
fixes  
Martin Reinecke committed
131
### Acknowledgements
Jait Dixit's avatar
Jait Dixit committed
132

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

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

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


Martin Reinecke's avatar
fixes  
Martin Reinecke committed
142
### Licensing terms
Jait Dixit's avatar
Jait Dixit committed
143

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