I'm trying to write ENVI CFloat64 files with GDAL:
import numpy
from osgeo import gdal
from osgeo.gdalconst import GDT_CFloat64
a = numpy.zeros((1000, 1000), dtype='complex64')
driver = gdal.GetDriverByName("ENVI")
outfile = driver.Create("test.bin", 1000, 1000, 1, GDT_CFloat64)
outfile.GetRasterBand(1).WriteArray(a, 0, 0)
outfile = None
but I can't write the array to the band in outfile.GetRasterBand(1).WriteArray(a, 0, 0)
because outfile
is None
; however, the empty file does get created. Any ideas what I am doing wrong?
EDIT: I should specify that I can read and write ENVI Float32 files, so the driver is there. Only CFloat64 that I can't write...