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

merge

parents fd73e398 4fb590bb
......@@ -39,8 +39,9 @@ class Minimizer(with_metaclass(NiftyMeta, type('NewBase', (object,), {}))):
Returns
-------
energy : Energy object
Energy
Latest `energy` of the minimization.
status : integer
int
exit status of the minimization
"""
raise NotImplementedError
......@@ -51,9 +51,9 @@ class NonlinearCG(Minimizer):
Returns
-------
energy :
Energy
state at last point of the iteration
status : integer
int
Can be controller.CONVERGED or controller.ERROR
"""
controller = self._controller
......
......@@ -87,7 +87,7 @@ class InformationStore(object):
Parameters
----------
max_history_length : integer
max_history_length : int
Maximum number of stored past updates.
x0 : Field
Initial position in variable space.
......@@ -96,7 +96,7 @@ class InformationStore(object):
Attributes
----------
max_history_length : integer
max_history_length : int
Maximum number of stored past updates.
s : List
Circular buffer of past position differences, which are Fields.
......@@ -106,7 +106,7 @@ class InformationStore(object):
Latest position in variable space.
last_gradient : Field
Gradient at latest position.
k : integer
k : int
Number of updates that have taken place
ss : numpy.ndarray
2D circular buffer of scalar products between different elements of s.
......@@ -139,7 +139,7 @@ class InformationStore(object):
Returns
-------
result : List
List
List of new basis vectors.
"""
result = []
......@@ -165,7 +165,7 @@ class InformationStore(object):
Returns
-------
result : numpy.ndarray
numpy.ndarray
Scalar matrix.
"""
m = self.history_length
......@@ -207,7 +207,7 @@ class InformationStore(object):
Returns
-------
delta : List
List
List of the new scalar coefficients (deltas).
"""
m = self.history_length
......
......@@ -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.
......
......@@ -39,18 +39,19 @@ class HarmonicTransformOperator(LinearOperator):
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
"adjoint_times".
target: Space (optional)
The target space of the transform operation.
If omitted, a space will be chosen automatically.
Whenever the input space of the transform is an RGSpace, the codomain
target : Domain, optional
The target domain of the transform operation.
If omitted, a domain will be chosen automatically.
Whenever the input domain of the transform is an RGSpace, the codomain
(and its parameters) are uniquely determined.
For LMSpace, a GLSpace of sufficient resolution is chosen.
space: the index of the space on which the operator should act
If None, it is set to 0 if domain contains exactly one space.
domain[space] must be a harmonic space.
space : int, optional
The index of the domain on which the operator should act
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):
......
......@@ -35,7 +35,7 @@ class LaplaceOperator(EndomorphicOperator):
Parameters
----------
logarithmic : boolean,
logarithmic : bool, optional
Whether smoothness is calculated on a logarithmic scale or linear scale
default : True
space : int
......
......@@ -57,7 +57,7 @@ class LinearOperator(with_metaclass(
@abc.abstractproperty
def domain(self):
"""
domain : DomainTuple
DomainTuple
The domain on which the Operator's input Field lives.
Every Operator which inherits from the abstract LinearOperator
base class must have this attribute.
......@@ -67,7 +67,7 @@ class LinearOperator(with_metaclass(
@abc.abstractproperty
def target(self):
"""
target : DomainTuple
DomainTuple
The domain on which the Operator's output Field lives.
Every Operator which inherits from the abstract LinearOperator
base class must have this attribute.
......@@ -77,7 +77,7 @@ class LinearOperator(with_metaclass(
@property
def inverse(self):
"""
inverse : LinearOperator
LinearOperator
Returns a LinearOperator object which behaves as if it were
the inverse of this operator.
"""
......@@ -87,7 +87,7 @@ class LinearOperator(with_metaclass(
@property
def adjoint(self):
"""
adjoint : LinearOperator
LinearOperator
Returns a LinearOperator object which behaves as if it were
the adjoint of this operator.
"""
......@@ -141,7 +141,7 @@ class LinearOperator(with_metaclass(
Returns
-------
out : integer
int
This is any subset of LinearOperator.{TIMES, ADJOINT_TIMES,
INVERSE_TIMES, ADJOINT_INVERSE_TIMES, INVERSE_ADJOINT_TIMES},
joined together by the "|" operator.
......@@ -158,7 +158,7 @@ class LinearOperator(with_metaclass(
The input Field, living on the Operator's domain or target,
depending on mode.
mode : integer
mode : int
LinearOperator.TIMES: normal application
LinearOperator.ADJOINT_TIMES: adjoint application
LinearOperator.INVERSE_TIMES: inverse application
......@@ -168,7 +168,7 @@ class LinearOperator(with_metaclass(
Returns
-------
out : Field
Field
The processed Field living on the Operator's target or domain,
depending on mode.
"""
......@@ -188,7 +188,7 @@ class LinearOperator(with_metaclass(
Returns
-------
out : Field
Field
The processed Field living on the Operator's target domain.
"""
return self.apply(x, self.TIMES)
......@@ -203,7 +203,7 @@ class LinearOperator(with_metaclass(
Returns
-------
out : Field
Field
The processed Field living on the Operator's domain.
"""
return self.apply(x, self.INVERSE_TIMES)
......@@ -218,7 +218,7 @@ class LinearOperator(with_metaclass(
Returns
-------
out : Field
Field
The processed Field living on the Operator's domain.
"""
return self.apply(x, self.ADJOINT_TIMES)
......@@ -233,7 +233,7 @@ class LinearOperator(with_metaclass(
Returns
-------
out : Field
Field
The processed Field living on the Operator's target domain.
Notes
......@@ -267,7 +267,7 @@ class LinearOperator(with_metaclass(
Returns
-------
sample : Field
Returns the a sample from the Gaussian of given covariance.
Field
A sample from the Gaussian of given covariance.
"""
raise NotImplementedError
......@@ -36,9 +36,9 @@ def SmoothnessOperator(domain, strength=1., logarithmic=True, space=None):
Parameters
----------
strength: nonnegative float
strength : nonnegative float
Specifies the strength of the SmoothnessOperator
logarithmic : boolean
logarithmic : bool, optional
Whether smoothness is calculated on a logarithmic scale or linear scale
default : True
"""
......
......@@ -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:
......
Supports Markdown
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