get uniform binary data into array for further processing

Paul Rubin phr-n2001d at nightsong.com
Thu Oct 11 22:34:36 EDT 2001


chr_w at gmx.de writes:

> Hey, thanx for the quick response Paul :-)
> 
> Your suggestions sounds good (same idea I came up with). 
> 
> But I really get confused with the coding of this...  I should be
> fairly simple using the fromfile thingy of array but I just can't
> figure how to use it properly... :-( Would you mind to give me a
> 3/5line hint on this?
> 
> How is this module used ??? 

from array import array

a = array('d')  # for double precision
a.fromfile(1000)  # read 1000 numbers

> I have to admit that I#m not too familiar with python (just starting...
> 
> The performance issue: well I'm stuck with a 32bit intel
> machine... but the data is coming from a SGI of our climate
> guys. Maybe I can just do the transformation block by block to keep
> the memory consumption on the ground. Actually the main purpose is
> to reduce the amount of data. For instance create the mean
> temperature for a day out of the half-hour-temperaturevalues in the
> input-file etc. and write to a ascii file in a specified format
> (which serves as the input for another model).

Yes, it's best to do things in smaller chunks if you can.



More information about the Python-list mailing list