[gdal-dev] Problems exporting numPY array to float Geotiff using OSGEO gdal python bindings

Christopher Barker Chris.Barker at noaa.gov
Wed Mar 2 16:08:44 EST 2011


On 3/2/11 8:49 AM, William Hudspeth wrote:

> Geotiff/Float32 image. While the script exports an image, all pixel
...
> My python code for the export is:
>
> floatNumPyArray=floatNumPyArray(numpy.float)

I don't know if this is your problem, but numpy.float is a 64 bitfloat, 
you might try numpy.float32

Also, that call doesn't look right, do you want?

floatNumPyArray=floatNumPyArray.astype(numpy.float32)

That will convert a numpy array to the float32 type.

HTH,

-Chris




-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov


More information about the gdal-dev mailing list