ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/osprai/osprai/trunk/io_module.py
(Generate patch)
# Line 24 | Line 24
24    >>> io.writesprit(ba3, "newspritfile.txt")
25    >>> io.writeclamp(ba3, "newclampfile.txt")
26   """
27 < __version__ = "110214"
27 > __version__ = "110321"
28  
29  
30   ## Import libraries.
31   from copy import deepcopy
32   from os import getcwd
33   from time import mktime
34 + import re
35   import numpy as np                  ## Numpy array library.
36   import ba_class as ba               ## Our Biosensor Array class.
37   reload(ba)
# Line 310 | Line 311
311      ## Write sensorgram data header line.
312      for i,roi in enumerate(ba0.roi):
313          if (i>0): fp.write("\t")
314 <        name = roi.name.strip() + " " + roi.desc.strip()
315 <        fp.write("%s_X\t%s_Y" % (name, name))
314 >        name = roi.name.strip()
315 >        name = re.sub(r'\W+', '', name)  ## Remove nonprinting characters.
316 >        name = re.sub(r'_ ', '', name)  ## Remove other unwanted stuff.
317 >        name = re.sub(r'Fc=[0-9]+', '', name)
318 >        name = re.sub(r'[0-9]+_[XY]', '', name)
319 >        txt = name + " Fc=" + str(i+1) + "-1_X\t"
320 >        txt = txt + name + " Fc=" + str(i+1) + "-1_Y"
321 >        fp.write(txt)
322      ## Write sensorgram data lines. Three decimal places.
323      for dpoint in range(len(ba0.roi[0].time)):
324          fp.write("\r\n")

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines