Remove buggy self argument from Temperature self() call.
[unfold-protein.git] / unfold_protein / temperature.py
1 # Copyright (C) 2011 W. Trevor King <wking@drexel.edu>
2 #
3 # This file is part of unfold_protein.
4 #
5 # Unfold_protein is free software: you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation, either
8 # version 3 of the License, or (at your option) any later version.
9 #
10 # Unfold_protein is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU Lesser General Public License for more details.
14 #
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with unfold_protein.  If not, see
17 # <http://www.gnu.org/licenses/>.
18
19 from pypid.backend.melcor import MelcorBackend as _TemperatureBackend
20
21 from . import LOG as _LOG
22
23
24 class Temperature (_TemperatureBackend):
25     def __init__(self, **kwargs):
26         _LOG.debug('setup temperature monitor')
27         super(Temperature, self).__init__(**kwargs)
28         self.set_max_mv(max=1)  # amp
29
30     def get_temperature(self):
31         temp = self.get_pv() + 273.15  # return temperature in kelvin
32         _LOG.info('measured temperature of {:g} K'.format(temp))
33         return temp