Commit df4c4cac authored by Philipp Arras's avatar Philipp Arras

Add correlated field with anisotropic correlation structure back in

parent 7dc878a0
......@@ -75,8 +75,7 @@ from .library.inverse_gamma_model import InverseGammaModel
from .library.los_response import LOSResponse
from .library.wiener_filter_curvature import WienerFilterCurvature
from .library.correlated_fields import CorrelatedField
# make_mf_correlated_field)
from .library.correlated_fields import CorrelatedField, MfCorrelatedField
from . import extra
......
......@@ -20,12 +20,11 @@ from __future__ import absolute_import, division, print_function
from ..compat import *
from ..domain_tuple import DomainTuple
from ..multi_field import MultiField
from ..multi_domain import MultiDomain
from ..operators.domain_distributor import DomainDistributor
from ..operators.harmonic_operators import HarmonicTransformOperator
from ..operators.distributors import PowerDistributor
from ..operators.operator import Operator
from ..sugar import exp
from ..operators.simple_linear_operators import FieldAdapter
......@@ -44,39 +43,33 @@ def CorrelatedField(s_space, amplitude_model):
p_space = amplitude_model.target[0]
power_distributor = PowerDistributor(h_space, p_space)
A = power_distributor(amplitude_model)
domain = MultiDomain.union(
(amplitude_model.domain, MultiDomain.make({"xi": h_space})))
return ht(A*FieldAdapter(domain, "xi"))
return ht(A*FieldAdapter(MultiDomain.make({"xi": h_space}), "xi"))
# def make_mf_correlated_field(s_space_spatial, s_space_energy,
# amplitude_model_spatial, amplitude_model_energy):
# '''
# Method for construction of correlated multi-frequency fields
# '''
# h_space_spatial = s_space_spatial.get_default_codomain()
# h_space_energy = s_space_energy.get_default_codomain()
# h_space = DomainTuple.make((h_space_spatial, h_space_energy))
# ht1 = HarmonicTransformOperator(h_space, space=0)
# ht2 = HarmonicTransformOperator(ht1.target, space=1)
# ht = ht2(ht1)
#
# p_space_spatial = amplitude_model_spatial.target[0]
# p_space_energy = amplitude_model_energy.target[0]
#
# pd_spatial = PowerDistributor(h_space, p_space_spatial, 0)
# pd_energy = PowerDistributor(pd_spatial.domain, p_space_energy, 1)
# pd = pd_spatial(pd_energy)
#
# dom_distr_spatial = DomainDistributor(pd.domain, 0)
# dom_distr_energy = DomainDistributor(pd.domain, 1)
#
# a_spatial = dom_distr_spatial(amplitude_model_spatial)
# a_energy = dom_distr_energy(amplitude_model_energy)
# a = a_spatial*a_energy
# A = pd(a)
#
# domain = MultiDomain.union(
# (amplitude_model_spatial.domain, amplitude_model_energy.domain,
# MultiDomain.make({"xi": h_space})))
# return exp(ht(A*FieldAdapter(domain, "xi")))
def MfCorrelatedField(s_space_spatial, s_space_energy, amplitude_model_spatial,
amplitude_model_energy):
'''
Method for construction of correlated multi-frequency fields
'''
h_space_spatial = s_space_spatial.get_default_codomain()
h_space_energy = s_space_energy.get_default_codomain()
h_space = DomainTuple.make((h_space_spatial, h_space_energy))
ht1 = HarmonicTransformOperator(h_space, space=0)
ht2 = HarmonicTransformOperator(ht1.target, space=1)
ht = ht2(ht1)
p_space_spatial = amplitude_model_spatial.target[0]
p_space_energy = amplitude_model_energy.target[0]
pd_spatial = PowerDistributor(h_space, p_space_spatial, 0)
pd_energy = PowerDistributor(pd_spatial.domain, p_space_energy, 1)
pd = pd_spatial(pd_energy)
dom_distr_spatial = DomainDistributor(pd.domain, 0)
dom_distr_energy = DomainDistributor(pd.domain, 1)
a_spatial = dom_distr_spatial(amplitude_model_spatial)
a_energy = dom_distr_energy(amplitude_model_energy)
a = a_spatial*a_energy
A = pd(a)
return exp(ht(A*FieldAdapter(MultiDomain.make({"xi": h_space}), "xi")))
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