Focal Statistics, memory issues after multiple calls

165
0
a month ago
Labels (1)
WeiMao
by
New Contributor

I'm writing some code using python to call arcpy. I found that after I called focalstatistics many times, arcgis pro would just crash and there was no record. 

My code is shown as follows, and self.smthc = 7, and factor is 500. Raster is just a DEM downloaded from USGS, and the resolution is 1m. It's about 2,000 rows and 2,000 columns.

def smoothDEM(self, raster, factor):
"""smooth the raster factor times"""
neighborhood = arcpy.sa.NbrRectangle(self.smthc, self.smthc, "CELL")
smoothed_dem = raster
for i in range(factor):
smoothed_dem = arcpy.sa.FocalStatistics(smoothed_dem, neighborhood, "MEAN", "DATA")
return smoothed_dem

The recode from Windows Event Viewer is shown as follows,


Faulting application name: ArcGISPro.exe, version: 3.2.2.49743, time stamp: 0x6216d2c0
Faulting module name: DADFLib.dll, version: 13.2.0.49743, time stamp: 0x652d8ad3
Exception code: 0xc00000fd
Fault offset: 0x0000000000027a04
Faulting process id: 0x7154
Faulting application start time: 0x01da814aaabdd4ec
Faulting application path: C:\Program Files\ArcGIS\Pro\bin\ArcGISPro.exe
Faulting module path: C:\Program Files\ArcGIS\Pro\bin\DADFLib.dll
Report Id: 03f47e51-7107-4a9f-80c1-ad9fc1f13fc8
Faulting package full name:
Faulting package-relative application ID:
0 Kudos
0 Replies