Ran update-copyright.py
[hooke.git] / hooke / driver / hemingway.py
index 8cd5f5e0547e55640b877f3a2471ff4c4cdac1f8..18b96c4b6428ecbf3bdfeae95210b6d98126f0ae 100644 (file)
@@ -1,30 +1,27 @@
-# Copyright (C) 2008-2010 Massimo Sandal <devicerandom@gmail.com>
-#                         W. Trevor King <wking@drexel.edu>
+# Copyright (C) 2010-2012 W. Trevor King <wking@tremily.us>
 #
 # This file is part of Hooke.
 #
-# Hooke 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.
+# Hooke 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.
 #
-# Hooke 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.
+# Hooke 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 Hooke.  If not, see
-# <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU Lesser General Public License
+# along with Hooke.  If not, see <http://www.gnu.org/licenses/>.
 
 """Library for interpreting Hemingway force spectroscopy files.
 """
 
+import os.path
 import numpy
 
 from .. import curve as curve
-from .. import experiment as experiment
-from ..config import Setting
 from ..util.util import Closing as Closing
 from . import Driver as Driver
 
@@ -36,6 +33,8 @@ class HemingwayDriver (Driver):
         super(HemingwayDriver, self).__init__(name='hemingway')
 
     def is_me(self, path):
+        if os.path.isdir(path):
+            return False
         headlines = []
         with Closing(file(path, 'r')) as f:
             for i in range(2):
@@ -67,9 +66,8 @@ class HemingwayDriver (Driver):
             'deflection (N)',
             'imposed (N)',
             ]
+        ret.info['name'] = 'force clamp'
         # assume 1 ms timestep
         ret[:,0] = numpy.arange(0, 1e-3*data.shape[0], 1e-3, dtype=ret.dtype)
-        
-        file_info['filetype'] = self.name
-        file_info['experiment'] = experiment.ForceClamp
+
         return ([ret,], file_info)