When I 'm calculating this expression:

("%Soil organic carbon (t/ha)%" / (10000 * "%Soil depth (m)%" * (Float("%Bulk density (kg/m3)%") / 1000))) * 100


"%Soil organic carbon (t/ha)%" and "%Bulk density (kg/m3)%" are raster layers


"%Soil depth (m)%" is any value or calculator expression with input values: 0.05, 0.15, 0.30, etc.

enter image description here

I 'm geting this error:

ERROR 000539: Error running expression: rcexec() Traceback (most recent call last): File "", line 1, in File "", line 5, in rcexec File "c:\program files\arcgis\desktop10.5\arcpy\arcpy\sa\Functions.py", line 4483, in Times in_raster_or_constant2) File "c:\program files\arcgis\desktop10.5\arcpy\arcpy\sa\Utils.py", line 53, in swapper result = wrapper(*args, **kwargs) File "c:\program files\arcgis\desktop10.5\arcpy\arcpy\sa\Functions.py", line 4480, in Wrapper ["Times", in_raster_or_constant1, in_raster_or_constant2]) RuntimeError: ERROR 000732: Input Raster: Dataset does not exist or is not supported

Failed to execute (Raster Calculator).

Оn the contrary, when I write down "Soil depth" by hand like this, everything is ok

enter image description here

How to fix this problem?

  • Have you checked if all rasters are in the same projection? Are they all the same data / raster type (float...unsigned 8 bit...etc)? Commented Dec 15, 2019 at 22:00

1 Answer 1


Don't use quote symbols around numeric variables. Using quotes includes the values as strings!

So, where you have 10000 * "%Soil Depth (m)%", this is equivalent to saying 10000 * "0.05". NOT 10000 * 0.05.

When you multiply a string by 10,000, you get that string concatenated to itself, 10,000 times! Something like: etc. Which is what you see in your error message.

So change it to: 10000 * %Soil Depth (m)% (ie, without the double quotes). The whole calculation then would be:

("%Soil organic carbon (t/ha)%" / (10000 * %Soil depth (m)% * (Float("%Bulk density (kg/m3)%") / 1000))) * 100

See also the Raster Calculator documentation which states:

Long, double, or Boolean-type variables will be enclosed in percent symbols (%%). They do not need to be in quotes.

Example: %scale_factor%

  • Earlier, I was little confused after removing double quotes before and after percent symbols in raster calculator, because it showed me an ERROR 000989 Python syntax error: Parsing error SyntaxError: invalid syntax (line 1). However, everything worked just fine with that. Commented Dec 16, 2019 at 17:38

Your Answer

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

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