Hi Michalis,You should be able to specify the output raster parameter if you call the 'arcpy.gp.ZonalStatistics' function. Ex:# Local variables:
int_example1 = "C:\\DATA\\RASTER\\DEM\\int_example1"
example = "C:\\temp\\python\\zones.tif"
ZonalSt_int_1 = "C:\\temp\\python\\zonal_stats.tif"
# Process: Zonal Statistics
arcpy.gp.ZonalStatistics_sa(int_example1, "VALUE", example, ZonalSt_int_1, "MEAN", "DATA")
However, if you call the 'arcpy.sa.ZonalStatistics' function the raster will be written to a scratch workspace. Ex:# Local variables:
int_example1 = "C:\\DATA\\RASTER\\DEM\\int_example1"
example = "C:\\temp\\python\\zones.tif"
ZonalSt_int_1 = "C:\\temp\\python\\zonal_stats.tif"
# Process: Zonal Statistics
stats = arcpy.sa.ZonalStatistics(int_example1, "VALUE", example, "MEAN", "NODATA")
The raster will be removed from the scratch workspace if you save a hard copy. For example you would add the following at the end:
stats.save(r"C:\temp\python\Zonal_Stats.tif")
I would recommend setting 'arcpy.env.overwriteOutput = True' and using the 'arcpy.gp.ZonalStatistics_sa' function. With this function you can easily specify where you want the raster written to, and you can overwrite the output raster each time.