README.rst 9.23 KB
Newer Older
Marco Selig's avatar
Marco Selig committed
1
2
NIFTY - Numerical Information Field Theory
==========================================
Marco Selig's avatar
Marco Selig committed
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

**NIFTY** project homepage: `<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.

Marco Selig's avatar
Marco Selig committed
37
*   `Spaces <http://www.mpa-garching.mpg.de/ift/nifty/space.html>`_
Marco Selig's avatar
Marco Selig committed
38

Marco Selig's avatar
Marco Selig committed
39
40
41
42
43
    *   ``point_space`` - unstructured list of points
    *   ``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/>`_
Marco Selig's avatar
Marco Selig committed
44
        grid on the 2-sphere
Marco Selig's avatar
Marco Selig committed
45
    *   ``nested_space`` - arbitrary product of grids
Marco Selig's avatar
Marco Selig committed
46

Marco Selig's avatar
Marco Selig committed
47
*   `Fields <http://www.mpa-garching.mpg.de/ift/nifty/field.html>`_
Marco Selig's avatar
Marco Selig committed
48

Marco Selig's avatar
Marco Selig committed
49
50
51
    *   ``field`` - generic class for (discretized) fields

::
Marco Selig's avatar
Marco Selig committed
52
53
54
55
56
57

    field.cast_domain   field.hat           field.power        field.smooth
    field.conjugate     field.inverse_hat   field.pseudo_dot   field.tensor_dot
    field.dim           field.norm          field.set_target   field.transform
    field.dot           field.plot          field.set_val      field.weight

Marco Selig's avatar
Marco Selig committed
58
*   `Operators <http://www.mpa-garching.mpg.de/ift/nifty/operator.html>`_
Marco Selig's avatar
Marco Selig committed
59

Marco Selig's avatar
Marco Selig committed
60
61
62
    *   ``diagonal_operator`` - purely diagonal matrices in a specified basis
    *   ``projection_operator`` - projections onto subsets of a specified basis
    *   ``vecvec_operator`` - matrices derived from the outer product of a
Marco Selig's avatar
Marco Selig committed
63
        vector
Marco Selig's avatar
Marco Selig committed
64
    *   ``response_operator`` - exemplary responses that include a convolution,
Marco Selig's avatar
Marco Selig committed
65
        masking and projection
Marco Selig's avatar
Marco Selig committed
66
    *   ``propagator_operator`` - information propagator in Wiener filter theory
Marco Selig's avatar
Marco Selig committed
67
68
    *   ``explicit_operator`` - linear operators with an explicit matrix
        representation
Marco Selig's avatar
Marco Selig committed
69
    *   (and more)
Marco Selig's avatar
Marco Selig committed
70

Marco Selig's avatar
Marco Selig committed
71
* (and more)
Marco Selig's avatar
Marco Selig committed
72

Marco Selig's avatar
Marco Selig committed
73
*Parts of this summary are taken from* [1]_ *without marking them explicitly as
Marco Selig's avatar
Marco Selig committed
74
quotations.*
Marco Selig's avatar
Marco Selig committed
75
76
77
78
79
80
81

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

Requirements
............

Marco Selig's avatar
Marco Selig committed
82
*   `Python <http://www.python.org/>`_ (v2.7.x)
Marco Selig's avatar
Marco Selig committed
83

theos's avatar
theos committed
84
85
86
    *   `NumPy <http://www.numpy.org/>`_ 
    *   `SciPy <http://www.scipy.org/>`_
    *   `Cython <http://cython.org/>`_
Marco Selig's avatar
Marco Selig committed
87
    *   `matplotlib <http://matplotlib.org/>`_
theos's avatar
theos committed
88
    
Marco Selig's avatar
Marco Selig committed
89
*   `GFFT <https://github.com/mrbell/gfft>`_ (v0.1.0) - Generalized Fast
Marco Selig's avatar
Marco Selig committed
90
    Fourier Transformations for Python - **optional**
Marco Selig's avatar
Marco Selig committed
91

92
*   `HEALPy <https://github.com/healpy/healpy>`_ (v1.8.1 without openmp) - A
Marco Selig's avatar
Marco Selig committed
93
    Python wrapper for `HEALPix <http://sourceforge.net/projects/healpix/>`_ -
theos's avatar
theos committed
94
    **optional, only needed for spherical spaces**
95
 
Marco Selig's avatar
Marco Selig committed
96
*   `libsharp-wrapper <https://github.com/mselig/libsharp-wrapper>`_ (v0.1.2
Marco Selig's avatar
Marco Selig committed
97
    without openmp) - A Python wrapper for the
Marco Selig's avatar
Marco Selig committed
98
    `libsharp <http://sourceforge.net/projects/libsharp/>`_ library -
theos's avatar
theos committed
99
    **optional, only needed for spherical spaces**
Marco Selig's avatar
Marco Selig committed
100
101
102
103

Download
........

104
The latest release is tagged **v1.0.7** and is available as a source package
theos's avatar
theos committed
105
at `<https://gitlab.mpcdf.mpg.de/ift/NIFTy/tags>`_. The current
Marco Selig's avatar
Marco Selig committed
106
version can be obtained by cloning the repository::
Marco Selig's avatar
Marco Selig committed
107

theos's avatar
theos committed
108
    git clone https://gitlab.mpcdf.mpg.de/ift/NIFTy.git
Marco Selig's avatar
Marco Selig committed
109

theos's avatar
theos committed
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
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::
 
        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 gfortran 

*    Install matplotlib::

        sudo apt-get install python-matplotlib

*    Using pip install numpy, scipy, etc...::

        sudo pip install numpy scipy cython pyfits healpy
Marco Selig's avatar
Marco Selig committed
129

theos's avatar
theos committed
130
*    Now install the 'non-standard' dependencies. First of all gfft::
Marco Selig's avatar
Marco Selig committed
131

theos's avatar
theos committed
132
133
134
135
136
        curl -LOk https://github.com/mrbell/gfft/tarball/master 
        tar -xzf master 
        cd mrbell-gfft* 
        sudo python setup.py install 
        cd ..
Marco Selig's avatar
Marco Selig committed
137

theos's avatar
theos committed
138
*    Libsharp::
Marco Selig's avatar
Marco Selig committed
139

theos's avatar
theos committed
140
141
142
143
144
145
        git clone http://git.code.sf.net/p/libsharp/code libsharp-code 
        cd libsharp-code 
        sudo autoconf 
        ./configure --enable-pic --disable-openmp 
        sudo make 
        cd ..
Marco Selig's avatar
Marco Selig committed
146

theos's avatar
theos committed
147
*    Libsharpwrapper::
Marco Selig's avatar
Marco Selig committed
148

theos's avatar
theos committed
149
150
151
152
153
        git clone http://github.com/mselig/libsharp-wrapper.git libsharp-wrapper 
        cd libsharp-wrapper 
        sudo python setup.py build_ext 
        sudo python setup.py install 
        cd ..
Marco Selig's avatar
Marco Selig committed
154

theos's avatar
theos committed
155
156
157
*    Finally, NIFTy::

        git clone https://gitlab.mpcdf.mpg.de/ift/NIFTy.git
Marco Selig's avatar
Marco Selig committed
158
        cd nifty
theos's avatar
theos committed
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
        sudo python setup.py install 
        cd .. 

Installation on a linux cluster
...............................

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 priviledges. In this case, instead::

    sudo python setup.py install 

use::

    python setup.py install --user

or::
theos's avatar
theos committed
174

theos's avatar
theos committed
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
    python setup.py install --install-lib=/SOMEWHERE


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

Installation on OS X 10.11
..........................

We advice to install the following packages in the order as they appear 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.

*    Install basic packages python, scipy, matplotlib and cython::

       sudo port install py27-numpy
       sudo port install py27-scipy
       sudo port install py27-matplotlib
       sudo port install py27-cython

theos's avatar
theos committed
192
*    Install gfft. **Depending where you installed GSL you may need to change the path in setup.py!**::
theos's avatar
theos committed
193
194
195
196
197

        sudo port install gsl
        git clone https://github.com/mrbell/gfft.git}{https://github.com/mrbell/gfft.git
        sudo python setup.py install

theos's avatar
theos committed
198
*    Install healpy::
theos's avatar
theos committed
199
200
201
202
203
204
205

        sudo port install py27-pyfits
        git clone https://github.com/healpy/healpy.git
        cd healpy 
        sudo python setup.py install
        cd ..

theos's avatar
theos committed
206
*    Install libsharp and libsharp-wrapper. Installations instructions for libsharp may be found here: https://sourceforge.net/p/libsharp/code/ci/master/tree/
theos's avatar
theos committed
207
     **Adopt the path of the libsharp installation in setup.py** ::
theos's avatar
theos committed
208
209
210
211
212
213
214
215

        sudo port install gcc
        sudo port select gcc  mp-gcc5
        git clone https://github.com/mselig/libsharp-wrapper.git
        cd libsharp-wrapper
        sudo python setup.py install
        cd ..

theos's avatar
theos committed
216
217
*    Install NIFTy::

theos's avatar
theos committed
218
219
220
221
222
223
224
225
226
227
228
229
230
231
        git clone https://gitlab.mpcdf.mpg.de/ift/NIFTy.git
        cd nifty
        sudo python setup.py install 
        cd .. 

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::
Marco Selig's avatar
Marco Selig committed
232

theos's avatar
theos committed
233
    pip install --user ift_nifty
Marco Selig's avatar
Marco Selig committed
234
235


Marco Selig's avatar
Marco Selig committed
236
237
238
239
240
First Steps
...........

For a quickstart, you can browse through the
`informal introduction <http://www.mpa-garching.mpg.de/ift/nifty/start.html>`_
Marco Selig's avatar
Marco Selig committed
241
or dive into NIFTY by running one of the demonstrations, e.g.::
Marco Selig's avatar
Marco Selig committed
242
243
244

        >>> run -m nifty.demos.demo_wf1

Marco Selig's avatar
Marco Selig committed
245
246
247
248
249
250
Acknowledgement
---------------

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

Marco Selig's avatar
Marco Selig committed
251
    *"Some of the results in this publication have been derived using the NIFTY
Marco Selig's avatar
Marco Selig committed
252
    package [Selig et al., 2013]."*
Marco Selig's avatar
Marco Selig committed
253
254
255
256

References
..........

Marco Selig's avatar
Marco Selig committed
257
.. [1] Selig et al., "NIFTY - Numerical Information Field Theory - a
Marco Selig's avatar
Marco Selig committed
258
259
260
    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>`_
Marco Selig's avatar
Marco Selig committed
261
262
263
264
265
266
267
268

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

The NIFTY package is licensed under the
`GPLv3 <http://www.gnu.org/licenses/gpl.html>`_ and is distributed *without any
warranty*.

Marco Selig's avatar
Marco Selig committed
269
270
----

Marco Selig's avatar
Marco Selig committed
271
272
**NIFTY** project homepage: `<http://www.mpa-garching.mpg.de/ift/nifty/>`_