Hi I am very new to python coding and have been struggling with this for a while I cannot see the reason for this error! Any help will be greatly appreciated.
Here is the code that is causing this error:
import arcpy
import numpy as np
import math
from arcpy.sa import *
# Input DEM
input_raster = arcpy.GetParameterAsText(0)
# Output
output_raster = arcpy.GetParameterAsText(1)
# Input Discharge
mean_discharge = float(arcpy.GetParameterAsText(2))
# Input number of timesteps
input_timestep = int(arcpy.GetParameterAsText(3))
arcpy.overwriteOutput = True
arcpy.env.workspace = r"C:\SedMod\SedMod\Workspace.gdb"
arcpy.env.scratchWorkspace = r"C:\SedMod\SedMod\Workspace.gdb"
actual_timestep = 0
while actual_timestep < input_timestep:
# Slope calculation
# Set local variables
out_measurement = "PERCENT_RISE"
# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")
#Execute Slope
out_slope = Slope(input_raster, out_measurement)
# Convert to gradient
slope_raster = out_slope / 100
input_raster = slope_raster
actual_timestep = actual_timestep + 1
new_elevation.save(output_raster)
There is a lot of code I have taken out that does some more geoprocessing which then alters the DEM to go back into the calculation.
The error I am getting is:
Traceback (most recent call last): File "C:\SedMod\SedMod\Slope1.py", line 47, in out_slope = Slope(input_raster, out_measurement, ) File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\sa\Functions.py", line 5523, in Slope z_factor) File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\sa\Utils.py", line 47, in swapper result = wrapper(*args, **kwargs) File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\sa\Functions.py", line 5518, in wrapper z_factor) File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\geoprocessing_base.py", line 498, in return lambda *args: val(*gp_fixargs(args, True)) RuntimeError: ERROR 010240: Could not save raster dataset to C:\SedMod\SedMod\Workspace.gdb\numpy_ras6 with output format FGDBR.
Failed to execute (SedModv1).