Run update-copyright.py.
[calibcant.git] / calibcant / T_analyze.py
index d03bf4d505ce7585b2049e883ececa0ab64a3edf..3635e2d52c362e4be10aa7cb98d202b177862b8d 100644 (file)
@@ -1,22 +1,20 @@
 # calibcant - tools for thermally calibrating AFM cantilevers
 #
-# Copyright (C) 2008-2011 W. Trevor King <wking@drexel.edu>
+# Copyright (C) 2008-2012 W. Trevor King <wking@drexel.edu>
 #
 # This file is part of calibcant.
 #
-# calibcant 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.
+# calibcant is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free Software
+# Foundation, either version 3 of the License, or (at your option) any later
+# version.
 #
-# calibcant 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.
+# calibcant 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 General Public License for more details.
 #
-# You should have received a copy of the GNU Lesser General Public
-# License along with calibcant.  If not, see
-# <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU General Public License along with
+# calibcant.  If not, see <http://www.gnu.org/licenses/>.
 
 """Temperature analysis.
 
@@ -115,9 +113,10 @@ def T_save(filename, group='/', raw_T=None, temperature_config=None,
             except KeyError:
                 pass
             cwg['raw'] = raw_T
-        if temperature_config:
+        if temperature_config is not None:
             config_cwg = _h5_create_group(cwg, 'config')
-            temperature_config.save(group=config_cwg)
+            storage = _HDF5_Storage()
+            storage.save(config=temperature_config, group=config_cwg)
         if processed_T is not None:
             try:
                 del cwg['processed']
@@ -164,4 +163,5 @@ def T_plot(raw_T=None, processed_T=None):
     if axes2:
         axes2.set_title('Processed Temperatures %s' % timestamp)
         axes2.plot(processed_T, label='processed')
-    figure.show()
+    if hasattr(figure, 'show'):
+        figure.show()