AnsweredAssumed Answered

Excluding "NoData" from raster percentile calculation.

Question asked by tonalca6864 on Jul 16, 2015
Latest reply on Jul 16, 2015 by Dan_Patterson



I'm trying to calculate percentiles out of a floating point raster. It works but it includes NoData in the calculation so I'm not getting what I need.


I wonder if someone knows how to exclude the "NoData" from the calculation.


Many thanks


env.workspace = r"D:\PROGRAMMES\LFP_Source_Rocks\ArcGIS\00_LFP_GLOBAL\00_UPWELLING\OUTPUT_Test.gdb"
raster = env.workspace + "\\" + "percentile"
array = arcpy.RasterToNumPyArray(raster)
array = scipy.sort(array)
per = 10
a = scipy.percentile(array,per)
print a