Re: how to convert 3 byte to float

2007-12-10 Thread Mario M. Mueller
Hendrik van Rooyen wrote: > "Mario M. Mueller" <[EMAIL PROTECTED]> wrote: > > >> I uploaded a short sample data file under >> http://www.FastShare.org/download/test.bin - maybe one can give me >> another hint... In a full data example max value is 1179760 (in case one >> looks only at the eye-ca

Re: how to convert 3 byte to float

2007-12-10 Thread Mario M. Mueller
[EMAIL PROTECTED] wrote: [...] >> But I'm experiencing some strange jumps in the data (seismic data is >> mostly quite smooth at 40 Hz sampling rate). I think I did some mistake >> in the byte order... > > Probably. In your code sample, when you pad it to 32-bits, why are you > inserting every thi

Re: how to convert 3 byte to float

2007-12-09 Thread Hendrik van Rooyen
"Mario M. Mueller" <[EMAIL PROTECTED]> wrote: > I uploaded a short sample data file under > http://www.FastShare.org/download/test.bin - maybe one can give me another > hint... In a full data example max value is 1179760 (in case one looks only > at the eye-cathing "65535"+- values). I clicked

Re: how to convert 3 byte to float

2007-12-09 Thread John Machin
On Dec 10, 3:40 am, [EMAIL PROTECTED] wrote: > Mario M. Mueller napisa³(a): > > > Personally I would expect simple counts (since other seismic formats don't > > even think of using floats because most digitizers deliver counts). But I > > was told that there are floats inside. > > > But if I assume

Re: how to convert 3 byte to float

2007-12-09 Thread marek . rocki
Mario M. Mueller napisał(a): > Personally I would expect simple counts (since other seismic formats don't > even think of using floats because most digitizers deliver counts). But I > was told that there are floats inside. > > But if I assume counts I get some reasonable numbers out of the file. I

Re: how to convert 3 byte to float

2007-12-09 Thread Mario M. Mueller
Hendrik van Rooyen schrieb: [...] > What is it digitising - if its an Analogue to Digital converter, then the > 24 bits may not be floats at all, but simple integer counts. Personally I would expect simple counts (since other seismic formats don't even think of using floats because most digitizer

Re: how to convert 3 byte to float

2007-12-08 Thread Tim Roberts
"Mario M. Mueller" <[EMAIL PROTECTED]> wrote: >Bjoern Schliessmann wrote: > >[...] >> BTW, who in his mind designs three byte floats? Memory isn't that >> expensive anymore. Even C bool is four bytes long. > >It's output of a digitizer (but not that old). I was also wondering about >the reason for

Re: how to convert 3 byte to float

2007-12-08 Thread Hendrik van Rooyen
"Tommy Nordgren" <[EMAIL PROTECTED]> wrote: > > On 8 dec 2007, at 12.52, Mario M. Mueller wrote: > > > Bjoern Schliessmann wrote: > > > > [...] > >> BTW, who in his mind designs three byte floats? Memory isn't that > >> expensive anymore. Even C bool is four bytes long. > > > > It's output of a di

Re: how to convert 3 byte to float

2007-12-08 Thread jdsahr
On Dec 8, 6:05 am, "Mario M. Mueller" <[EMAIL PROTECTED]> wrote: > Tommy Nordgren wrote: > > [...] > > > One thing to consider: It is possible that one of the bytes > > contributes bits to BOTH the mantissa and the exponent ; > > From todays point of view I cannot exclude this. > > > Do you know th

Re: how to convert 3 byte to float

2007-12-08 Thread Mario M. Mueller
Tommy Nordgren wrote: [...] > One thing to consider: It is possible that one of the bytes > contributes bits to BOTH the mantissa and the exponent ; >From todays point of view I cannot exclude this. > Do you know the relative > accurazy of the digitizer? Not yet. It's seismic data, that implie

Re: how to convert 3 byte to float

2007-12-08 Thread Tommy Nordgren
On 8 dec 2007, at 12.52, Mario M. Mueller wrote: > Bjoern Schliessmann wrote: > > [...] >> BTW, who in his mind designs three byte floats? Memory isn't that >> expensive anymore. Even C bool is four bytes long. > > It's output of a digitizer (but not that old). I was also wondering > about > th

Re: how to convert 3 byte to float

2007-12-08 Thread Tommy Nordgren
On 8 dec 2007, at 13.57, Bjoern Schliessmann wrote: > Mario M. Mueller wrote: > >> It's output of a digitizer (but not that old). I was also >> wondering about the reason for this limitation (maybe the design >> is ~20 years old). > > Uh, that's weird. Since Python cannot guess its format, you'll

Re: how to convert 3 byte to float

2007-12-08 Thread Bjoern Schliessmann
Mario M. Mueller wrote: > It's output of a digitizer (but not that old). I was also > wondering about the reason for this limitation (maybe the design > is ~20 years old). Uh, that's weird. Since Python cannot guess its format, you'll have to try it out. Why don't you try to let the device output

Re: how to convert 3 byte to float

2007-12-08 Thread Mario M. Mueller
Bjoern Schliessmann wrote: [...] > BTW, who in his mind designs three byte floats? Memory isn't that > expensive anymore. Even C bool is four bytes long. It's output of a digitizer (but not that old). I was also wondering about the reason for this limitation (maybe the design is ~20 years old).

Re: how to convert 3 byte to float

2007-12-08 Thread Mario M. Mueller
John Machin wrote: > On Dec 8, 9:34 pm, "Mario M. Mueller" <[EMAIL PROTECTED]> wrote: >> Hi, >> >> I have a binary file containing 3 byte float values (big endian). How can >> I read them into python? The struct module does not work, since it >> expects 4 byte floats. >> >> Any hints? >> >> Mario

Re: how to convert 3 byte to float

2007-12-08 Thread Bjoern Schliessmann
Mario M. Mueller wrote: > I have a binary file containing 3 byte float values (big endian). > How can I read them into python? The struct module does not work, > since it expects 4 byte floats. Since the module crystalball is still in development, you'll have to analyze your three byte float forma

Re: how to convert 3 byte to float

2007-12-08 Thread John Machin
On Dec 8, 9:34 pm, "Mario M. Mueller" <[EMAIL PROTECTED]> wrote: > Hi, > > I have a binary file containing 3 byte float values (big endian). How can I > read them into python? The struct module does not work, since it expects 4 > byte floats. > > Any hints? > > Mario What does a three-byte float l

how to convert 3 byte to float

2007-12-08 Thread Mario M. Mueller
Hi, I have a binary file containing 3 byte float values (big endian). How can I read them into python? The struct module does not work, since it expects 4 byte floats. Any hints? Mario -- http://mail.python.org/mailman/listinfo/python-list

how to convert 3 byte to float

2007-12-08 Thread Mario M. Mueller
Hi, I have a binary file containing 3 byte float values. How can I read them into python? The struct module does not work, since it expects 4 byte floats. Any hints? Mario -- http://mail.python.org/mailman/listinfo/python-list