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

cleanups

parent cb5ac9c6
Pipeline #19549 passed with stage
in 4 minutes and 6 seconds
......@@ -26,7 +26,6 @@ class CriticalPowerCurvature(InvertibleOperatorMixin, EndomorphicOperator):
self.T = T
if preconditioner is None:
preconditioner = self.theta.inverse_times
self._domain = self.theta.domain
super(CriticalPowerCurvature, self).__init__(
inverter=inverter,
preconditioner=preconditioner,
......@@ -39,7 +38,7 @@ class CriticalPowerCurvature(InvertibleOperatorMixin, EndomorphicOperator):
@property
def domain(self):
return self._domain
return self.theta.domain
@property
def self_adjoint(self):
......
......@@ -17,12 +17,11 @@ class LogNormalWienerFilterCurvature(InvertibleOperatorMixin,
Parameters
----------
R: LinearOperator,
The response operator of the Wiener filter measurement.
N : EndomorphicOperator
The noise covariance.
The response operator of the Wiener filter measurement.
N: EndomorphicOperator
The noise covariance.
S: DiagonalOperator,
The prior signal covariance
The prior signal covariance
"""
def __init__(self, R, N, S, d, position, inverter, fft4exp=None, **kwargs):
......@@ -31,7 +30,6 @@ class LogNormalWienerFilterCurvature(InvertibleOperatorMixin,
self.S = S
self.d = d
self.position = position
self._domain = self.S.domain
if fft4exp is None:
self._fft = create_composed_fft_operator(self.domain,
......@@ -45,7 +43,7 @@ class LogNormalWienerFilterCurvature(InvertibleOperatorMixin,
@property
def domain(self):
return self._domain
return self.S.domain
@property
def self_adjoint(self):
......@@ -55,8 +53,6 @@ class LogNormalWienerFilterCurvature(InvertibleOperatorMixin,
def unitary(self):
return False
# ---Added properties and methods---
def _times(self, x):
part1 = self.S.inverse_times(x)
# part2 = self._exppRNRexppd * x
......@@ -72,15 +68,11 @@ class LogNormalWienerFilterCurvature(InvertibleOperatorMixin,
def _expp_sspace(self):
return exp(self._fft(self.position))
@property
@memo
def _expp(self):
return self._fft.adjoint_times(self._expp_sspace)
@property
@memo
def _Rexppd(self):
return self.R(self._expp) - self.d
expp = self._fft.adjoint_times(self._expp_sspace)
return self.R(expp) - self.d
@property
@memo
......
......@@ -13,15 +13,15 @@ class LogNormalWienerFilterEnergy(Energy):
Parameters
----------
position: Field,
The current position.
d : Field,
the data.
R : Operator,
The response operator, describtion of the measurement process.
N : EndomorphicOperator,
The noise covariance in data space.
S : EndomorphicOperator,
The prior signal covariance in harmonic space.
The current position.
d: Field,
the data.
R: Operator,
The response operator, describtion of the measurement process.
N: EndomorphicOperator,
The noise covariance in data space.
S: EndomorphicOperator,
The prior signal covariance in harmonic space.
"""
def __init__(self, position, d, R, N, S, inverter, fft4exp=None):
......@@ -47,12 +47,12 @@ class LogNormalWienerFilterEnergy(Energy):
@memo
def value(self):
return 0.5*(self.position.vdot(self._Sp) +
self._Rexppd.vdot(self._NRexppd))
self.curvature._Rexppd.vdot(self.curvature._NRexppd))
@property
@memo
def gradient(self):
return self._Sp + self._exppRNRexppd
return self._Sp + self.curvature._exppRNRexppd
@property
@memo
......@@ -62,22 +62,6 @@ class LogNormalWienerFilterEnergy(Energy):
fft4exp=self._fft,
inverter=self._inverter)
@property
def _expp(self):
return self.curvature._expp
@property
def _Rexppd(self):
return self.curvature._Rexppd
@property
def _NRexppd(self):
return self.curvature._NRexppd
@property
def _exppRNRexppd(self):
return self.curvature._exppRNRexppd
@property
@memo
def _Sp(self):
......
......@@ -10,16 +10,14 @@ class WienerFilterCurvature(InvertibleOperatorMixin, EndomorphicOperator):
for error estimates of the posterior maps. It is the
inverse of the propagator operator.
Parameters
----------
R: LinearOperator,
The response operator of the Wiener filter measurement.
N : EndomorphicOperator
The noise covariance.
The response operator of the Wiener filter measurement.
N: EndomorphicOperator
The noise covariance.
S: DiagonalOperator,
The prior signal covariance
The prior signal covariance
"""
def __init__(self, R, N, S, inverter, preconditioner=None, **kwargs):
......@@ -28,7 +26,6 @@ class WienerFilterCurvature(InvertibleOperatorMixin, EndomorphicOperator):
self.S = S
if preconditioner is None:
preconditioner = self.S.times
self._domain = self.S.domain
super(WienerFilterCurvature, self).__init__(
inverter=inverter,
preconditioner=preconditioner,
......@@ -36,7 +33,7 @@ class WienerFilterCurvature(InvertibleOperatorMixin, EndomorphicOperator):
@property
def domain(self):
return self._domain
return self.S.domain
@property
def self_adjoint(self):
......@@ -46,8 +43,6 @@ class WienerFilterCurvature(InvertibleOperatorMixin, EndomorphicOperator):
def unitary(self):
return False
# ---Added properties and methods---
def _times(self, x):
res = self.R.adjoint_times(self.N.inverse_times(self.R(x)))
res += self.S.inverse_times(x)
......
......@@ -13,14 +13,14 @@ class WienerFilterEnergy(Energy):
----------
position: Field,
The current position.
d : Field,
the data.
R : Operator,
The response operator, description of the measurement process.
N : EndomorphicOperator,
The noise covariance in data space.
S : EndomorphicOperator,
The prior signal covariance in harmonic space.
d: Field,
the data
R: LinearOperator,
The response operator, description of the measurement process.
N: EndomorphicOperator,
The noise covariance in data space.
S: EndomorphicOperator,
The prior signal covariance in harmonic space.
"""
def __init__(self, position, d, R, N, S, inverter, _j=None):
......
......@@ -31,7 +31,6 @@ class Prober(object):
https://www.python.org/download/releases/2.2.3/descrintro/#cooperation
https://rhettinger.wordpress.com/2011/05/26/super-considered-super/
"""
def __init__(self, domain=None, probe_count=8,
......
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