Commit a71f5b77 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

doc tweaks

parent 7f0d49de
Pipeline #24938 passed with stages
in 6 minutes and 36 seconds
...@@ -52,16 +52,12 @@ extensions = [ ...@@ -52,16 +52,12 @@ extensions = [
'numpydoc', 'numpydoc',
'sphinx.ext.autosummary', 'sphinx.ext.autosummary',
'sphinx.ext.napoleon', 'sphinx.ext.napoleon',
'sphinx.ext.coverage', # 'sphinx.ext.coverage',
'sphinx.ext.todo', # 'sphinx.ext.todo',
'sphinx.ext.mathjax', 'sphinx.ext.mathjax',
'sphinx.ext.viewcode' 'sphinx.ext.viewcode'
] ]
# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates'] templates_path = ['_templates']
......
NIFTy -- Numerical Information Field Theory NIFTy -- Numerical Information Field Theory
=========================================== ===========================================
**NIFTy** [1]_, "\ **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. **NIFTy** [1]_, "\ **N**\umerical **I**\nformation **F**\ield **T**\heor\ **y**\ ", is a versatile library designed to enable the development of signal inference algorithms that are independent of the underlying spatial grid and its resolution.
Its object-oriented framework is written in Python, although it accesses libraries written in C++ and C for efficiency. Its object-oriented framework is written in Python, although it accesses libraries written in 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. 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. 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. 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. Thus, NIFTy permits its user to rapidly prototype algorithms in 1D and then apply the developed code in higher-dimensional settings to 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. 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.
References References
---------- ----------
.. [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>`_ .. [1] Steininger et al., "NIFTy 3 - Numerical Information Field Theory - A Python framework for multicomponent signal inference on HPC clusters", 2017, submitted to PLOS One; `[arXiv:1708.01073] <https://arxiv.org/abs/1708.01073>`_
Documentation
-------------
Welcome to NIFTy's documentation!
Contents Contents
........ ........
......
...@@ -2,7 +2,7 @@ Installation ...@@ -2,7 +2,7 @@ Installation
============ ============
In the following, we assume a Debian-based distribution. For other In the following, we assume a Debian-based Linux distribution. For other
distributions, the "apt" lines will need slight changes. distributions, the "apt" lines will need slight changes.
NIFTy4 and its mandatory dependencies can be installed via:: NIFTy4 and its mandatory dependencies can be installed via::
...@@ -19,7 +19,7 @@ Plotting support is added via:: ...@@ -19,7 +19,7 @@ Plotting support is added via::
pip install --user matplotlib pip install --user matplotlib
Support for spherical harmonic transforms is added via: Support for spherical harmonic transforms is added via::
pip install --user git+https://gitlab.mpcdf.mpg.de/ift/pyHealpix.git pip install --user git+https://gitlab.mpcdf.mpg.de/ift/pyHealpix.git
......
...@@ -24,34 +24,22 @@ from .. import dobj ...@@ -24,34 +24,22 @@ from .. import dobj
class LMSpace(StructuredDomain): class LMSpace(StructuredDomain):
"""NIFTy subclass for spherical harmonics components, for representations """NIFTy subclass for sets of spherical harmonic coefficients.
of fields on the two-sphere.
Its harmonic partner spaces are :class:`HPSpace` and :class:`GLSpace`.
Parameters Parameters
---------- ----------
lmax : int lmax : int
The maximum :math:`l` value of any spherical harmonics The maximum :math:`l` value of any spherical harmonic coefficient
:math:`Y_{lm}` that is represented in this Space. :math:`a_{lm}` that is represented by this object.
Must be >=0. Must be :math:`\ge 0`.
mmax : int *optional* mmax : int, optional
The maximum :math:`m` value of any spherical harmonics The maximum :math:`m` value of any spherical harmonic coefficient
:math:`Y_{lm}` that is represented in this Space. :math:`a_{lm}` that is represented by this object.
If not supplied, it is set to lmax. If not supplied, it is set to `lmax`.
Must be >=0 and <=lmax. Must be :math:`\ge 0` and :math:`\le` `lmax`.
See Also
--------
HPSpace, GLSpace
References
----------
.. [#] K.M. Gorski et al., 2005, "HEALPix: A Framework for
High-Resolution Discretization and Fast Analysis of Data
Distributed on the Sphere", *ApJ* 622..759G.
.. [#] M. Reinecke and D. Sverre Seljebotn, 2013, "Libsharp - spherical
harmonic transforms revisited";
`arXiv:1303.4945 <http://www.arxiv.org/abs/1303.4945>`_
""" """
def __init__(self, lmax, mmax=None): def __init__(self, lmax, mmax=None):
...@@ -122,14 +110,14 @@ class LMSpace(StructuredDomain): ...@@ -122,14 +110,14 @@ class LMSpace(StructuredDomain):
@property @property
def lmax(self): def lmax(self):
""" Returns the maximum :math:`l` value of any spherical harmonic """ Returns the maximum :math:`l` value of any spherical harmonic
:math:`Y_{lm}` that is represented in this Space. coefficient :math:`a_{lm}` that is represented in this Space.
""" """
return self._lmax return self._lmax
@property @property
def mmax(self): def mmax(self):
""" Returns the maximum :math:`m` value of any spherical harmonic """ Returns the maximum :math:`m` value of any spherical harmonic
:math:`Y_{lm}` that is represented in this Space. coefficient :math:`a_{lm}` that is represented in this Space.
""" """
return self._mmax return self._mmax
......
...@@ -35,7 +35,7 @@ class Field(object): ...@@ -35,7 +35,7 @@ class Field(object):
Parameters Parameters
---------- ----------
domain : None, DomainTuple, tuple(Domain), or Domain domain : None, DomainTuple, tuple of Domain, or Domain
val : None, Field, data_object, or scalar val : None, Field, data_object, or scalar
The values the array should contain after init. A scalar input will The values the array should contain after init. A scalar input will
...@@ -45,7 +45,7 @@ class Field(object): ...@@ -45,7 +45,7 @@ class Field(object):
dtype : type dtype : type
A numpy.type. Most common are float and complex. A numpy.type. Most common are float and complex.
copy: boolean copy: bool
""" """
def __init__(self, domain=None, val=None, dtype=None, copy=False): def __init__(self, domain=None, val=None, dtype=None, copy=False):
...@@ -143,7 +143,7 @@ class Field(object): ...@@ -143,7 +143,7 @@ class Field(object):
Parameters Parameters
---------- ----------
random_type : String random_type : str
'pm1', 'normal', 'uniform' are the supported arguments for this 'pm1', 'normal', 'uniform' are the supported arguments for this
method. method.
...@@ -155,7 +155,7 @@ class Field(object): ...@@ -155,7 +155,7 @@ class Field(object):
Returns Returns
------- -------
out : Field Field
The output object. The output object.
""" """
domain = DomainTuple.make(domain) domain = DomainTuple.make(domain)
...@@ -187,7 +187,8 @@ class Field(object): ...@@ -187,7 +187,8 @@ class Field(object):
Returns Returns
------- -------
Integer tuple containing the dimensions of the spaces in domain. tuple of int
the dimensions of the spaces in domain.
""" """
return self._domain.shape return self._domain.shape
...@@ -199,8 +200,8 @@ class Field(object): ...@@ -199,8 +200,8 @@ class Field(object):
Returns Returns
------- -------
out : int int
The dimension of the Field. the dimension of the Field.
""" """
return self._domain.size return self._domain.size
...@@ -225,7 +226,7 @@ class Field(object): ...@@ -225,7 +226,7 @@ class Field(object):
Returns Returns
------- -------
out : Field Field
The output object. An identical copy of 'self'. The output object. An identical copy of 'self'.
""" """
return Field(val=self, copy=True) return Field(val=self, copy=True)
...@@ -263,7 +264,7 @@ class Field(object): ...@@ -263,7 +264,7 @@ class Field(object):
power : number power : number
The pixels get weighted with the volume-factor**power. The pixels get weighted with the volume-factor**power.
spaces : tuple of ints spaces : int or tuple of int
Determines on which subspace the operation takes place. Determines on which subspace the operation takes place.
out : Field or None out : Field or None
...@@ -273,7 +274,7 @@ class Field(object): ...@@ -273,7 +274,7 @@ class Field(object):
Returns Returns
------- -------
out : Field Field
The weighted field. The weighted field.
""" """
if out is None: if out is None:
...@@ -313,13 +314,13 @@ class Field(object): ...@@ -313,13 +314,13 @@ class Field(object):
x : Field x : Field
x must live on the same domain as `self`. x must live on the same domain as `self`.
spaces : None, int or tuple of ints (default: None) spaces : None, int or tuple of int (default: None)
The dot product is only carried out over the sub-domains in this The dot product is only carried out over the sub-domains in this
tuple. If None, it is carried out over all sub-domains. tuple. If None, it is carried out over all sub-domains.
Returns Returns
------- -------
out : float, complex, either scalar (for full dot products) float, complex, either scalar (for full dot products)
or Field (for partial dot products) or Field (for partial dot products)
""" """
if not isinstance(x, Field): if not isinstance(x, Field):
...@@ -343,7 +344,7 @@ class Field(object): ...@@ -343,7 +344,7 @@ class Field(object):
Returns Returns
------- -------
norm : float float
The L2-norm of the field values. The L2-norm of the field values.
""" """
return np.sqrt(np.abs(self.vdot(x=self))) return np.sqrt(np.abs(self.vdot(x=self)))
...@@ -353,7 +354,8 @@ class Field(object): ...@@ -353,7 +354,8 @@ class Field(object):
Returns Returns
------- -------
The complex conjugated field. Field
The complex conjugated field.
""" """
return Field(self._domain, self.val.conjugate()) return Field(self._domain, self.val.conjugate())
......
...@@ -39,18 +39,19 @@ class HarmonicTransformOperator(LinearOperator): ...@@ -39,18 +39,19 @@ class HarmonicTransformOperator(LinearOperator):
Parameters Parameters
---------- ----------
domain: Space, tuple of Spaces or DomainObject domain : Domain, tuple of Domain or DomainTuple
The domain of the data that is input by "times" and output by The domain of the data that is input by "times" and output by
"adjoint_times". "adjoint_times".
target: Space (optional) target : Domain, optional
The target space of the transform operation. The target domain of the transform operation.
If omitted, a space will be chosen automatically. If omitted, a domain will be chosen automatically.
Whenever the input space of the transform is an RGSpace, the codomain Whenever the input domain of the transform is an RGSpace, the codomain
(and its parameters) are uniquely determined. (and its parameters) are uniquely determined.
For LMSpace, a GLSpace of sufficient resolution is chosen. For LMSpace, a GLSpace of sufficient resolution is chosen.
space: the index of the space on which the operator should act space : int, optional
If None, it is set to 0 if domain contains exactly one space. The index of the domain on which the operator should act
domain[space] must be a harmonic space. If None, it is set to 0 if domain contains exactly one subdomain.
domain[space] must be a harmonic domain.
""" """
def __init__(self, domain, target=None, space=None): def __init__(self, domain, target=None, space=None):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment