Skip to main content
deleted 2 characters in body
Source Link
Bera
  • 77.8k
  • 14
  • 78
  • 187

You can use python and numpy.percentile:

import arcpy
import numpy as np

rasterfile = r'C:\GIS\data\DEM50m\grid50m\nh_65_3.tif' #Change
arr = arcpy.RasterToNumPyArray(rasterfile) #Create array from raster
arr[arr==-9999]=np.nan #I have nodata values of -9999. This converts them to nan...

for p in [1,99]:
    print np.nanpercentile(arr, p) # ...so i can use nanpercentile to ignore them
    #print np.percentile(arr,p) #If you have no nan use np.percentile
import arcpy
import numpy as np

rasterfile = r'C:\GIS\data\DEM50m\grid50m\nh_65_3.tif' #Change
arr = arcpy.RasterToNumPyArray(rasterfile) #Create array from raster
arr[arr==-9999]=np.nan #I have nodata values of -9999. This converts them to nan...

for p in [1,99]:
    print np.nanpercentile(arr, p) # ...so i can use nanpercentile to ignore them
    #print np.percentile(arr,p) #If you have no nan use np.percentile

enter image description here

You can use python and numpy.percentile:

import arcpy
import numpy as np

rasterfile = r'C:\GIS\data\DEM50m\grid50m\nh_65_3.tif' #Change
arr = arcpy.RasterToNumPyArray(rasterfile) #Create array from raster
arr[arr==-9999]=np.nan #I have nodata values of -9999. This converts them to nan...

for p in [1,99]:
    print np.nanpercentile(arr, p) # ...so i can use nanpercentile to ignore them
    #print np.percentile(arr,p) #If you have no nan use np.percentile

enter image description here

You can use python and numpy.percentile:

import arcpy
import numpy as np

rasterfile = r'C:\GIS\data\DEM50m\grid50m\nh_65_3.tif' #Change
arr = arcpy.RasterToNumPyArray(rasterfile) #Create array from raster
arr[arr==-9999]=np.nan #I have nodata values of -9999. This converts them to nan...

for p in [1,99]:
    print np.nanpercentile(arr, p) # ...so i can use nanpercentile to ignore them
    #print np.percentile(arr,p) #If you have no nan use np.percentile

enter image description here

Source Link
Bera
  • 77.8k
  • 14
  • 78
  • 187

You can use python and numpy.percentile:

import arcpy
import numpy as np

rasterfile = r'C:\GIS\data\DEM50m\grid50m\nh_65_3.tif' #Change
arr = arcpy.RasterToNumPyArray(rasterfile) #Create array from raster
arr[arr==-9999]=np.nan #I have nodata values of -9999. This converts them to nan...

for p in [1,99]:
    print np.nanpercentile(arr, p) # ...so i can use nanpercentile to ignore them
    #print np.percentile(arr,p) #If you have no nan use np.percentile

enter image description here