README.md 4.75 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_4/build.svg)](https://gitlab.mpcdf.mpg.de/ift/NIFTy/commits/NIFTy_4)
[![coverage report](https://gitlab.mpcdf.mpg.de/ift/NIFTy/badges/NIFTy_4/coverage.svg)](https://gitlab.mpcdf.mpg.de/ift/NIFTy/commits/NIFTy_4)
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
[https://www.mpa-garching.mpg.de/ift/nifty/](https://www.mpa-garching.mpg.de/ift/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
point sets, *n*-dimensional regular grids, spherical spaces, their
harmonic counterparts, and product spaces constructed as combinations of
those.

### Class & Feature Overview

Martin Reinecke's avatar
Martin Reinecke committed
36
37
The NIFTy library features three main classes: **Space**s that represent
certain grids, **Field**s that are defined on spaces, and **LinearOperator**s
Jait Dixit's avatar
Jait Dixit committed
38
39
that apply to fields.

Martin Reinecke's avatar
Martin Reinecke committed
40
-   [Spaces](https://www.mpa-garching.mpg.de/ift/nifty/space.html)
Martin Reinecke's avatar
updates  
Martin Reinecke committed
41
42
43
    -   `RGSpace` - *n*-dimensional regular Euclidean grid
    -   `LMSpace` - spherical harmonics
    -   `GLSpace` - Gauss-Legendre grid on the 2-sphere
Martin Reinecke's avatar
Martin Reinecke committed
44
    -   `HPSpace` - [HEALPix](https://sourceforge.net/projects/healpix/)
Jait Dixit's avatar
Jait Dixit committed
45
        grid on the 2-sphere
Martin Reinecke's avatar
Martin Reinecke committed
46
-   [Fields](https://www.mpa-garching.mpg.de/ift/nifty/field.html)
Martin Reinecke's avatar
updates  
Martin Reinecke committed
47
    -   `Field` - generic class for (discretized) fields
Jait Dixit's avatar
Jait Dixit committed
48
49
50

<!-- -->

Martin Reinecke's avatar
updates  
Martin Reinecke committed
51
    Field.conjugate     Field.dim          Field.norm
Martin Reinecke's avatar
Martin Reinecke committed
52
    Field.vdot          Field.weight
Jait Dixit's avatar
Jait Dixit committed
53

Martin Reinecke's avatar
Martin Reinecke committed
54
-   [Operators](https://www.mpa-garching.mpg.de/ift/nifty/operator.html)
Martin Reinecke's avatar
updates  
Martin Reinecke committed
55
    -   `DiagonalOperator` - purely diagonal matrices in a specified
Jait Dixit's avatar
Jait Dixit committed
56
        basis
Martin Reinecke's avatar
Martin Reinecke committed
57
58
    -   `FFTOperator` - conversion between spaces and their harmonic
                        counterparts
Jait Dixit's avatar
Jait Dixit committed
59
60
61
62
63
64
65
66
    -   (and more)
-   (and more)

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

### Requirements

Martin Reinecke's avatar
Martin Reinecke committed
67
68
-   [Python](https://www.python.org/) (v2.7.x or 3.5.x)
-   [NumPy](https://www.numpy.org/)
Martin Reinecke's avatar
Martin Reinecke committed
69
-   [pyFFTW](https://pypi.python.org/pypi/pyFFTW)
Martin Reinecke's avatar
Martin Reinecke committed
70
71
72

Optional dependencies:
-   [pyHealpix](https://gitlab.mpcdf.mpg.de/ift/pyHealpix)
Martin Reinecke's avatar
Martin Reinecke committed
73
-   [mpi4py](https://mpi4py.scipy.org)
Martin Reinecke's avatar
tweaks  
Martin Reinecke committed
74
-   [matplotlib](https://matplotlib.org/)
Jait Dixit's avatar
Jait Dixit committed
75

Martin Reinecke's avatar
Martin Reinecke committed
76
### Sources
Jait Dixit's avatar
Jait Dixit committed
77

Martin Reinecke's avatar
Martin Reinecke committed
78
79
The current version of Nifty4 can be obtained by cloning the repository and
switching to the NIFTy_4 branch:
Jait Dixit's avatar
Jait Dixit committed
80
81

    git clone https://gitlab.mpcdf.mpg.de/ift/NIFTy.git
Martin Reinecke's avatar
Martin Reinecke committed
82
    git checkout NIFTy_4
Jait Dixit's avatar
Jait Dixit committed
83

Martin Reinecke's avatar
Martin Reinecke committed
84
### Installation via pip
Jait Dixit's avatar
Jait Dixit committed
85

Martin Reinecke's avatar
Martin Reinecke committed
86
87
88
89
90
It is possible to simply install NIFTy with its mandatory dependencies via the command

    pip install --user git+https://gitlab.mpcdf.mpg.de/ift/NIFTy.git@NIFTy_4

The optional dependencies can be installed via
Jait Dixit's avatar
Jait Dixit committed
91

Martin Reinecke's avatar
Martin Reinecke committed
92
93
    pip install --user mpi4py
    pip install --user git+https://gitlab.mpcdf.mpg.de/ift/pyHealpix.git
Jait Dixit's avatar
Jait Dixit committed
94

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

In oder to run the tests one needs two additional packages:

Martin Reinecke's avatar
Martin Reinecke committed
99
    pip install --user nose parameterized
100

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

Martin Reinecke's avatar
Martin Reinecke committed
104
    nosetests -x --with-coverage --cover-html --cover-package=nifty4
Theo Steininger's avatar
Theo Steininger committed
105
106


Jait Dixit's avatar
Jait Dixit committed
107
108
### First Steps

Martin Reinecke's avatar
Martin Reinecke committed
109
For a quick start, you can browse through the [informal
Martin Reinecke's avatar
Martin Reinecke committed
110
introduction](https://www.mpa-garching.mpg.de/ift/nifty/start.html) or
Martin Reinecke's avatar
Martin Reinecke committed
111
dive into NIFTy by running one of the demonstrations, e.g.:
Jait Dixit's avatar
Jait Dixit committed
112

Martin Reinecke's avatar
Martin Reinecke committed
113
    python demos/wiener_filter_via_curvature.py
Jait Dixit's avatar
Jait Dixit committed
114
115
116
117

Acknowledgement
---------------

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

> *"Some of the results in this publication have been derived using the
Martin Reinecke's avatar
Martin Reinecke committed
122
> NIFTy package [Selig et al., 2013]."*
Jait Dixit's avatar
Jait Dixit committed
123
124
125
126
127
128

### References

Release Notes
-------------

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

* * * * *

Martin Reinecke's avatar
Martin Reinecke committed
135
[1] Selig et al., "NIFTy - Numerical Information Field Theory - a
Jait Dixit's avatar
Jait Dixit committed
136
versatile Python library for signal inference", [A&A, vol. 554, id.
Martin Reinecke's avatar
Martin Reinecke committed
137
138
A26](https://dx.doi.org/10.1051/0004-6361/201321236), 2013;
[arXiv:1301.4499](https://www.arxiv.org/abs/1301.4499)