Commit 9ea84e2e authored by Martin Reinecke's avatar Martin Reinecke

more doc work

parent a71f5b77
Pipeline #24939 passed with stages
in 6 minutes and 39 seconds
......@@ -22,14 +22,16 @@ from .structured_domain import StructuredDomain
class GLSpace(StructuredDomain):
"""NIFTy subclass for Gauss-Legendre pixelizations [#]_ of the two-sphere.
"""NIFTy subclass for Gauss-Legendre pixelizations of the two-sphere.
Its harmonic partner is the :class:`LMSpace`
Parameters
----------
nlat : int
Number of latitudinal bins (or rings) that are used for this
pixelization.
nlon : int, *optional*
nlon : int, optional
Number of longitudinal bins that are used for this pixelization.
Default value is 2*nlat + 1.
......@@ -37,19 +39,6 @@ class GLSpace(StructuredDomain):
------
ValueError
If input `nlat` or `nlon` is invalid.
See Also
--------
HPSpace, LMSpace
References
----------
.. [#] M. Reinecke and D. Sverre Seljebotn, 2013, "Libsharp - spherical
harmonic transforms revisited";
`arXiv:1303.4945 <http://www.arxiv.org/abs/1303.4945>`_
.. [#] 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.
"""
def __init__(self, nlat, nlon=None):
......
......@@ -30,16 +30,16 @@ class RGSpace(StructuredDomain):
Parameters
----------
shape : {int, numpy.ndarray}
shape : int or tuple of int
Number of grid points or numbers of gridpoints along each axis.
distances : {float, numpy.ndarray}, *optional*
distances : None or float or tuple of float, optional
Distance between two grid points along each axis
(default: None).
If distances==None:
if harmonic==True, all distances will be set to 1
if harmonic==False, the distance along each axis will be
set to the inverse of the number of points along that axis.
harmonic : bool, *optional*
harmonic : bool, optional
Whether the space represents a grid in position or harmonic space.
(default: False).
"""
......
......@@ -30,7 +30,7 @@ def FFTSmoothingOperator(domain, sigma, space=None):
Parameters
----------
domain : Domain, tuple of Domains, or DomainTuple
domain : Domain, tuple of Domain, or DomainTuple
The total domain of the operator's input and output fields
sigma : float>=0
......@@ -38,7 +38,7 @@ def FFTSmoothingOperator(domain, sigma, space=None):
the RGSpace the operator is working on.
If `sigma==0`, an identity operator will be returned.
space: integer, *optional*
space : int, optional
The index of the sub-domain on which the smoothing is performed.
Can be omitted if `domain` only has one sub-domain.
......
......@@ -63,13 +63,14 @@ def power_analyze(field, spaces=None, binbounds=None,
----------
field : Field
The field to be analyzed
spaces : int *optional*
The set of subspaces for which the powerspectrum shall be computed.
spaces : None or int or tuple of int , optional
The set of subdomains for which the powerspectrum shall be computed.
If None, all subdomains will be converted.
(default : None).
binbounds : array-like *optional*
binbounds : None or array-like, optional
Inner bounds of the bins (default : None).
if binbounds==None : bins are inferred.
keep_phase_information : boolean, *optional*
if binbounds is None : bins are inferred.
keep_phase_information : bool, optional
If False, return a real-valued result containing the power spectrum
of the input Field.
If True, return a complex-valued result whose real component
......@@ -82,7 +83,7 @@ def power_analyze(field, spaces=None, binbounds=None,
Returns
-------
out : Field
Field
The output object. Its domain is a PowerSpace and it contains
the power spectrum of 'field'.
"""
......@@ -132,7 +133,7 @@ def power_synthesize_nonrandom(field, spaces=None):
def power_synthesize(field, spaces=None, real_power=True, real_signal=True):
""" Yields a sampled field with `field`**2 as its power spectrum.
"""Returns a sampled field with `field`**2 as its power spectrum.
This method draws a Gaussian random field in the harmonic partner
domain of this field's domains, using this field as power spectrum.
......@@ -141,20 +142,20 @@ def power_synthesize(field, spaces=None, real_power=True, real_signal=True):
----------
field : Field
The input field containing the square root of the power spectrum
spaces : {tuple, int, None} *optional*
Specifies the subspace containing all the PowerSpaces which
spaces : None, int, or tuple of int, optional
Specifies the subdomains containing all the PowerSpaces which
should be converted (default : None).
if spaces==None : Tries to convert the whole domain.
real_power : boolean *optional*
if spaces is None : Tries to convert the whole domain.
real_power : bool, optional
Determines whether the power spectrum is treated as intrinsically
real or complex (default : True).
real_signal : boolean *optional*
real_signal : bool, optional
True will result in a purely real signal-space field
(default : True).
Returns
-------
out : Field
Field
The output object. A random field created with the power spectrum
stored in the `spaces` in `field`.
......@@ -166,7 +167,7 @@ def power_synthesize(field, spaces=None, real_power=True, real_signal=True):
Raises
------
ValueError : If domain specified by `spaces` is not a PowerSpace.
ValueError : If a domain specified by `spaces` is not a PowerSpace.
"""
spec = power_synthesize_nonrandom(field, spaces)
......@@ -213,20 +214,21 @@ def create_power_operator(domain, power_spectrum, space=None, dtype=None):
Parameters
----------
domain : DomainObject
domain : Domain, tuple of Domain or DomainTuple
Domain over which the power operator shall live.
power_spectrum : callable of Field
An object that implements the power spectrum as a function of k.
power_spectrum : callable or Field
An object that contains the power spectrum as a function of k.
space : int
the domain index on which the power operator will work
dtype : type *optional*
the domain index on which the power operator will work
dtype : None or type, optional
dtype that the field holding the power spectrum shall use
(default : None).
if dtype == None: the dtype of `power_spectrum` will be used.
if dtype is None: the dtype of `power_spectrum` will be used.
Returns
-------
DiagonalOperator : An operator that implements the given power spectrum.
DiagonalOperator
An operator that implements the given power spectrum.
"""
domain = DomainTuple.make(domain)
if space is 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