README.md 6.47 KB
Newer Older
Jait Dixit's avatar
Jait Dixit committed
1
2
3
4
5
6
7
8
9
10
11
12
13
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

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
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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)
Martin Reinecke's avatar
updates    
Martin Reinecke committed
41
42
43
44
    -   `RGSpace` - *n*-dimensional regular Euclidean grid
    -   `LMSpace` - spherical harmonics
    -   `GLSpace` - Gauss-Legendre grid on the 2-sphere
    -   `HPSpace` - [HEALPix](http://sourceforge.net/projects/healpix/)
Jait Dixit's avatar
Jait Dixit committed
45
46
        grid on the 2-sphere
-   [Fields](http://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
update    
Martin Reinecke committed
52
    Field.vdot          Field.set_val      Field.weight
Jait Dixit's avatar
Jait Dixit committed
53
54

-   [Operators](http://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
updates    
Martin Reinecke committed
57
    -   `ProjectionOperator` - projections onto subsets of a specified
Jait Dixit's avatar
Jait Dixit committed
58
59
60
61
62
63
64
65
66
67
68
69
        basis
    -   (and more)
-   (and more)

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

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

### Requirements

Martin Reinecke's avatar
update    
Martin Reinecke committed
70
-   [Python](http://www.python.org/) (v2.7.x or 3.5.x)
Jait Dixit's avatar
Jait Dixit committed
71
72
73
74
    -   [NumPy](http://www.numpy.org/)

### Download

Martin Reinecke's avatar
updates    
Martin Reinecke committed
75
The current version of Nifty3 can be obtained by cloning the repository:
Jait Dixit's avatar
Jait Dixit committed
76
77
78
79
80
81
82
83
84
85
86
87

    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:

Martin Reinecke's avatar
Martin Reinecke committed
88
        sudo apt-get install curl git autoconf libtool python-dev python-pip python-numpy
Jait Dixit's avatar
Jait Dixit committed
89

90
-   Install pyHealpix:
Jait Dixit's avatar
Jait Dixit committed
91

Martin Reinecke's avatar
Martin Reinecke committed
92
        git clone https://gitlab.mpcdf.mpg.de/ift/pyHealpix.git
Martin Reinecke's avatar
Martin Reinecke committed
93
        (cd pyHealpix && autoreconf -i && ./configure --prefix=$HOME/.local --enable-openmp --enable-native-optimizations && make -j4 install)
Jait Dixit's avatar
Jait Dixit committed
94
95
96
97

-   Finally, NIFTy:

        git clone https://gitlab.mpcdf.mpg.de/ift/NIFTy.git
Martin Reinecke's avatar
Martin Reinecke committed
98
        (cd NIFTy && python setup.py install --user)
Jait Dixit's avatar
Jait Dixit committed
99

Martin Reinecke's avatar
updates    
Martin Reinecke committed
100
### Installation on Linux systems in general
Jait Dixit's avatar
Jait Dixit committed
101

Martin Reinecke's avatar
updates    
Martin Reinecke committed
102
103
104
105
106
107
Since all the "unconventional" packages (i.e. pyHealpix and NIFTy) listed in the
section above are installed
within the home directory of the user, the installation instructions for these
should also work on any Linux machine where you do not have root access.
In this case you have to ensure with your system administrators that the
"standard" dependencies (python, numpy, etc.) are installed system-wide.
108

Jait Dixit's avatar
Jait Dixit committed
109
110
### Installation on OS X 10.11

111
We advise to install the following packages in the order as they appear
Jait Dixit's avatar
Jait Dixit committed
112
113
114
115
116
117
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.

Martin Reinecke's avatar
updates    
Martin Reinecke committed
118
-   Install numpy:
Jait Dixit's avatar
Jait Dixit committed
119
120
121

        sudo port install py27-numpy

122
-   Install pyHealpix:
Jait Dixit's avatar
Jait Dixit committed
123

Martin Reinecke's avatar
Martin Reinecke committed
124
        git clone https://gitlab.mpcdf.mpg.de/ift/pyHealpix.git
125
        cd pyHealpix
126
        autoreconf -i && ./configure --prefix=`python-config --prefix` --enable-openmp --enable-native-optimizations && make -j4 && sudo make install
Jait Dixit's avatar
Jait Dixit committed
127
128
        cd ..

Martin Reinecke's avatar
updates    
Martin Reinecke committed
129
130
131
132
    (The third command installs the package system-wide. User-specific
    installation would be preferrable, but we haven't found a simple recipe yet
    how to determine the installation prefix ...)

Jait Dixit's avatar
Jait Dixit committed
133
134
135
-   Install NIFTy:

        git clone https://gitlab.mpcdf.mpg.de/ift/NIFTy.git
Martin Reinecke's avatar
Martin Reinecke committed
136
        (cd NIFTy && python setup.py install --user)
Jait Dixit's avatar
Jait Dixit committed
137

Theo Steininger's avatar
Theo Steininger committed
138
139
140
141
### Running the tests

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

Martin Reinecke's avatar
Martin Reinecke committed
142
    pip install nose parameterized
143
144

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

Theo Steininger's avatar
Theo Steininger committed
147
148
149
    nosetests --exe --cover-html


Jait Dixit's avatar
Jait Dixit committed
150
151
152
153
154
155
### 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.:

156
    python demos/wiener_filter.py
Jait Dixit's avatar
Jait Dixit committed
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183

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;
184
[arXiv:1301.4499](http://www.arxiv.org/abs/1301.4499)