Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Thanks Everyone,

I fixed it. The problem was the Out file name in get_data() function:

class ChannelData: def init(self, fileName): self.timeChannelName = 'time'

temp = dyntools.outextractdata(fileName)

    temp0 = dyntools.CHNF(fileName , outvrsn = 1)
    (short_title, chanid, chandata) = temp0.get_data()

    temp = [short_title, dict(), dict()]
    temp[1] = dict(chanid).copy()
    temp[2] = dict(chandata).copy()

    self.fileName = os.path.abspath(fileName)

    self.titles = short_title.split("\n")
    self.channelNameRef = dict(chanid).copy()
    del self.channelNameRef[self.timeChannelName]
    self.channelByName = dict([(self.channelNameRef[name], name) for name in self.channelNameRef.keys()])
    self.channelData = dict()
    self.n = len(temp[2][self.timeChannelName])
    for cn in self.channelNameRef.keys():
        values = temp[2][cn]
        assert(self.n == len(values))
        x = numpy.array(values)
        if (numpy.isnan(x).any()): 
            raise Exception('NaN in channel %s' % cn)
        self.channelData[cn] = x
    self.time = numpy.array(temp[2][self.timeChannelName])

def getTime(self):
    return self.time

def readChannel(self, channelName):
    k = self.channelByName[channelName]
    return self.channelData[k]

def hasChannel(self, channelName):
    return self.channelByName.has_key(channelName)

Thanks Everyone,

Everyone, I fixed it. The problem was the Out file name in get_data() function:

class ChannelData: def init(self, fileName): self.timeChannelName = 'time'

temp = dyntools.outextractdata(fileName)

    temp0 = dyntools.CHNF(fileName , outvrsn = 1)
    (short_title, chanid, chandata) = temp0.get_data()

    temp = [short_title, dict(), dict()]
    temp[1] = dict(chanid).copy()
    temp[2] = dict(chandata).copy()

    self.fileName = os.path.abspath(fileName)

    self.titles = short_title.split("\n")
    self.channelNameRef = dict(chanid).copy()
    del self.channelNameRef[self.timeChannelName]
    self.channelByName = dict([(self.channelNameRef[name], name) for name in self.channelNameRef.keys()])
    self.channelData = dict()
    self.n = len(temp[2][self.timeChannelName])
    for cn in self.channelNameRef.keys():
        values = temp[2][cn]
        assert(self.n == len(values))
        x = numpy.array(values)
        if (numpy.isnan(x).any()): 
            raise Exception('NaN in channel %s' % cn)
        self.channelData[cn] = x
    self.time = numpy.array(temp[2][self.timeChannelName])

def getTime(self):
    return self.time

def readChannel(self, channelName):
    k = self.channelByName[channelName]
    return self.channelData[k]

def hasChannel(self, channelName):
    return self.channelByName.has_key(channelName)

Thanks Everyone, I fixed it. The problem was the Out file name in get_data() function:

function: class ChannelData: def init(self, fileName): self.timeChannelName = 'time'

temp = dyntools.outextractdata(fileName)

    temp0 = dyntools.CHNF(fileName , outvrsn = 1)
    (short_title, chanid, chandata) = temp0.get_data()
     temp = [short_title, dict(), dict()]
    temp[1] = dict(chanid).copy()
    temp[2] = dict(chandata).copy()
     self.fileName = os.path.abspath(fileName)
     self.titles = short_title.split("\n")
    self.channelNameRef = dict(chanid).copy()
    del self.channelNameRef[self.timeChannelName]
    self.channelByName = dict([(self.channelNameRef[name], name) for name in self.channelNameRef.keys()])
    self.channelData = dict()
    self.n = len(temp[2][self.timeChannelName])
    for cn in self.channelNameRef.keys():
        values = temp[2][cn]
        assert(self.n == len(values))
        x = numpy.array(values)
        if (numpy.isnan(x).any()): 
            raise Exception('NaN in channel %s' % cn)
        self.channelData[cn] = x
    self.time = numpy.array(temp[2][self.timeChannelName])
 def getTime(self):
    return self.time
 def readChannel(self, channelName):
    k = self.channelByName[channelName]
    return self.channelData[k]

def hasChannel(self, channelName):
    return self.channelByName.has_key(channelName)

Thanks Everyone, I fixed it. The problem was the Out file name in get_data() getdata() function: class ChannelData: def init(self, fileName): self.timeChannelName = 'time'

temp = dyntools.outextractdata(fileName)

'time'
        temp0 = dyntools.CHNF(fileName , outvrsn = 1)
    (short_title,     (shorttitle, chanid, chandata) = temp0.get_data()
temp0.getdata()
        temp = [short_title, [shorttitle, dict(), dict()]
     temp[1] = dict(chanid).copy()
     temp[2] = dict(chandata).copy()
     self.fileName = os.path.abspath(fileName)
     self.titles = short_title.split("\n")
     self.channelNameRef = dict(chanid).copy()
     del self.channelNameRef[self.timeChannelName]
     self.channelByName = dict([(self.channelNameRef[name], name) for name in self.channelNameRef.keys()])
     self.channelData = dict()
     self.n = len(temp[2][self.timeChannelName])
     for cn in self.channelNameRef.keys():
         values = temp[2][cn]
         assert(self.n == len(values))
         x = numpy.array(values)
         if (numpy.isnan(x).any()): 
             raise Exception('NaN in channel %s' % cn)
         self.channelData[cn] = x
     self.time = numpy.array(temp[2][self.timeChannelName])
 def getTime(self):
     return self.time
 def readChannel(self, channelName):
     k = self.channelByName[channelName]
     return self.channelData[k]
self.channelData[k]

Thanks Everyone, I fixed it. The problem was the Out file name in getdata() function: get_data() function:

class ChannelData: def init(self, fileName): self.timeChannelName = 'time' temp0 = dyntools.CHNF(fileName , outvrsn = 1) (shorttitle, chanid, chandata) = temp0.getdata() temp = [shortdata() temp = [shorttitle, dict(), dict()] temp[1] = dict(chanid).copy() temp[2] = dict(chandata).copy() self.fileName = os.path.abspath(fileName) self.titles = short_title.split("\n") shorttitle.split("\n") self.channelNameRef = dict(chanid).copy() del self.channelNameRef[self.timeChannelName] self.channelByName = dict([(self.channelNameRef[name], name) for name in self.channelNameRef.keys()]) self.channelData = dict() self.n = len(temp[2][self.timeChannelName]) for cn in self.channelNameRef.keys(): values = temp[2][cn] assert(self.n == len(values)) x = numpy.array(values) if (numpy.isnan(x).any()): raise Exception('NaN in channel %s' % cn) self.channelData[cn] = x self.time = numpy.array(temp[2][self.timeChannelName]) def getTime(self): return self.time def readChannel(self, channelName): k = self.channelByName[channelName] return self.channelData[k]

Thanks Everyone, I fixed it. The problem was the Out file name in get_data() function:

getdata() function: # class ChannelData: def init(self, fileName): self.timeChannelName = 'time' temp0 = dyntools.CHNF(fileName , outvrsn = 1) (shorttitle, chanid, chandata) = temp0.getdata() temp = [shortdata() temp = [shorttitle, dict(), dict()] temp[1] = dict(chanid).copy() temp[2] = dict(chandata).copy() self.fileName = os.path.abspath(fileName) self.titles = shorttitle.split("\n") short_title.split("\n") self.channelNameRef = dict(chanid).copy() del self.channelNameRef[self.timeChannelName] self.channelByName = dict([(self.channelNameRef[name], name) for name in self.channelNameRef.keys()]) self.channelData = dict() self.n = len(temp[2][self.timeChannelName]) for cn in self.channelNameRef.keys(): values = temp[2][cn] assert(self.n == len(values)) x = numpy.array(values) if (numpy.isnan(x).any()): raise Exception('NaN in channel %s' % cn) self.channelData[cn] = x self.time = numpy.array(temp[2][self.timeChannelName]) def getTime(self): return self.time def readChannel(self, channelName): k = self.channelByName[channelName] return self.channelData[k]

Thanks Everyone, I fixed it. The problem was the Out file name in getdata() function: # get_data() function:

class ChannelData: def init(self, fileName): self.timeChannelName = 'time' temp0 = dyntools.CHNF(fileName , outvrsn = 1) (shorttitle, chanid, chandata) = temp0.getdata() temp = [shortdata() temp = [shorttitle, dict(), dict()] temp[1] = dict(chanid).copy() temp[2] = dict(chandata).copy() self.fileName = os.path.abspath(fileName) self.titles = short_title.split("\n") shorttitle.split("\n") self.channelNameRef = dict(chanid).copy() del self.channelNameRef[self.timeChannelName] self.channelByName = dict([(self.channelNameRef[name], name) for name in self.channelNameRef.keys()]) self.channelData = dict() self.n = len(temp[2][self.timeChannelName]) for cn in self.channelNameRef.keys(): values = temp[2][cn] assert(self.n == len(values)) x = numpy.array(values) if (numpy.isnan(x).any()): raise Exception('NaN in channel %s' % cn) self.channelData[cn] = x self.time = numpy.array(temp[2][self.timeChannelName]) def getTime(self): return self.time def readChannel(self, channelName): k = self.channelByName[channelName] return self.channelData[k]

Thanks Everyone, I fixed it. The problem was the Out file name in get_data() function:

class ChannelData: def init(self, fileName): self.timeChannelName = 'time' temp0 = dyntools.CHNF(fileName , outvrsn = 1) (shorttitle, chanid, chandata) = temp0.getdata() temp = [shorttitle, dict(), dict()] temp[1] = dict(chanid).copy() temp[2] = dict(chandata).copy() self.fileName = os.path.abspath(fileName) self.titles = shorttitle.split("\n") self.channelNameRef = dict(chanid).copy() del self.channelNameRef[self.timeChannelName] self.channelByName = dict([(self.channelNameRef[name], name) for name in self.channelNameRef.keys()]) self.channelData = dict() self.n = len(temp[2][self.timeChannelName]) for cn in self.channelNameRef.keys(): values = temp[2][cn] assert(self.n == len(values)) x = numpy.array(values) if (numpy.isnan(x).any()): raise Exception('NaN in channel %s' % cn) self.channelData[cn] = x self.time = numpy.array(temp[2][self.timeChannelName]) def getTime(self): return self.time def readChannel(self, channelName): k = self.channelByName[channelName] return self.channelData[k]

Thanks Everyone, I fixed it. The problem was the Out file name in get_data() function:

class |class ChannelData: | def init(self, fileName): | self.timeChannelName = 'time' | temp0 = dyntools.CHNF(fileName , outvrsn = 1) | (shorttitle, chanid, chandata) = temp0.getdata() | temp = [shorttitle, dict(), dict()] | temp[1] = dict(chanid).copy() | temp[2] = dict(chandata).copy() | self.fileName = os.path.abspath(fileName) | self.titles = shorttitle.split("\n") | self.channelNameRef = dict(chanid).copy() | del self.channelNameRef[self.timeChannelName] | self.channelByName = dict([(self.channelNameRef[name], name) for name in self.channelNameRef.keys()]) | self.channelData = dict() | self.n = len(temp[2][self.timeChannelName]) | for cn in self.channelNameRef.keys(): | values = temp[2][cn] | assert(self.n == len(values)) | x = numpy.array(values) | if (numpy.isnan(x).any()): | raise Exception('NaN in channel %s' % cn) | self.channelData[cn] = x | self.time = numpy.array(temp[2][self.timeChannelName]) | def getTime(self): | return self.time | def readChannel(self, channelName): | k = self.channelByName[channelName] | return self.channelData[k]self.channelData[k] |

Thanks Everyone, I fixed it. The problem was the Out file name in get_data() function:

|class ChannelData: | class ChannelData:

def init(self, __init__(self, fileName):
|       self.timeChannelName = 'time'
|       temp0 = dyntools.CHNF(fileName , outvrsn = 1)
|       (shorttitle,     (short_title, chanid, chandata) = temp0.getdata()
|   temp0.get_data()
    temp = [shorttitle, [short_title, dict(), dict()]
|       temp[1] = dict(chanid).copy()
|       temp[2] = dict(chandata).copy()
|       self.fileName = os.path.abspath(fileName)
|       self.titles = shorttitle.split("\n")
|   short_title.split("\n")
    self.channelNameRef = dict(chanid).copy()
|       del self.channelNameRef[self.timeChannelName]
|       self.channelByName = dict([(self.channelNameRef[name], name) for name in self.channelNameRef.keys()])
|       self.channelData = dict()
|       self.n = len(temp[2][self.timeChannelName])
|       for cn in self.channelNameRef.keys():
|           values = temp[2][cn]
|           assert(self.n == len(values))
|           x = numpy.array(values)
|           if (numpy.isnan(x).any()): 
|               raise Exception('NaN in channel %s' % cn)
|           self.channelData[cn] = x
|       self.time = numpy.array(temp[2][self.timeChannelName])
|   def getTime(self):
|       return self.time
|   def readChannel(self, channelName):
|       k = self.channelByName[channelName]
|       return self.channelData[k]
|