Unable to save a 3 dimensional array to stacked raster .img file.
I have this array:
arr.shape (10, 148, 160)
Now when I try to save this into raster .img format:
out_ras = arcpy.NumPyArrayToRaster(arr)
out_ras.save(r"C:\Users\Gurminder\Documents\study\IWMI\HomeTools\Dump\Converted_arr\stack.img")
I get the following error:
Runtime error Traceback (most recent call last): File "<string>", line 1, in <module> RuntimeError:
ERROR 010240: Could not save raster dataset to C:\Users\Gurminder\Documents\study\IWMI\HomeTools\Dump\
Converted_arr\stack.img with output format IMAGINE Image.
Although a file named stack.img is created in the given directory but all it contains is garbage values.
I have been facing this issue since I have upgraded from ArcMap 10.3 to 10.4, before upgrade everything was working just fine.