Hi, I'm trying to create a custom Single Output Map Algebra script so that I can have my user input values to run a model in Model Builder. As of now, I cannot find a way to connect SOMA to a variable in Model Builder, and saw no answer on a thread on that subject. Therefore I turned to python, but I am fairly new with python, so I was hoping someone could spot the error I've made in creating this script.
import sys, string, os, arcgisscripting
gp = arcgisscripting.create(9.3)
gp.overwriteoutput = 1
msgNotEnoughParams = 'Incorrect number of input parameters.'
if len(sys.argv) < 1: raise Exception, msgNotEnoughParams
DEMraster = gp.GetParameterasText(0)
inputValue1 = gp.GetParameterasText(1)
inputValue2 = gp.GetParameterasText(2)
inputValue3 = gp.GetParameterasText(3)
outputRaster = gp.GetParameterasText(4)
xmap = gp.GetParameterasText(5)
ymap = gp.GetParameterasText(6)
gp.SingleOutputMapAlgebra_sa("ATan((" + inputValue3 + " - " + DEMraster + ") // ( sqrt(sqr(" + inputValue1 + " - " + xmap + ") + sqr(" + inputValue2 + " - " + ymap + "))))")
I'm currently getting this error:<class 'arcgisscripting.ExecuteError'>: Failed to execute. Parameters are not valid.ERROR 000859: The required parameter Output raster is empty, or is not the type of Raster Dataset.Failed to execute (SingleOutputMapAlgebra).Failed to execute (CustomMapAlgebra).Any help on why this is happening would be much appreciated!