[Numpy-discussion] numarray: need Float32 abs from array of type na.Complex64 or na.Complex32
haase at msg.ucsf.edu
Wed Mar 1 18:14:02 CST 2006
I just was hunting a very strange bug: I got weird results .... anyway.
I found that I was using this line of code:
if img.type() in (na.Complex64, na.Complex32):
img = abs(na.asarray(img, na.Float32))
Now I don't understand how this code worked at all ? But I only saw those
"weird results" after looking at the "dimmest corners" in my image and
otherwise all images looked O.K.
The goal here was to get a single precision absolute for either a complex64 or
complex32 valued image array WITHOUT creating a temporary array.
My thinking was that:
img = na.abs( na.asarray(img, na.Complex32) )
would create a complete temporary version of img starts out being Complex64
Is this really the case ?
Thanks for any hints,
More information about the Numpy-discussion