Commit 2ce41e82 authored by Philipp Arras's avatar Philipp Arras
Browse files

OffsetOperator -> Adder

parent 03f31f69
...@@ -19,6 +19,7 @@ from .field import Field ...@@ -19,6 +19,7 @@ from .field import Field
from .multi_field import MultiField from .multi_field import MultiField
from .operators.operator import Operator from .operators.operator import Operator
from .operators.adder import Adder
from .operators.diagonal_operator import DiagonalOperator from .operators.diagonal_operator import DiagonalOperator
from .operators.distributors import DOFDistributor, PowerDistributor from .operators.distributors import DOFDistributor, PowerDistributor
from .operators.domain_tuple_field_inserter import DomainTupleFieldInserter from .operators.domain_tuple_field_inserter import DomainTupleFieldInserter
...@@ -33,7 +34,6 @@ from .operators.field_zero_padder import FieldZeroPadder ...@@ -33,7 +34,6 @@ from .operators.field_zero_padder import FieldZeroPadder
from .operators.inversion_enabler import InversionEnabler from .operators.inversion_enabler import InversionEnabler
from .operators.linear_operator import LinearOperator from .operators.linear_operator import LinearOperator
from .operators.mask_operator import MaskOperator from .operators.mask_operator import MaskOperator
from .operators.offset_operator import OffsetOperator
from .operators.qht_operator import QHTOperator from .operators.qht_operator import QHTOperator
from .operators.regridding_operator import RegriddingOperator from .operators.regridding_operator import RegriddingOperator
from .operators.sampling_enabler import SamplingEnabler from .operators.sampling_enabler import SamplingEnabler
......
...@@ -20,8 +20,8 @@ import numpy as np ...@@ -20,8 +20,8 @@ import numpy as np
from ..domain_tuple import DomainTuple from ..domain_tuple import DomainTuple
from ..domains.power_space import PowerSpace from ..domains.power_space import PowerSpace
from ..field import Field from ..field import Field
from ..operators.adder import Adder
from ..operators.exp_transform import ExpTransform from ..operators.exp_transform import ExpTransform
from ..operators.offset_operator import OffsetOperator
from ..operators.qht_operator import QHTOperator from ..operators.qht_operator import QHTOperator
from ..operators.slope_operator import SlopeOperator from ..operators.slope_operator import SlopeOperator
from ..operators.symmetrizing_operator import SymmetrizingOperator from ..operators.symmetrizing_operator import SymmetrizingOperator
...@@ -29,7 +29,7 @@ from ..sugar import makeOp ...@@ -29,7 +29,7 @@ from ..sugar import makeOp
def _ceps_kernel(k, a, k0): def _ceps_kernel(k, a, k0):
return (a/(1+np.sum((k.T/k0)**2, axis=-1).T))**2 return (a/(1 + np.sum((k.T/k0)**2, axis=-1).T))**2
def CepstrumOperator(target, a, k0): def CepstrumOperator(target, a, k0):
...@@ -189,7 +189,7 @@ def SLAmplitude(*, target, n_pix, a, k0, sm, sv, im, iv, keys=['tau', 'phi']): ...@@ -189,7 +189,7 @@ def SLAmplitude(*, target, n_pix, a, k0, sm, sv, im, iv, keys=['tau', 'phi']):
sig = np.array([sv, iv]) sig = np.array([sv, iv])
mean = Field.from_global_data(sl.domain, mean) mean = Field.from_global_data(sl.domain, mean)
sig = Field.from_global_data(sl.domain, sig) sig = Field.from_global_data(sl.domain, sig)
linear = (sl @ OffsetOperator(mean) @ makeOp(sig)).ducktape(keys[1]) linear = sl @ Adder(mean) @ makeOp(sig).ducktape(keys[1])
# Combine linear and smooth component # Combine linear and smooth component
loglog_ampl = 0.5*(smooth + linear) loglog_ampl = 0.5*(smooth + linear)
......
...@@ -15,18 +15,22 @@ ...@@ -15,18 +15,22 @@
# #
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik. # NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik.
from ..field import Field
from ..multi_field import MultiField
from .operator import Operator from .operator import Operator
class OffsetOperator(Operator): class Adder(Operator):
"""Shifts the input by a fixed field. """Adds a fixed field.
Parameters Parameters
---------- ----------
field : Field field : Field or MultiField
The field by which the input is shifted. The field by which the input is shifted.
""" """
def __init__(self, field): def __init__(self, field):
if not isinstance(field, (Field, MultiField)):
raise TypeError
self._field = field self._field = field
self._domain = self._target = field.domain self._domain = self._target = field.domain
......
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