wiener_filter_curvature.py 1.54 KB
Newer Older
1
2
3
4
5
from nifty.operators import EndomorphicOperator,\
                            InvertibleOperatorMixin


class WienerFilterCurvature(InvertibleOperatorMixin, EndomorphicOperator):
Jakob Knollmueller's avatar
Jakob Knollmueller committed
6
7
8
9
    """The curvature of the WienerFilterEnergy.

    This operator implements the second derivative of the
    WienerFilterEnergy used in some minimization algorithms or
10
11
    for error estimates of the posterior maps. It is the
    inverse of the propagator operator.
Jakob Knollmueller's avatar
Jakob Knollmueller committed
12
13
14
15
16
17
18
19
20
21
22
23
24


    Parameters
    ----------
    R: LinearOperator,
        The response operator of the Wiener filter measurement.
    N : EndomorphicOperator
        The noise covariance.
    S: DiagonalOperator,
        The prior signal covariance

    """

25
    def __init__(self, R, N, S, inverter=None, preconditioner=None, **kwargs):
26
27
28
29
30
31
32

        self.R = R
        self.N = N
        self.S = S
        if preconditioner is None:
            preconditioner = self.S.times
        self._domain = self.S.domain
33
34
        super(WienerFilterCurvature, self).__init__(
                                                 inverter=inverter,
35
36
                                                 preconditioner=preconditioner,
                                                 **kwargs)
37

38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
    @property
    def domain(self):
        return self._domain

    @property
    def self_adjoint(self):
        return True

    @property
    def unitary(self):
        return False

    # ---Added properties and methods---

    def _times(self, x, spaces):
53
54
        return (self.R.adjoint_times(self.N.inverse_times(self.R(x))) +
                self.S.inverse_times(x))