From: W. Trevor King Date: Fri, 16 Mar 2012 02:05:12 +0000 (-0400) Subject: Use scipy's C2K instead of hardcoding temperature conversion algorithm. X-Git-Tag: v0.4~19 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=77d292d17f4e939722a4d95e656d087c47877f53;p=pyafm.git Use scipy's C2K instead of hardcoding temperature conversion algorithm. --- diff --git a/pyafm/temperature.py b/pyafm/temperature.py index 9d85a7e..e4b04d1 100644 --- a/pyafm/temperature.py +++ b/pyafm/temperature.py @@ -16,6 +16,7 @@ # License along with unfold_protein. If not, see # . +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))