Ejemplo n.º 1
0
                 ('results', '_v_attrs', 'STS'))
    IDX = get_all_attrs(DB, IDX_ATTRS)
    IDX.sort()
    X_IDX = list(set([i[0] for i in IDX]))
    X_IDX.sort()
    Y_IDX = list(set([i[1] for i in IDX]))
    Y_IDX.sort()

    IMSHOW_EXTENT = (X_IDX[0], X_IDX[-1], Y_IDX[0], Y_IDX[-1])

    Z_IDX = []
    for i in xrange(6):
        Z_IDX.append(np.zeros((len(X_IDX), len(Y_IDX))))
    for ind_rate in xrange(len(X_IDX)):
        for ind_strength in xrange(len(Y_IDX)):
            tmp_mps = IDX[to1d(ind_rate, ind_strength, len(X_IDX))][2]
            Z_IDX[0][ind_rate][ind_strength] = tmp_mps[0]
            Z_IDX[1][ind_rate][ind_strength] = tmp_mps[1]
            Z_IDX[2][ind_rate][ind_strength] = tmp_mps['whole']

            tmp_sts = IDX[to1d(ind_rate, ind_strength, len(X_IDX))][3]
            Z_IDX[3][ind_rate][ind_strength] = tmp_sts[0]
            Z_IDX[4][ind_rate][ind_strength] = tmp_sts[1]
            Z_IDX[5][ind_rate][ind_strength] = tmp_sts['whole']

    # MPS plotting
    MPS_FIG, MPS_AXS = plt.subplots(1, 3, figsize=(9, 3))
    MPS_MIN_MAX = get_all_min_max([Z_IDX[i] for i in xrange(3)])
    MPS_NORM = colors.normalize(MPS_MIN_MAX[0], MPS_MIN_MAX[1])
    plot_run(MPS_FIG, "MPS", MPS_AXS, Z_IDX, range(3), MPS_NORM, IMSHOW_EXTENT)
def get_1d_ind_simu(ind, width):
    """Return 1d index given `ind` like 5,3"""
    x, y = ind.split(",")
    x, y = int(x), int(y)
    return utils.to1d(x, y, width)