AnsweredAssumed Answered

Python syntax error in Raster Calculator, "Not" or "!" ?

Question asked by jpolo on Nov 30, 2015
Latest reply on Dec 2, 2015 by iamurray

I want to erase part of an existing raster I call ecoregion. I saw these instructions in an old forum post that tell how to do what I want:



Convert the polygon to a raster and use IsNull/SetNull in the Raster Calculator, as in 

SetNull( Not IsNull( [PolyRaster] ), [MyRaster] )



I wrote in Raster Calculator


SetNull( Not IsNull("water3a"), "Ecoregion.tif")


and I get an error message

"Python syntax error: Parsing error

SyntaxError: invalid syntax (line 1)"


I don't know what is causing this error, because I don't know Python. I tried replacing "Not" with "!", but that didn't change the error. If I leave out the "Not", the command runs, but it doesn't give me the results I want, which is no surprise. I was just checking if maybe the problem had something to do with the "Not", which maybe it does. I guess there is a Python command I am supposed to use instead of "Not"?