<div dir="ltr">I have a drone raster file which I want to use for some calculation.<div>Before the calculation, I need to loose some extreme values.</div><div>I want to do something like a percentile calculation where you get all values, order them and loose the top 10%.</div><div>For this, I need to get all values first which can be slow when using a large file.</div><div><br></div><div>I looked at the statistics (band.GetStatistics) but that doesn't work well.</div><div>I thought I could use 2 times the standard deviation added to the mean to get roughly 97%.</div><div>But with these statistics:</div><div><div><font face="monospace, monospace">    STATISTICS_MAXIMUM=33.186080932617</font></div><div><font face="monospace, monospace">    STATISTICS_MEAN=24.840205979603</font></div><div><font face="monospace, monospace">    STATISTICS_MINIMUM=1.5951598882675</font></div><div><font face="monospace, monospace">    STATISTICS_STDDEV=4.7285348016053</font></div><div>Mean + 2*std is larger than the max.</div><div><br></div><div>So I moved to the histogram. It is also very fast, but I'm not sure how to use it.</div><div>I have this:</div><div><div><font face="monospace, monospace">  256 buckets from 1.53322 to 33.248:</font></div><div><font face="monospace, monospace">  410 77 66 66 65 58 56 45 42 87 57 72 61 65 68 70 73 82 93 ...</font></div></div><div><div class="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Does this mean, bucket 1 = 410 that I have 410 pixels of value 1.53322 and the second bucket means I have 77 pixels between 1.53322 and 1.657? 1.657 = 1.53322 + ((33.248 - 1.53322)/256)</div><div dir="ltr"><br></div><div dir="ltr">Is this a good approach? Or can/should I use a different one.</div><div dir="ltr"><br></div><div dir="ltr">Thanks,<br>
<br>Paul<br>
</div></div></div></div></div></div>
</div></div>