Error 000539 when filling NoData values using Raster Calculator FocalStatistics

117
1
10-04-2019 04:08 AM
Highlighted
New Contributor

I have a global ocean pH raster map.The raster has large NoData areas: all land areas and many coastlines have NoData. The land areas should remain as NoData, but the ocean areas (blue) should be filled with pH values.

First I made a seperate map with all the ocean areas that need to be filled (black=1, white=NoData):

Then I tried to apply this method to fill the NoData gaps: https://support.esri.com/en/technical-article/000004792 

I wrote the following line in the raster calculator:

Con("%pH_GapsToBeFillled%"==1,  FocalStatistics("%pH_Global%", NbrRectangle(10,10, "CELL"), "MEAN"), "%pH_Global%")

However, I keep getting the following error. Does anyone know where the problem occurs?

Reply
0 Kudos
1 Reply
Highlighted
New Contributor

Hi, 

Let's try this code: 

  Con("%pH_GapsToBeFillled%"==1,  FocalStatistics("%pH_Global%", NbrRectangle(10,10, "CELL"), "MEAN",""), "%pH_Global%")

 

I  added a ("") at the end of FocalStatistics function to set "Not ignore NoData". Also, you may want to set your workplace by arcpy.workspace function.

I hope this helps.

Reply
0 Kudos