# HG changeset patch # User Iannis # Date 1342435053 -7200 # Node ID b11082bfcb4a116101e8ba6097db92b8d4ae2a77 # Parent 82b144ee09b2e199d2709fa5c010f26d0bd27aac Changed file reading mode to 'rb' diff -r 82b144ee09b2 -r b11082bfcb4a licel.py --- a/licel.py Thu May 24 15:43:33 2012 +0200 +++ b/licel.py Mon Jul 16 12:37:33 2012 +0200 @@ -30,7 +30,7 @@ channels = {} channel_info = [] - f = open(filename, 'r') + f = open(filename, 'rb') #Read the first 3 lines of the header raw_info = {} @@ -57,6 +57,7 @@ raw_data = np.fromfile(f, 'l', int(current_channel_info['DataPoints'])) a = np.fromfile(f, 'b', 1) b = np.fromfile(f, 'b', 1) + if (a[0] != 13) | (b[0] != 10): print "Warning: No end of line found after record. File could be corrupt" channel = LicelFileChannel(current_channel_info, raw_data)