Hi Peter,Are you rasters classified by pixel value (i.e. value > 3 equals snow covered) or by an actual field attribute? What pixel type are your rasters (i.e. floating point, signed integer)?Below is an example on how you can do this. In the example, the rasters I am working with have a pixel type of floating point. What the script does is convert the floating point rasters to integer by multiplying the raster by the number of decimal places I would like to preserve. For example, I multiply the rasters by 100 to maintain 2 decimal values. Next I add an attribute table to the raster and calculate the total number of pixels.Next I want to find the percentage of pixels with a greater value of 3.25 (which represents snow cover). I multiply this value by 100, sum all the pixels with a value greater than this and divide by the total number of pixels to find the percentage.import arcpy
from arcpy import env
from arcpy.sa import *
arcpy.CheckOutExtension("Spatial")
env.workspace = r"C:\temp\python\rasters"
env.overwriteOutput = True
lstRasters = arcpy.ListRasters("*")
for raster in lstRasters:
outTimes = Times(raster, 100)
outTimes.save(r"C:\temp\python\outTimes.tif")
intRas = Int(r"C:\temp\python\outTimes.tif")
intRas.save(r"C:\temp\python\intRas.tif")
arcpy.BuildRasterAttributeTable_management(r"C:\temp\python\intRas.tif", "Overwrite")
desc = arcpy.Describe(r"C:\temp\python\intRas.tif")
totalpixels = desc.height * desc.width
list = []
pixValue = 3.25 * 100
rows = arcpy.SearchCursor(intRas, "VALUE > " + str(pixValue))
for row in rows:
list.append(row.Count)
print float(sum(list)) / float(totalpixels)
del row, rows
arcpy.Delete_management(r"C:\temp\python\intRas.tif")
arcpy.Delete_management(r"C:\temp\python\outTimes.tif")