constant.py 540 Bytes
Newer Older
1
from ..operators import MultiSkyGradientOperator
Philipp Arras's avatar
Philipp Arras committed
2
from .model import Model
3
4


Philipp Arras's avatar
Philipp Arras committed
5
class Constant(Model):
6
    def __init__(self, position, constant):
Philipp Arras's avatar
Philipp Arras committed
7
        super(Constant, self).__init__(position)
8
9
10
11
12
13
14
15
16
17
        self._constant = constant

        self._value = self._constant

        self._gradient = MultiSkyGradientOperator({},
                                                  position.domain,
                                                  self.value.domain)

    def at(self, position):
        return self.__class__(position, self._constant)