Beispiel #1
0
 def interpretXMLvalue(self, c) :
   name = c.getAttribute('Name')
   if name == 'Num' :
     self.num = int(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'Hits' :
     self.hits = int(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'Misses' :
     self.misses = int(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'TimeToHitDist' :
     import re
     d = smds.strFromTxtNodes(c.childNodes)
     d = re.sub("\r", "\n", d)
     d = re.sub("[ \t]", '', d)
     d = re.sub("\n{2,}", "\n", d)
     if d == '' : data = []
     else :       data = d.split("\n")
     if len(data) and data[0] == '' : data = data[1:]
     if len(data) and data[-1] == '' : data = data[:-1]
     self.hitTimeDist_t = []
     self.hitTimeDist_count = []
     if len(data) :
       for (t, count) in [ p.split(",") for p in data ] :
         self.hitTimeDist_t.append(float(t))
         self.hitTimeDist_count.append(int(count))
     return True
   return False		# value not found
Beispiel #2
0
 def interpretXMLvalue(self, c) :
   name = c.getAttribute('Name')
   if name == 'Length' :
     self.length = float(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'Hits' :
     self.hits = int(smds.strFromTxtNodes(c.childNodes))
     return True
   return False		# value not found
Beispiel #3
0
 def interpretXMLvalue(self, c) :
   name = c.getAttribute('Name')
   if name == 'chargeRadius' :
     self.chargeRadius = float(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'charge' :
     self.charge = float(smds.strFromTxtNodes(c.childNodes))
     return True
   return cAHL_elef.interpretXMLvalue(self, c)
Beispiel #4
0
 def interpretXMLvalue(self, c) :
   name = c.getAttribute('Name')
   if name == 'stepsPerTape' :
     self.stepsPerTape = int(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'tapeSelect' :
     self.tapeSelect = int(smds.strFromTxtNodes(c.childNodes))
     return True
   return False
Beispiel #5
0
 def interpretXMLvalue(self, c) :
   if c.getAttribute('Name') == 'vesicleCounts' :
     d = smds.strFromTxtNodes(c.childNodes)
     self.vesicleCounts = [ int(x) for x in d.split(', ') ]
     return True
   if c.getAttribute('Name') == 'freeCounts' :
     d = smds.strFromTxtNodes(c.childNodes)
     self.freeCounts = [ int(x) for x in d.split(', ') ]
     return True
   return False
Beispiel #6
0
 def interpretXMLvalue(self, c) :
   name = c.getAttribute('Name')
   if name == 'flow' :
     self.flow = float(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'flowLength' :
     self.flowLength = float(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'drainLength' :
     self.drainLength = float(smds.strFromTxtNodes(c.childNodes))
     return True
   return False		# value not found
Beispiel #7
0
 def interpretXMLvalue(self, c) :
   name = c.getAttribute('Name')
   if name == 'PotProfile' :
     self.potExtent = smds.Task.PotProfile(smds.strFromTxtNodes(c.childNodes).strip())
     return True
   if name == 'potA' :
     self.potA = float(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'potB' :
     self.potB = float(smds.strFromTxtNodes(c.childNodes))
     return True
   return False
Beispiel #8
0
 def interpretXMLvalue(self, c) :
   name = c.getAttribute('Name')
   if name == 'conductance' :
     self.conductance = float(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'ionicSelectivity' :
     self.ionicSelectivity = float(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'Nw' :
     self.Nw = float(smds.strFromTxtNodes(c.childNodes))
     return True
   return False
Beispiel #9
0
 def interpretXMLvalue(self, c) :
   name = c.getAttribute('Name')
   if name == 'Avg_I' :
     self.avg_I = float(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'Length' :
     self.length = float(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'Counts' :
     d = smds.strFromTxtNodes(c.childNodes)
     self.counts = [ int(x) for x in d.split(', ') ]
     return True
   return False		# value not found
Beispiel #10
0
    def fromXML(n):
        """SEDH.fromXML(n) --> sedh

    Returns a new smds.Analysis.SEDH created from the xml.dom node n."""
        if n == None or n.tagName != "SEDH":
            return None
        r = SEDH(float(n.getAttribute("binWidth")), float(n.getAttribute("threshold")))
        d = smds.strFromTxtNodes(n.childNodes)
        d = re.sub("\r", "\n", d)
        d = re.sub("[ \t]", "", d)
        d = re.sub("\n{2,}", "\n", d)
        if d == "":
            data = []
        else:
            data = d.split("\n")
        if len(data) and data[0] == "":
            data = data[1:]
        if len(data) and data[-1] == "":
            data = data[:-1]
        if len(data):
            for (t, x) in [p.split(",") for p in data]:
                i = int(float(t) / r.binWidth + 0.5)
                if i >= len(r.data):
                    r.data += [0] * (i - len(r.data) + 1)
                r.data[i] = int(x)
        return r
Beispiel #11
0
    def fromXML(n, r=None):
        """ACF.fromXML(n) --> acf

    Returns a new smds.Analysis.ACF created from the xml.dom node n."""
        if n == None or (n.tagName != "ACF" and r == None):
            return None
        from numpy import asarray

        if r == None:
            r = ACF()
        d = smds.strFromTxtNodes(n.childNodes)
        d = re.sub("\r", "\n", d)
        d = re.sub("[ \t]", "", d)
        d = re.sub("\n{2,}", "\n", d)
        if d == "":
            data = []
        else:
            data = d.split("\n")
        if len(data) and data[0] == "":
            data = data[1:]
        if len(data) and data[-1] == "":
            data = data[:-1]
        if len(data):
            for (t, G) in [p.split(",") for p in data]:
                r.t.append(float(t))
                r.G.append(float(G))
        r.t = asarray(r.t)
        r.G = asarray(r.G)
        return r
Beispiel #12
0
 def interpretXMLvalue(self, c) :
   name = c.getAttribute('Name')
   if name == 'Hit Tape' :
     import re
     d = smds.strFromTxtNodes(c.childNodes)
     d = re.sub("\r", "\n", d) # replace linefeed with newline
     d = re.sub("[ \t]", '', d)    # remove all tabs
     d = re.sub("\n{2,}", "\n", d) # replace all repeating newlines with one
     if d == '' : data = []
     else :       data = d.split("\n")
     if len(data) and data[0] == '' : data = data[1:]
     if len(data) and data[-1] == '' : data = data[:-1]
     self.hitTape_t = []
     self.hitTape_x = []
     self.hitTape_y = []
     self.hitTape_z = []
     if len(data) :
       for (t, x, y, z) in [ p.split(",") for p in data ] :
         self.hitTape_t.append(float(t))
         self.hitTape_x.append(float(x))
         self.hitTape_y.append(float(y))
         self.hitTape_z.append(float(z))
     return True
   if name == 'Miss Tape' :
     import re
     d = smds.strFromTxtNodes(c.childNodes)
     d = re.sub("\r", "\n", d) # replace linefeed with newline
     d = re.sub("[ \t]", '', d)    # remove all tabs
     d = re.sub("\n{2,}", "\n", d) # replace all repeating newlines with one
     if d == '' : data = []
     else :       data = d.split("\n")
     if len(data) and data[0] == '' : data = data[1:]
     if len(data) and data[-1] == '' : data = data[:-1]
     self.missTape_t = []
     self.missTape_x = []
     self.missTape_y = []
     self.missTape_z = []
     if len(data) :
       for (t, x, y, z) in [ p.split(",") for p in data ] :
         self.missTape_t.append(float(t))
         self.missTape_x.append(float(x))
         self.missTape_y.append(float(y))
         self.missTape_z.append(float(z))
     return True
   return False		# value not found
Beispiel #13
0
 def interpretXMLvalue(self, c) :
   name = c.getAttribute('Name')
   if name == 'video_framerate' :
     self.video_framerate = float(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'video_Nx' :
     self.video_Nx = int(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'video_Ny' :
     self.video_Ny = int(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'video_sizeX' :
     self.video_sizeX = int(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'video_sizeY' :
     self.video_sizeY = int(smds.strFromTxtNodes(c.childNodes))
     return True
   return False		# value not found
Beispiel #14
0
 def fromXML(n) :
   """Returns a new smds.Task.RTR created from the xml.dom node n."""
   if (n == None or n.tagName != 'RTR') : return None
   r = RTR()
   d = re.findall("\d+", smds.strFromTxtNodes(n.childNodes))
   r.data = numpy.zeros(len(d), numpy.int16)
   for i in range(len(d)) :
     r.data[i] = int(d[i])
   return r
Beispiel #15
0
    def fromXML(n):
        """IPCH.fromXML(n) --> ipch

    Returns a new smds.Analysis.PCH created from the xml.dom node n."""
        r = IPCH(float(n.getAttribute("threshold")), float(n.getAttribute("binWidth")))
        d = smds.strFromTxtNodes(n.childNodes)
        d = re.sub("\r", "\n", d)
        d = re.sub("[ \t]", "", d)
        d = re.sub("\n{2,}", "\n", d)
        if d == "":
            data = []
        else:
            data = d.split("\n")
        if len(data) and data[0] == "":
            data = data[1:]
        if len(data) and data[-1] == "":
            data = data[:-1]
        if len(data):
            for (t, x) in [p.split(",") for p in data]:
                i = int(t)
                if i >= len(r.data):
                    r.data += [0] * (i - len(r.data) + 1)
                r.data[i] = int(x)
        return r
Beispiel #16
0
 def interpretXMLvalue(self, c) :
   name = c.getAttribute('Name')
   if name == 'timeToMiss' :
     self.timeToMiss = float(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'initHeight' :
     self.initHeight = float(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'D' :
     self.D = float(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'capHeight' :
     self.capHeight = float(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'capWidth' :
     self.capWidth = float(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'channelRadius' :
     self.channelRadius = float(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'hitPoint' :
     self.hitPoint = float(smds.strFromTxtNodes(c.childNodes))
     return True
   return False
Beispiel #17
0
 def interpretXMLvalue(self, c) :
   if c.getAttribute('Name') == 'video' :
     d = smds.strFromTxtNodes(c.childNodes, True)
     self.video = loads(str(d))
     return True
Beispiel #18
0
 def interpretXMLvalue(self, c) :
   if c.getAttribute('Name') == 'Bleached' :
     d = smds.strFromTxtNodes(c.childNodes)
     self.counts = [ int(x) for x in d.split(', ') ]
     return True
   return False
Beispiel #19
0
 def interpretXMLvalue(self, c) :
   name = c.getAttribute('Name')
   if name == 'timeToMiss' :
     self.timeToMiss = float(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'D' :
     self.D = float(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'mobility' :
     self.mobility = float(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'capHeight' :
     self.capHeight = float(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'capWidth' :
     self.capWidth = float(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'channelRadius' :
     self.channelRadius = float(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'hitPoint' :
     self.hitPoint = float(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'vestibuleRadius' :
     self.vestibuleRadius = float(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'vestibuleHeight' :
     self.vestibuleHeight = float(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'vestibulePos' :
     self.vestibulePos = float(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'initHeight' :
     self.initHeight = float(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'offset' :
     self.offset = float(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'potExtent' :
     self.potExtent = float(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'potA' :
     self.potA = float(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'potB' :
     self.potB = float(smds.strFromTxtNodes(c.childNodes))
     return True
   if name == 'potC' :
     self.potC = float(smds.strFromTxtNodes(c.childNodes))
     return True
   return False
Beispiel #20
0
 def interpretXMLvalue(self, c) :
   name = c.getAttribute('Name')
   if name == 'particleRadius' :
     self.particleRadius = float(smds.strFromTxtNodes(c.childNodes))
     return True
   return False