|
@@ -18,11 +18,11 @@ def layout_to_dtype(layout): |
|
|
ltype = layout.split('_')[0] |
|
|
ltype = layout.split('_')[0] |
|
|
lcount = int(layout.split('_')[1]) |
|
|
lcount = int(layout.split('_')[1]) |
|
|
if ltype.startswith('int'): |
|
|
if ltype.startswith('int'): |
|
|
atype = '<i' + str(int(ltype[3:]) / 8) |
|
|
|
|
|
|
|
|
atype = '<i' + str(int(ltype[3:]) // 8) |
|
|
elif ltype.startswith('uint'): |
|
|
elif ltype.startswith('uint'): |
|
|
atype = '<u' + str(int(ltype[4:]) / 8) |
|
|
|
|
|
|
|
|
atype = '<u' + str(int(ltype[4:]) // 8) |
|
|
elif ltype.startswith('float'): |
|
|
elif ltype.startswith('float'): |
|
|
atype = '<f' + str(int(ltype[5:]) / 8) |
|
|
|
|
|
|
|
|
atype = '<f' + str(int(ltype[5:]) // 8) |
|
|
else: |
|
|
else: |
|
|
raise ValueError("bad layout") |
|
|
raise ValueError("bad layout") |
|
|
return numpy.dtype([('timestamp', '<i8'), ('data', atype, lcount)]) |
|
|
return numpy.dtype([('timestamp', '<i8'), ('data', atype, lcount)]) |
|
|