README.md 5.19 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
5->6    
Martin Reinecke committed
3
4
[![build status](https://gitlab.mpcdf.mpg.de/ift/NIFTy/badges/NIFTy_6/build.svg)](https://gitlab.mpcdf.mpg.de/ift/NIFTy/commits/NIFTy_6)
[![coverage report](https://gitlab.mpcdf.mpg.de/ift/NIFTy/badges/NIFTy_6/coverage.svg)](https://gitlab.mpcdf.mpg.de/ift/NIFTy/commits/NIFTy_6)
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.6.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
53
- [pyHealpix](https://gitlab.mpcdf.mpg.de/ift/pyHealpix) (for harmonic
    transforms involving domains on the sphere)
Martin Reinecke's avatar
Martin Reinecke committed
54
55
- [nifty_gridder](https://gitlab.mpcdf.mpg.de/ift/nifty_gridder) (for radio
    interferometry responses)
Martin Reinecke's avatar
Martin Reinecke committed
56
57
- [mpi4py](https://mpi4py.scipy.org) (for MPI-parallel execution)
- [matplotlib](https://matplotlib.org/) (for field plotting)
Martin Reinecke's avatar
Martin Reinecke committed
58
- [pypocketfft](https://gitlab.mpcdf.mpg.de/mtr/pypocketfft) (for faster FFTs)
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

Martin Reinecke's avatar
5->6    
Martin Reinecke committed
62
63
The current version of NIFTy6 can be obtained by cloning the repository and
switching to the NIFTy_6 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

Martin Reinecke's avatar
5->6    
Martin Reinecke committed
72
NIFTy6 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
5->6    
Martin Reinecke committed
75
    pip3 install --user git+https://gitlab.mpcdf.mpg.de/ift/nifty.git@NIFTy_6
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
81

Support for spherical harmonic transforms is added via:
Jait Dixit's avatar
Jait Dixit committed
82

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

Martin Reinecke's avatar
Martin Reinecke committed
85
86
Support for the radio interferometry gridder is added via:

Martin Reinecke's avatar
Martin Reinecke committed
87
    pip3 install --user git+https://gitlab.mpcdf.mpg.de/ift/nifty_gridder.git
Martin Reinecke's avatar
Martin Reinecke committed
88

Martin Reinecke's avatar
Martin Reinecke committed
89
90
MPI support is added via:

Martin Reinecke's avatar
Martin Reinecke committed
91
    sudo apt-get install python3-mpi4py
Martin Reinecke's avatar
Martin Reinecke committed
92

Martin Reinecke's avatar
Martin Reinecke committed
93
94
95
96
97
98
99
100
Pypocketfft is added via:
    pip3 install --user git+https://gitlab.mpcdf.mpg.de/mtr/pypocketfft

If this library is present, NIFTy will detect it automatically and prefer
it over SciPy's FFT. The underlying code is actually the same, but
pypocketfft is compiled with optimizations for the host CPU and can provide
significantly faster transforms.

Theo Steininger's avatar
Theo Steininger committed
101
102
### Running the tests

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

Martin Reinecke's avatar
fixes    
Martin Reinecke committed
105
    sudo apt-get install python3-pytest-cov
106

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

Martin Reinecke's avatar
5->6    
Martin Reinecke committed
110
    pytest-3 --cov=nifty6 test
Theo Steininger's avatar
Theo Steininger committed
111

Jait Dixit's avatar
Jait Dixit committed
112
113
### First Steps

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

Martin Reinecke's avatar
Martin Reinecke committed
118
    python3 demos/getting_started_1.py
Jait Dixit's avatar
Jait Dixit committed
119

120
121
122
123
124
125
126
127
### Building the documentation from source

To build the documentation from source, install
[sphinx](https://www.sphinx-doc.org/en/stable/index.html) and the
[Read The Docs Sphinx Theme](https://github.com/readthedocs/sphinx_rtd_theme)
on your system and run

    sh docs/generate.sh
128

Martin Reinecke's avatar
fixes    
Martin Reinecke committed
129
### Acknowledgements
Jait Dixit's avatar
Jait Dixit committed
130

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

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

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


Martin Reinecke's avatar
fixes    
Martin Reinecke committed
140
### Licensing terms
Jait Dixit's avatar
Jait Dixit committed
141

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