CSV methodology

Peter Otten __peter__ at web.de
Tue Sep 16 07:22:02 EDT 2014


jayte wrote:

> On Mon, 15 Sep 2014 09:29:02 +0200, Peter Otten <__peter__ at web.de> wrote:
> 
>>jayte wrote:
>>
>>> Sorry, I neglected to mention the values' significance.  The MXP program
>>> uses the "distance estimate" algorithm in its fractal data generation.
>>> The values are thus, for each point in a 1778 x 1000 image:
>>> 
>>> Distance,   (an extended double)
>>> Iterations,  (a 16 bit int)
>>> zc_x,        (a 16 bit int)
>>> zc_y         (a 16 bit int)
>>> 
>>
>>Probably a bit too early in your "Python career",
> 
> Absolutely, just thought it would be interesting to start experimenting,
> while learning (plus, can't help but be anxious) <g>
> 
>> but you can read raw data
>>with numpy. Something like
>>
>>with open(filename, "rb") as f:
>>    a = numpy.fromfile(f, dtype=[
>>        ("distance", "f16"),
>>        ("iterations", "i2"),
>>        ("zc_x", "i2"),
>>        ("zc_y", "i2"),
>>    ]).reshape(1778, 1000)
>>
>>might do, assuming "extended double" takes 16 bytes.
> 
> Will try.  Double extended precision is ten bytes, but I assume
> changing  the "f16" to "f10" would account for that...

Unfortunately it seems that numpy doesn't support "f10" 

>>> numpy.dtype("f8")
dtype('float64')
>>> numpy.dtype("f16")
dtype('float128')
>>> numpy.dtype("f10")
dtype('float32') # looks strange to me

But you better ask for confirmation (and possible workarounds) in a 
specialist forum.




More information about the Python-list mailing list