I'm trying to do a math operation in raster calculator using the rasters from other two raster calculators.

My calculation is a simple NDVI formula:

(rastcalc4 - rastcalc3)/(rastcalc4 + rastcalc3)

It works well in most of the cases, but, sometimes it fails and this error shows up:

ERROR 000539: Error running expression: rcexec()

Traceback (most recent call last):

File "", line 1, in

File "", line 8, in rcexec

RuntimeError: ERROR 999998: Unexpected Error.

Failed to execute (Raster Calculator (3)).

I don't understand what that means, how can i fix it?

closed as off-topic by PolyGeo Sep 26 '17 at 19:27

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This problem cannot or can no longer be reproduced. Changes to the system or to the asker's circumstances may have rendered the question obsolete, or the question does not include a procedure to enable potential answerers to reproduce the same symptoms. Such questions are off-topic as they are unlikely to help future readers, but editing them to include more details can lead to re-opening." – PolyGeo
If this question can be reworded to fit the rules in the help center, please edit the question.

  • As you are running this tool within model builder and it runs OK most of the time (equation looks ok), it strongly suggests that it's the inputs that are failing. So what ever is creating the rastcalc4 and rastcalc3 is failing. If you are setting extents for example may be you are setting an extent that is not covering one of your input rasters thus creating nodata output. Also you give no indication of how many times your model run? I find it can be a bit flakey if you are running it thousands of times with an iterator, then it's probably a memory issue. – Hornbydd Sep 20 '17 at 14:24
  • May be you can edit your question to include the model? – Hornbydd Sep 20 '17 at 14:24
  • 1
    Thanks! Now it works! It was a problem in the inputs extents, now it's running perfectly, thank you so much! – Charlera Sep 20 '17 at 15:43