Use scipy's C2K instead of hardcoding temperature conversion algorithm.
authorW. Trevor King <wking@drexel.edu>
Fri, 16 Mar 2012 02:05:12 +0000 (22:05 -0400)
committerW. Trevor King <wking@drexel.edu>
Fri, 16 Mar 2012 02:05:12 +0000 (22:05 -0400)
pyafm/temperature.py

index 9d85a7ed4905ed71cd7c51070b9a4310640249ce..e4b04d14be2ba5b548157f6418b35ce686315f6c 100644 (file)
@@ -16,6 +16,7 @@
 # License along with unfold_protein.  If not, see
 # <http://www.gnu.org/licenses/>.
 
+from scipy.constants import C2K as _C2K
 from pypid.backend.melcor import MelcorBackend as _TemperatureBackend
 
 from . import LOG as _LOG
@@ -70,7 +71,7 @@ class Temperature (object):
         if unit == Kelvin:  # convert K -> K
             pass
         elif unit == Celsius:  # convert C -> K
-            temp += 273.15
+            temp = _C2K(temp)
         else:
             raise NotImplementedError(unit)
         _LOG.info('measured temperature of {:g} K'.format(temp))