space.py 1.91 KB
Newer Older
1
2
3
4
5
# NIFTy
# Copyright (C) 2017  Theo Steininger
#
# Author: Theo Steininger
#
6
7
8
9
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
10
#
11
12
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
14
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
16
# You should have received a copy of the GNU General Public License
17
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
Marco Selig's avatar
Marco Selig committed
18
19

from __future__ import division
20
21
22

import abc

23
from nifty.domain_object import DomainObject
Theo Steininger's avatar
Theo Steininger committed
24

25

26
class Space(DomainObject):
Martin Reinecke's avatar
Martin Reinecke committed
27
    def __init__(self):
Theo Steininger's avatar
Theo Steininger committed
28
29
30
        """
            Parameters
            ----------
Martin Reinecke's avatar
Martin Reinecke committed
31
            None.
Marco Selig's avatar
Marco Selig committed
32

Theo Steininger's avatar
Theo Steininger committed
33
34
35
36
            Returns
            -------
            None.
        """
37

Martin Reinecke's avatar
Martin Reinecke committed
38
        super(Space, self).__init__()
39

40
41
42
    @abc.abstractproperty
    def harmonic(self):
        raise NotImplementedError
43

44
    @abc.abstractproperty
45
    def total_volume(self):
46
47
        raise NotImplementedError(
            "There is no generic volume for the Space base class.")
48

49
50
    @abc.abstractmethod
    def copy(self):
Martin Reinecke's avatar
Martin Reinecke committed
51
        return self.__class__()
52

53
    def get_distance_array(self, distribution_strategy):
54
        raise NotImplementedError(
55
56
            "There is no generic distance structure for Space base class.")

57
    def get_fft_smoothing_kernel_function(self, sigma):
58
59
        raise NotImplementedError(
            "There is no generic co-smoothing kernel for Space base class.")
60

61
62
    def hermitian_decomposition(self, x, axes=None,
                                preserve_gaussian_variance=False):
63
64
        raise NotImplementedError

65
    def __repr__(self):
Theo Steininger's avatar
Theo Steininger committed
66
67
68
        string = ""
        string += str(type(self)) + "\n"
        return string