I've successfully created a raster using FocalStatisitics:
Problem:
The problem is that when I try to delete the 'output.tif' file within Python, I get the following error:
WindowsError: [Error 32] The process cannot access the file because it is being used by another process: 'E:/output.tif'
The problem also occurs in an interactive Python session - the file cannot be deleted by Windows Explorer until the PythonWin is closed. I assume the problem is that FocalStatistics did not close the file it created.
How can I delete 'output.tif' within Python? I am new to arcpy so I may be missing something obvious.
Code:
smoothed = arcpy.sa.FocalStatistics('input', neighborhood, "MEAN","NODATA")
smoothed.save('output.tif')
The problem is that when I try to delete the 'output.tif' file within Python, I get the following error:
Quote:
WindowsError: [Error 32] The process cannot access the file because it is being used by another process: 'E:/output.tif'
How can I delete 'output.tif' within Python? I am new to arcpy so I may be missing something obvious.