ivoflipse / Pawlabeling

Tool for processing and analyzing pressure measurements
Other
18 stars 1 forks source link

Try reading in the data using numpy.fromstring #127

Closed ivoflipse closed 10 years ago

ivoflipse commented 10 years ago

Someone pointed out to me at a Python meeting that I should try using numpy.fromstring when loading my data instead of casting a list of lists to a numpy array.

Also, it might be worth checking out whether I'm not being uber-wasteful with my memory usage, using 32 bit floats for something that's probably not even 12 bits.

http://docs.scipy.org/doc/numpy/reference/generated/numpy.fromstring.html

ivoflipse commented 10 years ago

At least for RSscan I changed this to use:

frame_string = StringIO("\n".join(lines[start+1:stop-1]))
result[:, :, frame] = np.loadtxt(frame_string, dtype=np.float32)

So I'm assuming this is closed