Last active
December 17, 2015 23:19
-
-
Save scw/5688469 to your computer and use it in GitHub Desktop.
example histogram bin size calculation.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import arcpy | |
arcpy.CheckOutExtension("spatial") | |
raster = arcpy.Raster("c:\\workspace\\input_raster") | |
range = raster.maximum - raster.minimum | |
bins = 256 | |
bin_size = (range) / bins | |
# now we know the bin width, can multiply that by the OBJECTID for the lower bound of each | |
lower_bin_value = [bin_size * i for i in range(bins)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment