Esempio n. 1
0
def histogram(a, bins=range(0,256)):
  """
  Histogram function for multi-dimensional array.
  a = array
  bins = range of numbers to match
  """
  fa = a.flat
  n = gdalnumeric.searchsorted(gdalnumeric.sort(fa), bins)
  n = gdalnumeric.concatenate([n, [len(fa)]])
  hist = n[1:]-n[:-1]
  return hist
Esempio n. 2
0
def histogram(a, bins=range(0, 256)):
    """
    Histogram function for multi-dimensional array.
    a = array
    bins = range of numbers to match
    """
    fa = a.flat
    n = gdalnumeric.searchsorted(gdalnumeric.sort(fa), bins)
    n = gdalnumeric.concatenate([n, [len(fa)]])
    hist = n[1:] - n[:-1]
    return hist
Esempio n. 3
0
def histogram(a, bins=range(0, 256)):
    """
    多维数组的直方图函数
    a = array
    bins = 要匹配的数字范围
    :param a:
    :param bins:
    :return:
    """
    fa = a.flat
    n = gdalnumeric.searchsorted(gdalnumeric.sort(fa), bins)
    n = gdalnumeric.concatenate([n, [len(fa)]])
    hist = n[1:] - n[:-1]
    return hist
Esempio n. 4
0
 def buildHistogram(self):
   fa = a.flat
   n = gdalnumeric.searchsorted(gdalnumeric.sort(fa), bins)
   n = gdalnumeric.concatenate([n, [len(fa)]])
   hist = n[1:]-n[:-1] 
   return hist