Hello,
I tried the following:
### start code
a = N.random.rand(100)
myFile = file('test.bin', 'wb')
for i in range(100):
a.tofile(myFile)
myFile.close()
### end code
And this gives roughly 50 MB/s on my office-machine but only 6.5 MB/s on
the machine that I was
On 7/25/07, Lars Friedrich [EMAIL PROTECTED] wrote:
Hello,
I tried the following:
### start code
a = N.random.rand(100)
myFile = file('test.bin', 'wb')
for i in range(100):
a.tofile(myFile)
myFile.close()
### end code
And this gives roughly 50 MB/s on my
Hello everyone,
thank you for the replies.
Sebastian, the chunk size is roughly 4*10^6 samples, with two byte per
sample, this is about 8MB. I can vary this size, but increasing it only
helps for much smaller values. For example, when I use a size of 100
Samples, I am much too slow. It gets
So you are saying that a given tofile() call returns only after 2 seconds !?
Can you measure the getData() call time (just comment the tofile out
for a while- I that doesn't use 100% CPU ..) ? (timeit module is
needed - I think)
Maybe multithreading might help - so that tofile() and GetData()
Your are not generating text files - right?
On 7/24/07, Sebastian Haase [EMAIL PROTECTED] wrote:
So you are saying that a given tofile() call returns only after 2 seconds !?
Can you measure the getData() call time (just comment the tofile out
for a while- I that doesn't use 100% CPU ..) ?
Hello everyone,
I am using array.tofile successfully for a data-acqusition-streaming
application. I mean that I do the following:
for a long time:
temp = dataAcquisisionDevice.getData()
temp.tofile(myDataFile)
temp is a numpy array that is used for storing the data temporarily.
Just a guess out of my hat:
there might be a buffer class in the standard python library... I'm
thinking of a class that implements file-I/O and collects input up to
a maximum buffer size before it copies the same byte stream to it's
output. Since I/O is more efficient if larger chunks are written
On 7/23/07, Lars Friedrich [EMAIL PROTECTED] wrote:
Hello everyone,
I am using array.tofile successfully for a data-acqusition-streaming
application. I mean that I do the following:
for a long time:
temp = dataAcquisisionDevice.getData()
temp.tofile(myDataFile)
temp is a