The FFTOperator class – …

class nifty.FFTOperator[source]

Bases: nifty.operators.linear_operator.linear_operator.LinearOperator

Transforms between a pair of position and harmonic domains.

Built-in domain pairs are
  • a harmonic and a non-harmonic RGSpace (with matching distances)
  • a HPSpace and a LMSpace
  • a GLSpace and a LMSpace

Within a domain pair, both orderings are possible.

The operator provides a “times” and an “adjoint_times” operation. For a pair of RGSpaces, the “adjoint_times” operation is equivalent to “inverse_times”; for the sphere-related domains this is not the case, since the operator matrix is not square.

Parameters:

domain: Space or single-element tuple of Spaces

The domain of the data that is input by “times” and output by “adjoint_times”.

target: Space or single-element tuple of Spaces (optional)

The domain of the data that is output by “times” and input by “adjoint_times”. If omitted, a co-domain will be chosen automatically. Whenever “domain” is an RGSpace, the codomain (and its parameters) are uniquely determined (except for “zerocenter”). For GLSpace, HPSpace, and LMSpace, a sensible (but not unique) co-domain is chosen that should work satisfactorily in most situations, but for full control, the user should explicitly specify a codomain.

module: String (optional)

Software module employed for carrying out the transform operations. For RGSpace pairs this can be “numpy” or “fftw”, where “numpy” is always available, but “fftw” offers higher performance and parallelization. For sphere-related domains, only “pyHealpix” is available. If omitted, “fftw” is selected for RGSpaces if available, else “numpy”; on the sphere the default is “pyHealpix”.

domain_dtype: data type (optional)

Data type of the fields that go into “times” and come out of “adjoint_times”. Default is “numpy.complex”.

target_dtype: data type (optional)

Data type of the fields that go into “adjoint_times” and come out of “times”. Default is “numpy.complex”.

Raises:

ValueError:

if “domain” or “target” are not of the proper type.

Attributes

domain: Tuple of Spaces (with one entry) The domain of the data that is input by “times” and output by “adjoint_times”.
target: Tuple of Spaces (with one entry) The domain of the data that is output by “times” and input by “adjoint_times”.
unitary: bool Returns True if the operator is unitary (currently only the case if the domain and codomain are RGSpaces), else False.

Methods

get_default_codomain(domain) Returns a codomain to the given domain.
classmethod get_default_codomain(domain)[source]

Returns a codomain to the given domain.

Parameters:

domain: Space

An instance of RGSpace, HPSpace, GLSpace or LMSpace.

Returns:

target: Space

A (more or less perfect) counterpart to “domain” with respect to a FFT operation. Whenever “domain” is an RGSpace, the codomain (and its parameters) are uniquely determined (except for “zerocenter”). For GLSpace, HPSpace, and LMSpace, a sensible (but not unique) co-domain is chosen that should work satisfactorily in most situations. For full control however, the user should not rely on this method.

Raises:

ValueError:

if no default codomain is defined for “domain”.

domain

domain – tuple of DomainObjects, i.e. Spaces and FieldTypes The domain on which the Operator’s input Field lives. Every Operator which inherits from the abstract LinearOperator base class must have this attribute.

target

target – tuple of DomainObjects, i.e. Spaces and FieldTypes The domain on which the Operator’s output Field lives. Every Operator which inherits from the abstract LinearOperator base class must have this attribute.

unitary

unitary – boolean States whether the Operator is unitary or not. Every Operator which inherits from the abstract LinearOperator base class must have this attribute.