Ran update_copyright.py, updating all the copyright blurbs and adding AUTHORS.
[hooke.git] / hooke / driver / picoforce.py
old mode 100755 (executable)
new mode 100644 (file)
index e7df889..9bf2311
@@ -1,19 +1,35 @@
-'''
-libpicoforce.py
-
-Library for interpreting Picoforce force spectroscopy files.
-
-Copyright (C) 2006 Massimo Sandal (University of Bologna, Italy).
-
-This program is released under the GNU General Public License version 2.
-'''
-
-import re, struct
+# Copyright (C) 2006-2010 Alberto Gomez-Casado
+#                         Massimo Sandal <devicerandom@gmail.com>
+#                         W. Trevor King <wking@drexel.edu>
+#
+# 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 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/>.
+
+"""Library for interpreting Picoforce force spectroscopy files.
+"""
+
+import re
+import struct
 from scipy import arange
 
-import libhookecurve as lhc
+#from .. import libhooke as lh
+from .. import curve as lhc
 
-__version__='0.0.0.20080404'
+
+__version__='0.0.0.20090923'
 
 
 class DataChunk(list):
@@ -35,7 +51,7 @@ class picoforceDriver(lhc.Driver):
         '''
         constructor method
         '''
-
+        filename = lh.get_file_path(filename)
         self.textfile=file(filename)
         self.binfile=file(filename,'rb')
 
@@ -533,11 +549,13 @@ class picoforceDriver(lhc.Driver):
 
         main_plot=lhc.PlotObject()
 
-        main_plot.vectors=[[zdomain.ext()[0:samples], force.ext()[0:samples]],[zdomain.ret()[0:samples], force.ret()[0:samples]]]
+        main_plot.vectors = [[zdomain.ext()[0:samples], force.ext()[0:samples]],[zdomain.ret()[0:samples], force.ret()[0:samples]]]
         main_plot.normalize_vectors()
-        main_plot.units=['meters','newton']
-        main_plot.destination=0
-        main_plot.title=self.filepath
-
+        main_plot.units = ['meters','newton']
+        main_plot.destination = 0
+        main_plit.filename = self.filepath
+        main_plot.title = self.filepath
+        main_plot.colors = ['red', 'blue']
+        main_plit.styles = ['plot', 'plot']
 
         return [main_plot]