Percent clip color ramp stretch using python?

2715
1
Jump to solution
09-19-2012 10:06 AM
PaulSimpson
New Contributor III
I'm using 10.0.  Within raster layer Properties, Symbology dialog there is an option within Stretch Type to perform a percent clip from the top or bottom of the histogram.  This technique works very well for what I'm doing.  I have too many rasters to do this manually, but I'm unable to duplicate the effect within python.  I have floating point rasters, and I want to see only the top and bottom .01 percent of each raster - 2 rasters output, 1 top and 1 bottom.  I can set thresholds based on percent of the max value of the raster, but that's not nearly the same, and setting the minimum threshold based on the raster max value doesn't work well at all.  The minimum value is always zero, so that's not useful at all. 

Does anyone know if there is a tool available to arcpy which will do this or, barring that, how arcGIS calculates that clip value so that I can try to duplicate it using python?

Thanks!

P.
0 Kudos
1 Solution

Accepted Solutions
PaulSimpson
New Contributor III
GenerateExcludeArea_management does the trick.  The secret word for the tool search is "histogram".

View solution in original post

0 Kudos
1 Reply
PaulSimpson
New Contributor III
GenerateExcludeArea_management does the trick.  The secret word for the tool search is "histogram".
0 Kudos