コード例 #1
0
ファイル: lorentzian.py プロジェクト: uqfoundation/mystic
def histogram(data,binwidth, xmin,xmax):
    """generate bin-centered histogram of provided data
return bins of given binwidth (and histogram) generated between [xmin,xmax]"""
    bins = arange(xmin,xmax, binwidth)
    binsc = bins + (0.5 * binwidth)
    try: #FIXME: use updated numpy.histogram
        histo = numpyhisto(data, bins, new=False)[0]
    except:
        histo = numpyhisto(data, bins)[0]
    return binsc[:len(histo)], histo
コード例 #2
0
def histogram(data,binwidth, xmin,xmax):
    """generate bin-centered histogram of provided data
return bins of given binwidth (and histogram) generated between [xmin,xmax]"""
    bins = arange(xmin,xmax, binwidth)
    binsc = bins + (0.5 * binwidth)
    try: #FIXME: use updated numpy.histogram
        histo = numpyhisto(data, bins, new=False)[0]
    except:
        histo = numpyhisto(data, bins)[0]
    return binsc[:len(histo)], histo
コード例 #3
0
ファイル: lorentzian.py プロジェクト: HMP1/bumps
def histogram(data,binwidth,xmin,xmax):
    """
    generate bin-centered histogram of provided data

    return bins of given binwidth (and histogram) generated between [xmin,xmax]
    """
    edges = arange(xmin,xmax+binwidth*0.9999999, binwidth)
    centers = edges + (0.5 * binwidth)
    histo,_ = numpyhisto(data, bins=edges)
    #print data.size, sum(histo), edges[0], edges[-1], min(data),max(data)
    return centers, histo
コード例 #4
0
def histogram(data, binwidth, xmin, xmax):
    """
    generate bin-centered histogram of provided data

    return bins of given binwidth (and histogram) generated between [xmin,xmax]
    """
    edges = arange(xmin, xmax + binwidth * 0.9999999, binwidth)
    centers = edges + (0.5 * binwidth)
    histo, _ = numpyhisto(data, bins=edges)
    #print data.size, sum(histo), edges[0], edges[-1], min(data),max(data)
    return centers, histo