-# Copyright 2007,2008 Free Software Foundation, Inc.
+# Copyright 2007,2008,2011 Free Software Foundation, Inc.
def get_data(self, hfile):
self.text_file_pos.set_text("File Position: %d" % (hfile.tell()//self.sizeof_data))
def get_data(self, hfile):
self.text_file_pos.set_text("File Position: %d" % (hfile.tell()//self.sizeof_data))
- f = scipy.fromfile(hfile, dtype=self.datatype, count=self.block_length)
- #print "Read in %d items" % len(self.f)
- if(len(f) == 0):
+ try:
+ f = scipy.fromfile(hfile, dtype=self.datatype, count=self.block_length)
+ except MemoryError:
def make_plots(self):
self.sp_f = self.fig.add_subplot(2,1,1, position=[0.075, 0.2, 0.875, 0.6])
def make_plots(self):
self.sp_f = self.fig.add_subplot(2,1,1, position=[0.075, 0.2, 0.875, 0.6])
# Subplot for real and imaginary parts of signal
self.plot_f += plot(self.time, self.f, 'o-')
# Subplot for real and imaginary parts of signal
self.plot_f += plot(self.time, self.f, 'o-')
- maxval = max(maxval, max(self.f))
- minval = min(minval, min(self.f))
+ maxval = max(maxval, self.f.max())
+ minval = min(minval, self.f.min())
for hf,p in zip(self.hfile,self.plot_f):
self.get_data(hf)
p.set_data([self.time, self.f])
for hf,p in zip(self.hfile,self.plot_f):
self.get_data(hf)
p.set_data([self.time, self.f])
- maxval = max(maxval, max(self.f))
- minval = min(minval, min(self.f))
+ maxval = max(maxval, self.f.max())
+ minval = min(minval, self.f.min())