I'm trying to calculate the twi from my area using LN((flowaccu+1)*900/Tan(sloperadian). My first result was wrong because my area is an endhoreic basin. So I made a flow accumulation raster based on a DEM where the collecting lake was cut out. This flow direction raster was true but the raster calculator refuses to do the last step. I refilled the lake in the flowaccu raster with the a slightly higer value than the original flowaccu raster (thus 40 000 000) so that there are no holes (NO more NoData values) and both the sloperadian raster and flowaccu raster are in the same projected coordinate system (WGS84 mercator auxilary sphere).I'm working in ArcMap 10.2 and also tried on 10.4 but the error message stays the same.


enter image description here

ERROR 000539: Error runing expression: rcexec() Traceback (post recent call last)

2 Answers 2


This error states that you exported a Model Builder model to Python and your model included a raster calculator function. The raster calculator is only available as a geoprocessing tool. You will need to reformat your code using a Python IDE and other spatial analyst tools. https://support.esri.com/en/technical-article/000011928


I went around by using the Ln-tool in the Math toolset. We'll see if it is enough.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.