コード例 #1
0
def genHex(df):
    # Get bounds for graph
    global checkList
    colNames = list(df)
    lowX = df[colNames[0]].quantile(0.01)
    highX = df[colNames[0]].quantile(0.99)
    lowY = df[colNames[1]].quantile(0.01)
    highY = df[colNames[1]].quantile(0.99)

    checkList = df.copy()
    #print(df.index)

    return hv.HexTiles(df, group="Number of events: " +
                       str(len(df.index))).redim.range(
                           ebeam=(lowX, highX),
                           ipm2=(lowY, highY)).opts(norm=dict(framewise=True))
コード例 #2
0
def gen_hex(df):
    """
    Return holoviews HexTiles plot
    
    Parameters
    ----------
    
    df: pandas.DataFrame
        DataFrame containing data to be ploted on hextiles plot
    
    """

    # Get bounds for graph
    colNames = list(df)
    lowX = df[colNames[0]].quantile(0.01)
    highX = df[colNames[0]].quantile(0.99)
    lowY = df[colNames[1]].quantile(0.01)
    highY = df[colNames[1]].quantile(0.99)

    return hv.HexTiles(df, group="Number of events: " +
                       str(len(df.index))).redim.range(
                           ebeam=(lowX, highX),
                           ipm2=(lowY, highY)).opts(norm=dict(framewise=True))
コード例 #3
0
                        np.nanpercentile(lxt_fast, 99), 100))
except:
    pass

#droppled sthots.
ana.addCut('lightStatus/xray', -0.5, 0.5, 'off')
ana.addCut('evr/code_137', -0.5, 0.5, 'hxroff')
if ana.getFilter('hxroff').sum() > ana.getFilter('off').sum():
    offFilter = 'hxroff'
else:
    offFilter = 'off'
nOff = ana.getFilter(offFilter).sum()

#plots.
ipmUpTime = hv.HexTiles((eventTimeR[ipmUpVar<np.nanpercentile(ipmUpVar,99)],
                         ipmUpVar[ipmUpVar<np.nanpercentile(ipmUpVar,99)]),
                        kdims=[eventTimeDim, ipmUpDim]).\
                        opts(cmap='Blues')
ipmUpTimeMed = hv.Points((eventTimeRMed, ipmUpMed), kdims=[eventTimeDim,ipmUpDim],label=ipmUpDim.label).\
    options(color='r')
ipmDownTimeMed = hv.Points((eventTimeRMed, ipmDownMed), kdims=[eventTimeDim,ipmUpDim],label=ipmDownDim.label).\
    options(color='m')

ipmTimeLayout = ipmUpTime * ipmUpTimeMed * ipmDownTimeMed

treeSel = (l3eVar > np.nanpercentile(l3eVar, 1))
treePlot = hv.HexTiles((l3eVar[treeSel], ipmUpVar[treeSel]),
                       kdims=[l3eDim, ipmUpDim])

ipmPlot = hv.HexTiles((ipmUpVar, ipmDownVar), kdims=[ipmUpDim, ipmDownDim])
ipmLayout = ipmPlot.hist(dimension=[ipmUpDim.name, ipmDownDim.name])
if scatterVar is not None: