Select to view content in your preferred language

Iterate rasters into SETNULL giving error

878
3
Jump to solution
11-27-2013 05:02 AM
ChenaySimms
Deactivated User
Hello

I am trying to use the SETNULL funtion in the raster calculator to convert all my minus values to NODATA. As I need to run this analysis on a large number of EVI images I have tried to put it in a model with an iterator but it runs into the following error -

ERROR 000539: Error running expression: rcexec()
Traceback (most recent call last):
  File "<expression>", line 1, in <module>
  File "<string>", line 8, in rcexec
RuntimeError: ERROR 010093: Output raster format UNKNOWN is unsupported.

Failed to execute (Raster Calculator).

On a single raster my SETNULL expression works so this has got to do with my use of the iterator output in the expression. 

Expression = SetNull("%MCD43_EVI_interpolated_SA_2000049.tif%" < 0,"%MCD43_EVI_interpolated_SA_2000049.tif%")

Output = %Name%_c

Any ideas?

Thanks

Chenay
0 Kudos
1 Solution

Accepted Solutions
DuncanHornby
MVP Notable Contributor
Just an idea but if you are stringing this all up in a model it may be easier if you use the SetNull tool itself rather than call it via the raster calculator tool. It will make your model more understandable rather than a "black box" call to the raster calculator tool which itself can call many other tools.

Also it will ensure you are filling the parameters in correctly. If you look at the help SetNull parameters are:

in_conditional_raster, in_false_raster_or_constant, {where_clause})

but your code appears to have the where part at the beginning?

View solution in original post

0 Kudos
3 Replies
DuncanHornby
MVP Notable Contributor
Just an idea but if you are stringing this all up in a model it may be easier if you use the SetNull tool itself rather than call it via the raster calculator tool. It will make your model more understandable rather than a "black box" call to the raster calculator tool which itself can call many other tools.

Also it will ensure you are filling the parameters in correctly. If you look at the help SetNull parameters are:

in_conditional_raster, in_false_raster_or_constant, {where_clause})

but your code appears to have the where part at the beginning?
0 Kudos
ChenaySimms
Deactivated User
Hi

Thanks, forgot about the SETNULL tool, that will definately make life easier 🙂

I did sort my problem out, I added an extension to the end of the output and now at least the model runs.

As for the expression, it gave the correct results when I ran it on a single raster. I double checked it agains the info in the Help and the syntax I have used is the same as that given in the Help. The model outputs that I have spot checked also seem correct.

Thanks again for the help.

regards

Chenay
0 Kudos
DuncanHornby
MVP Notable Contributor
Chenay,

I tend to string the individual tools together in model builder rather than use the raster calculator, it sounds like it supports a different syntax which confused me. Storm in a tea cup!

Duncan
0 Kudos