X-Git-Url: http://git.tremily.us/?p=calibcant.git;a=blobdiff_plain;f=calibcant%2FT_analyze.py;h=3635e2d52c362e4be10aa7cb98d202b177862b8d;hp=d03bf4d505ce7585b2049e883ececa0ab64a3edf;hb=607535583cd8f3f4315cda669114e759e5b269ec;hpb=27790ad67e4706f65de1ec22cfcc51e8d3da03bf diff --git a/calibcant/T_analyze.py b/calibcant/T_analyze.py index d03bf4d..3635e2d 100644 --- a/calibcant/T_analyze.py +++ b/calibcant/T_analyze.py @@ -1,22 +1,20 @@ # calibcant - tools for thermally calibrating AFM cantilevers # -# Copyright (C) 2008-2011 W. Trevor King +# Copyright (C) 2008-2012 W. Trevor King # # 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 -# . +# You should have received a copy of the GNU General Public License along with +# calibcant. If not, see . """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()