Hi Curtis -The whole script is rather long. Here are the relevant bits, but if you actually want the whole script, I can post it.# Early in script, define hydrology layers, global variables - this code has been used and re-used for years and worked fine on all Arc versions
outputws = gp.workspace + os.sep + "Output" + os.sep
Hydrows = outputws + "Hydro_layers" + os.sep
if not gp.exists(Hydrows + "flow_dir"):
# Create flow direction raster
gp.FlowDirection_sa(DEM, Hydrows + "flow_dir", "NORMAL")
flow_dir = Hydrows + "flow_dir"
if not gp.exists(Hydrows + "flow_acc"):
# Create flow accumulation raster
gp.FlowAccumulation_sa(Hydrows + "flow_dir", Hydrows + "flow_acc", "", "FLOAT")
flow_acc = Hydrows + "flow_acc"
# Later, set flow direction raster to null where there are streams
def define_channels():
try:
gp.AddMessage("\nDefining flow direction channels...")
exp = "\"VALUE\" > " + str(int(threshold_flowacc))
# THIS IS WHERE THE ERROR OCCURS
gp.SetNull_sa(flow_acc, flow_dir, flowdir_channels, exp)
# ALTO TRIED THIS
gp.SingleOutputMapAlgebra_sa("CON(" + flow_acc + " <= " + threshold_flowacc + ", " + flow_dir, ")", flowdir_channels)
except:
gp.AddError ("\nError defining flow direction channels: " + gp.GetMessages(2))
raise Exception
I tried taking this out of a function and putting it into the main body of code, hard-coding the path as a string, using one of the script inputs in place of the generated flow_acc (for the heck of it), all produced the similar errors. Also tried fussing with inputting filename backslashes as either "\" or "\\", didn't help. When trying the CON code, the error is a bit different:ERROR 010394: Map Algebra expression: Syntax error at location 3 (around (G:\G) of expression CON(G:\GIS\scratch\tmp_rios_preproc2\Output\Hydro_layers\flow_acc <= 1100, G:\GIS\scratch\tmp_rios_preproc2\Output\Hydro_layers\flow_dir.Thanks for taking a look at it...~ Stacie