matoretta

why my IsNull function is not working???

Discussion created by matoretta on Nov 16, 2011
Latest reply on Feb 3, 2012 by michalis
hi i have this piece of code
import arcpy
from arcpy.sa import *

arcpy.CheckOutExtension("spatial")
arcpy.env.overwriteOutput = True

# Get input parameters
inDEM = arcpy.GetParameterAsText(0)
inStream = arcpy.GetParameterAsText(1)
inMinSlope = float(arcpy.GetParameterAsText(2))
outSlope = arcpy.GetParameterAsText(3)


pDEM = Raster(inDEM)


arcpy.env.snapRaster =  inDEM
arcpy.env.extent = inDEM
arcpy.env.mask = inStream # mask for Stream only
arcpy.env.cellSize = inDEM

pSlopeStr = Slope(pDEM,"PERCENT_RISE")
arcpy.env.mask = inDEM # mask for whole DEM
##
pSlopeDEM = Slope(pDEM,"PERCENT_RISE")
pIsNull = IsNull(pSlopeStr)   #****ERROR
print(str(pIsNull.format))
##pSlope = Con(pIsNull==1,pSlopeDEM,pSlopeStr)
##pSlopeOK = Con(pSlope < inMinSlope,inMinSlope,pSlope)
pIsNull.save('C:\\aaaa4')
pSlopeStr.save('C:\\aaaa5')

##del pSlopeStr
##del pSlopeDEM
##del pSlopeOK


i use IsNull function whit my temporary raster, but result is NOTHING (NULL). When I use nontemporary raster everything is OK.. do anobody know where is a problem??? thanks a lot

Outcomes