README.md 7.19 KB
Newer Older
Jait Dixit's avatar
Jait Dixit committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
NIFTY - Numerical Information Field Theory
==========================================
[![build status](https://gitlab.mpcdf.mpg.de/ift/NIFTy/badges/master/build.svg)](https://gitlab.mpcdf.mpg.de/ift/NIFTy/commits/master)
[![coverage report](https://gitlab.mpcdf.mpg.de/ift/NIFTy/badges/master/coverage.svg)](https://gitlab.mpcdf.mpg.de/ift/NIFTy/commits/master)

**NIFTY** project homepage:
[http://www.mpa-garching.mpg.de/ift/nifty/](http://www.mpa-garching.mpg.de/ift/nifty/)

Summary
-------

### Description

**NIFTY**, "**N**umerical **I**nformation **F**ield **T**heor**y**", is
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
Python, although it accesses libraries written in Cython, C++, and C for
efficiency.

NIFTY offers a toolkit that abstracts discretized representations of
continuous spaces, fields in these spaces, and operators acting on
fields into classes. Thereby, the correct normalization of operations on
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.
Thus, NIFTY permits its user to rapidly prototype algorithms in 1D, and
then apply the developed code in higher-dimensional settings of real
world problems. 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.

### Class & Feature Overview

The NIFTY library features three main classes: **spaces** that represent
certain grids, **fields** that are defined on spaces, and **operators**
that apply to fields.

-   [Spaces](http://www.mpa-garching.mpg.de/ift/nifty/space.html)
    -   `rg_space` - *n*-dimensional regular Euclidean grid
    -   `lm_space` - spherical harmonics
    -   `gl_space` - Gauss-Legendre grid on the 2-sphere
    -   `hp_space` - [HEALPix](http://sourceforge.net/projects/healpix/)
        grid on the 2-sphere
-   [Fields](http://www.mpa-garching.mpg.de/ift/nifty/field.html)
    -   `field` - generic class for (discretized) fields

<!-- -->

51
52
    field.conjugate     field.dim          field.norm
    field.dot           field.set_val      field.weight
Jait Dixit's avatar
Jait Dixit committed
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92

-   [Operators](http://www.mpa-garching.mpg.de/ift/nifty/operator.html)
    -   `diagonal_operator` - purely diagonal matrices in a specified
        basis
    -   `projection_operator` - projections onto subsets of a specified
        basis
    -   `propagator_operator` - information propagator in Wiener filter
        theory
    -   (and more)
-   (and more)

*Parts of this summary are taken from* [1] *without marking them
explicitly as quotations.*

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

### Requirements

-   [Python](http://www.python.org/) (v2.7.x)
    -   [NumPy](http://www.numpy.org/)
    -   [Cython](http://cython.org/)

### Download

The latest release is tagged **v1.0.7** and is available as a source
package at [](https://gitlab.mpcdf.mpg.de/ift/NIFTy/tags). The current
version can be obtained by cloning the repository:

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

### Installation on Ubuntu

This is for you if you want to install NIFTy on your personal computer
running with an Ubuntu-like linux system were you have root priviledges.
Starting with a fresh Ubuntu installation move to a folder like
`~/Downloads`:

-   Install basic packages like python, python-dev, gsl and others:

93
94
        sudo apt-get install curl git autoconf
        sudo apt-get install python-dev python-pip gsl-bin libgsl0-dev libfreetype6-dev libpng-dev libatlas-base-dev
Jait Dixit's avatar
Jait Dixit committed
95

96
-   Using pip install numpy etc...:
Jait Dixit's avatar
Jait Dixit committed
97

98
        sudo pip install numpy cython
Jait Dixit's avatar
Jait Dixit committed
99

100
-   Install pyHealpix:
Jait Dixit's avatar
Jait Dixit committed
101

Martin Reinecke's avatar
Martin Reinecke committed
102
        git clone https://gitlab.mpcdf.mpg.de/ift/pyHealpix.git
103
        cd pyHealpix
Martin Reinecke's avatar
Martin Reinecke committed
104
        autoreconf -i && ./configure && make -j4 && sudo make install
Jait Dixit's avatar
Jait Dixit committed
105
106
107
108
109
110
        cd ..

-   Finally, NIFTy:

        git clone https://gitlab.mpcdf.mpg.de/ift/NIFTy.git
        cd nifty
111
112
        sudo python setup.py install
        cd ..
Jait Dixit's avatar
Jait Dixit committed
113

114
### Installation on a Linux cluster
Jait Dixit's avatar
Jait Dixit committed
115
116
117
118

This is for you if you want to install NIFTy on a HPC machine or cluster
that is hosted by your university or institute. Most of the dependencies
will most likely already be there, but you won't have superuser
119
privileges. In this case, instead of:
Jait Dixit's avatar
Jait Dixit committed
120

121
    sudo python setup.py install
Jait Dixit's avatar
Jait Dixit committed
122
123
124
125
126
127
128
129
130
131
132
133

use:

    python setup.py install --user

or:

    python setup.py install --install-lib=/SOMEWHERE

in the instruction above. This will install the python packages into
your local user directory.

134
135
For pyHealpix, use:

Martin Reinecke's avatar
Martin Reinecke committed
136
    git clone https://gitlab.mpcdf.mpg.de/ift/pyHealpix.git
137
    cd pyHealpix
Martin Reinecke's avatar
Martin Reinecke committed
138
    autoreconf -i && ./configure --prefix=$HOME/.local && make -j4 && make install
139
140
    cd ..

Jait Dixit's avatar
Jait Dixit committed
141
142
### Installation on OS X 10.11

143
We advise to install the following packages in the order as they appear
Jait Dixit's avatar
Jait Dixit committed
144
145
146
147
148
149
below. We strongly recommend to install all needed packages via
MacPorts. Please be aware that not all packages are available on
MacPorts, missing ones need to be installed manually. It may also be
mentioned that one should only use one package manager, as multiple ones
may cause trouble.

150
-   Install basic packages numpy and cython:
Jait Dixit's avatar
Jait Dixit committed
151
152
153
154

        sudo port install py27-numpy
        sudo port install py27-cython

155
-   Install pyHealpix:
Jait Dixit's avatar
Jait Dixit committed
156

Martin Reinecke's avatar
Martin Reinecke committed
157
        git clone https://gitlab.mpcdf.mpg.de/ift/pyHealpix.git
158
        cd pyHealpix
Martin Reinecke's avatar
Martin Reinecke committed
159
        autoreconf -i && ./configure --prefix=`python-config --prefix` && make -j4 && sudo make install
Jait Dixit's avatar
Jait Dixit committed
160
161
162
163
164
165
        cd ..

-   Install NIFTy:

        git clone https://gitlab.mpcdf.mpg.de/ift/NIFTy.git
        cd nifty
166
167
        sudo python setup.py install
        cd ..
Jait Dixit's avatar
Jait Dixit committed
168
169
170
171
172
173
174
175
176
177
178
179

### Installation using pypi

NIFTY can be installed using [PyPI](https://pypi.python.org/pypi) and
**pip** by running the following command:

    pip install ift_nifty

Alternatively, a private or user specific installation can be done by:

    pip install --user ift_nifty

Theo Steininger's avatar
Theo Steininger committed
180
181
182
183
184
185
### Running the tests

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

    pip install nose
    pip install parameterized
186
187

Afterwards the tests (including a coverage report) are run using the following
Theo Steininger's avatar
Theo Steininger committed
188
command in the repository root:
189

Theo Steininger's avatar
Theo Steininger committed
190
191
192
    nosetests --exe --cover-html


Jait Dixit's avatar
Jait Dixit committed
193
194
195
196
197
198
### First Steps

For a quickstart, you can browse through the [informal
introduction](http://www.mpa-garching.mpg.de/ift/nifty/start.html) or
dive into NIFTY by running one of the demonstrations, e.g.:

199
    python demos/wiener_filter.py
Jait Dixit's avatar
Jait Dixit committed
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227

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

Please, acknowledge the use of NIFTY in your publication(s) by using a
phrase such as the following:

> *"Some of the results in this publication have been derived using the
> NIFTY package [Selig et al., 2013]."*

### References

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

The NIFTY package is licensed under the
[GPLv3](http://www.gnu.org/licenses/gpl.html) and is distributed
*without any warranty*.

* * * * *

**NIFTY** project homepage:
[](http://www.mpa-garching.mpg.de/ift/nifty/)

[1] Selig et al., "NIFTY - Numerical Information Field Theory - a
versatile Python library for signal inference", [A&A, vol. 554, id.
A26](http://dx.doi.org/10.1051/0004-6361/201321236), 2013;
[arXiv:1301.4499](http://www.arxiv.org/abs/1301.4499)