Error 000539 when filling NoData values using Raster Calculator FocalStatistics

10-04-2019 04:08 AM
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: 

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?

0 Kudos
1 Reply
New Contributor


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.

0 Kudos