Commit 0f88177b authored by Martin Reinecke's avatar Martin Reinecke
Browse files

renamings

parent de0a55da
......@@ -32,7 +32,8 @@ from .operators.domain_distributor import DomainDistributor
from .operators.endomorphic_operator import EndomorphicOperator
from .operators.exp_transform import ExpTransform
from .operators.fft_operator import FFTOperator
from .operators.fft_smoothing_operator import FFTSmoothingOperator
from .operators.hartley_operator import HartleyOperator
from .operators.harmonic_smoothing_operator import HarmonicSmoothingOperator
from .operators.geometry_remover import GeometryRemover
from .operators.harmonic_transform_operator import HarmonicTransformOperator
from .operators.inversion_enabler import InversionEnabler
......
......@@ -25,7 +25,7 @@ from ..models.local_nonlinearity import PointwiseExponential
from ..models.variable import Variable
from ..multi.multi_field import MultiField
from ..operators.domain_distributor import DomainDistributor
from ..operators.fft_operator import FFTOperator
from ..operators.hartley_operator import HartleyOperator
from ..operators.harmonic_transform_operator import HarmonicTransformOperator
from ..operators.power_distributor import PowerDistributor
......@@ -41,7 +41,7 @@ def make_correlated_field(s_space, amplitude_model):
amplitude_model : model for correlation structure
'''
h_space = s_space.get_default_codomain()
ht = FFTOperator(h_space, s_space)
ht = HartleyOperator(h_space, s_space)
p_space = amplitude_model.value.domain[0]
power_distributor = PowerDistributor(h_space, p_space)
position = MultiField.from_dict({
......
......@@ -22,11 +22,11 @@ from ..compat import *
from ..domain_tuple import DomainTuple
from ..utilities import infer_space
from .diagonal_operator import DiagonalOperator
from .fft_operator import FFTOperator
from .hartley_operator import HartleyOperator
from .scaling_operator import ScalingOperator
def FFTSmoothingOperator(domain, sigma, space=None):
def HarmonicSmoothingOperator(domain, sigma, space=None):
""" This function returns an operator that carries out a smoothing with
a Gaussian kernel of width `sigma` on the part of `domain` given by
`space`.
......@@ -59,12 +59,12 @@ def FFTSmoothingOperator(domain, sigma, space=None):
space = infer_space(domain, space)
if domain[space].harmonic:
raise TypeError("domain must not be harmonic")
FFT = FFTOperator(domain, space=space)
codomain = FFT.domain[space].get_default_codomain()
Hartley = HartleyOperator(domain, space=space)
codomain = Hartley.domain[space].get_default_codomain()
kernel = codomain.get_k_length_array()
smoother = codomain.get_fft_smoothing_kernel_function(sigma)
kernel = smoother(kernel)
ddom = list(domain)
ddom[space] = codomain
diag = DiagonalOperator(kernel, ddom, space)
return FFT.inverse*diag*FFT
return Hartley.inverse*diag*Hartley
......@@ -22,7 +22,7 @@ from .. import utilities
from ..compat import *
from ..domain_tuple import DomainTuple
from ..domains.rg_space import RGSpace
from .fft_operator import FFTOperator
from .hartley_operator import HartleyOperator
from .linear_operator import LinearOperator
from .sht_operator import SHTOperator
......@@ -65,7 +65,7 @@ class HarmonicTransformOperator(LinearOperator):
raise TypeError(
"HarmonicTransformOperator only works on a harmonic space")
if isinstance(hspc, RGSpace):
self._op = FFTOperator(domain, target, space)
self._op = HartleyOperator(domain, target, space)
else:
self._op = SHTOperator(domain, target, space)
......
......@@ -56,6 +56,14 @@ class Consistency_Tests(unittest.TestCase):
op = ift.FFTOperator(sp.get_default_codomain())
ift.extra.consistency_check(op, dtype, dtype)
@expand(product(_h_RG_spaces+_p_RG_spaces,
[np.float64, np.complex128]))
def testHartley(self, sp, dtype):
op = ift.HartleyOperator(sp)
ift.extra.consistency_check(op, dtype, dtype)
op = ift.HartleyOperator(sp.get_default_codomain())
ift.extra.consistency_check(op, dtype, dtype)
@expand(product(_h_spaces, [np.float64, np.complex128]))
def testHarmonic(self, sp, dtype):
op = ift.HarmonicTransformOperator(sp)
......
......@@ -37,13 +37,13 @@ class SmoothingOperator_Tests(unittest.TestCase):
@expand(product(spaces, [0., .5, 5.]))
def test_property(self, space, sigma):
op = ift.FFTSmoothingOperator(space, sigma=sigma)
op = ift.HarmonicSmoothingOperator(space, sigma=sigma)
if op.domain[0] != space:
raise TypeError
@expand(product(spaces, [0., .5, 5.]))
def test_adjoint_times(self, space, sigma):
op = ift.FFTSmoothingOperator(space, sigma=sigma)
op = ift.HarmonicSmoothingOperator(space, sigma=sigma)
rand1 = ift.Field.from_random('normal', domain=space)
rand2 = ift.Field.from_random('normal', domain=space)
tt1 = rand1.vdot(op.times(rand2))
......@@ -52,7 +52,7 @@ class SmoothingOperator_Tests(unittest.TestCase):
@expand(product(spaces, [0., .5, 5.]))
def test_times(self, space, sigma):
op = ift.FFTSmoothingOperator(space, sigma=sigma)
op = ift.HarmonicSmoothingOperator(space, sigma=sigma)
fld = np.zeros(space.shape, dtype=np.float64)
fld[0] = 1.
rand1 = ift.Field.from_global_data(space, fld)
......@@ -64,7 +64,7 @@ class SmoothingOperator_Tests(unittest.TestCase):
def test_smooth_regular1(self, sz, d, sigma, tp):
tol = _get_rtol(tp)
sp = ift.RGSpace(sz, distances=d)
smo = ift.FFTSmoothingOperator(sp, sigma=sigma)
smo = ift.HarmonicSmoothingOperator(sp, sigma=sigma)
inp = ift.Field.from_random(domain=sp, random_type='normal', std=1,
mean=4, dtype=tp)
out = smo(inp)
......@@ -75,7 +75,7 @@ class SmoothingOperator_Tests(unittest.TestCase):
def test_smooth_regular2(self, sz1, sz2, d1, d2, sigma, tp):
tol = _get_rtol(tp)
sp = ift.RGSpace([sz1, sz2], distances=[d1, d2])
smo = ift.FFTSmoothingOperator(sp, sigma=sigma)
smo = ift.HarmonicSmoothingOperator(sp, sigma=sigma)
inp = ift.Field.from_random(domain=sp, random_type='normal', std=1,
mean=4, dtype=tp)
out = smo(inp)
......
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