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

Merge branch 'more_flexibility' into 'NIFTy_5'

added the possibility to specify a key when constructing a correlated field

See merge request ift/nifty-dev!113
parents b59b2cb5 5e85435d
......@@ -27,22 +27,25 @@ from ..operators.harmonic_operators import HarmonicTransformOperator
from ..operators.simple_linear_operators import FieldAdapter
def CorrelatedField(s_space, amplitude_model):
def CorrelatedField(s_space, amplitude_model, name='xi'):
'''
Function for construction of correlated fields
Parameters
----------
s_space : Field domain
amplitude_model : model for correlation structure
s_space : Domain
Field domain
amplitude_model: Operator
model for correlation structure
name : string
MultiField component name
'''
h_space = s_space.get_default_codomain()
ht = HarmonicTransformOperator(h_space, s_space)
p_space = amplitude_model.target[0]
power_distributor = PowerDistributor(h_space, p_space)
A = power_distributor(amplitude_model)
return ht(A*FieldAdapter(MultiDomain.make({"xi": h_space}), "xi"))
return ht(A*FieldAdapter(MultiDomain.make({name: h_space}), name))
def MfCorrelatedField(s_space_spatial, s_space_energy, amplitude_model_spatial,
......
......@@ -291,7 +291,7 @@ class SHTOperator(LinearOperator):
def __reduce__(self):
return (_unpickleSHTOperator,
(list(self._domain), self._target[self._space], self._space))
(self._domain, self._target[self._space], self._space))
def apply(self, x, mode):
self._check_input(x, mode)
......
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