How to values of one raster to Null, based on Null values of another raster?

871
2
02-25-2014 02:37 PM
SThompson
New Contributor
Hello,
I would like to set the values of one raster ("NDVI.img") to Null, based on values that are Null in another raster ("Mask.img"). I am working with ArcGIS 10.1, and my input rasters are floating point.

To test out the method, In the SetNull tool, I specified the input conditional raster to be the Mask.img, the False raster to be the NDVI.img, and I entered "VALUE IS < 0.15". It worked. When I changed the expression to "VALUE IS NULL", it did not work.

I seem to have the expression wrong, and have tried various versions including
"IS NULL", "NO DATA", "== NULL", "IsNull", etc.

What is the correct way to specify this?

I also tried the "Con" function, where I specified a value of -9999 in the FalseRas where the conditional input raster had "VALUE IS NULL" - in this case (and when I tried some various attempts at SetNull in Python and Raster Calculator), I got an error message talking about unable to read the input raster table.

Does it matter if my data are floating point or integer or stored as GRID versus .IMG or .tif??  I opened the symbology tab of the raster files to run the histogram / statistics for each of my input floating point rasters but that did not seem to do the trick...

Any advice would be greatly appreciated!
0 Kudos
2 Replies
DuncanHornby
MVP Notable Contributor
I spoofed up some raster data, mask was an ESRI grid and the false grid was an img format. I filled in the SetNull tool and it worked for me. The only difference I can tell is the expression I used:

"VALUE" is null

In your question you said you are using:

"VALUE IS NULL"

Note where the quotes are.

Duncan
0 Kudos
SThompson
New Contributor
Thank you for your suggestion, Duncan. I tried placing the quotation marks as you suggested, but it didn't work.
I'm not sure why the SetNull function isn't working for me. However, I figured out how to get around it. I used the "Extract by Mask" tool in Spatial Analyst, which worked perfectly!
0 Kudos