Update to use new h5config, pycomedi, etc.
authorW. Trevor King <wking@drexel.edu>
Tue, 17 Jan 2012 22:49:26 +0000 (17:49 -0500)
committerW. Trevor King <wking@drexel.edu>
Tue, 17 Jan 2012 22:49:26 +0000 (17:49 -0500)
unfold_protein/temperature.py [new file with mode: 0644]

diff --git a/unfold_protein/temperature.py b/unfold_protein/temperature.py
new file mode 100644 (file)
index 0000000..91c1c6f
--- /dev/null
@@ -0,0 +1,33 @@
+# Copyright (C) 2011 W. Trevor King <wking@drexel.edu>
+#
+# This file is part of unfold_protein.
+#
+# Unfold_protein is free software: you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation, either
+# version 3 of the License, or (at your option) any later version.
+#
+# Unfold_protein is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with unfold_protein.  If not, see
+# <http://www.gnu.org/licenses/>.
+
+from pypid.backend.melcor import MelcorBackend as _TemperatureBackend
+
+from . import LOG as _LOG
+
+
+class Temperature (_TemperatureBackend):
+    def __init__(self, **kwargs):
+        _LOG.debug('setup temperature monitor')
+        super(Temperature, self).__init__(self, **kwargs)
+        self.set_max_mv(max=1)  # amp
+
+    def get_temperature(self):
+        temp = self.get_pv() + 273.15  # return temperature in kelvin
+        _LOG.info('measured temperature of {:g} K'.format(temp))
+        return temp