I'm just learning how to use arcpy scripting so this may seem rather basic, but I've searched all over to no avail.
I've tried numerous ways to do this, always receiving this error: "arcgisscripting.ExecuteError: ERROR 999999: Error executing function. Unsupported pixel type: Failed to execute MFD flow direction using arcpy."
Initially I was using a GRID input rather than TIFF, and was saving to a folder rather than GDB with .crf file extension after the output. I've then tried using a geodatabase (where file extensions aren't needed?) and still the same.
Am I missing something? I can run the tool in arcmap fine saving to the same file location with the .crf extension.
import arcpy
from arcpy import env
import arcpy.sa
from arcpy.sa import *
env.workspace = "G:/PhD/GIS_Data"
env.overwriteOutput = True
print arcpy.CheckOutExtension("Spatial")
arcpy.CreateFileGDB_management ("G:/PhD/GIS_Data", "NE_Grnlnd")
inraster = "TIFs/fillDEM_5m.tif"
outFlowDirection = arcpy.sa.FlowDirection(inraster, "FORCE", "", "MFD")
outFlowDirection.save("G:/PhD/GIS_Data/NE_Grnlnd/outflwdir1")
print "Completed Flow Direction"
and the alternate version resulting in the same error:
env.workspace = "G:\PhD\GIS_Data"
print arcpy.CheckOutExtension("Spatial")
inraster = "TIFs/fillDEM_5m.tif"
outFlowDirection= arcpy.sa.FlowDirection(inraster, "FORCE", "", "MFD")
outFlowDirection.save("G:/PhD/GIS_Data/outputs/outflwdir1.crf")
print "Completed Flow Direction"