Exemplo n.º 1
0
tProbs = fun.calcTrapsSections(trapDists, params=kPars)
tauN = fun.assembleTrapMigration(psiN, tProbs)
###############################################################################
# Plot landscape
###############################################################################
inteRange = (best, mean)
m = interp1d(inteRange, [2.5, -2.5])
(BBN, BQN) = (tauN[:sitesNum, :sitesNum], tauN[:sitesNum, sitesNum:])
(LW, ALPHA, SCA) = (.125, .5, 50)
# Generate figure -------------------------------------------------------------
(fig, ax) = plt.subplots(figsize=(15, 15))
# Plot networks ---------------------------------------------------------------
(fig, ax) = aux.plotNetwork(fig,
                            ax,
                            BBN * SCA,
                            sites,
                            sites, [0],
                            c='#03045e',
                            lw=LW,
                            alpha=ALPHA)
if LAY_TRAP:
    (fig, ax) = aux.plotNetwork(fig,
                                ax,
                                BQN * SCA,
                                traps,
                                sites, [0],
                                c='#f72585',
                                lw=LW * 3,
                                alpha=.9)
# Plot sites and traps --------------------------------------------------------
if pTypes is None:
    plt.scatter(sites.T[0],
Exemplo n.º 2
0
                site[1],
                marker=aux.MKRS[pTypes[i]],
                color=aux.MCOL[pTypes[i]],
                s=150,
                zorder=20,
                edgecolors='w',
                linewidths=1.25)
ax.set_xlim(*xRan)
ax.set_ylim(*yRan)
ax.set_aspect('equal')
(fig, ax) = aux.plotNetwork(fig,
                            ax,
                            tauC * SCA,
                            sites,
                            sites, [1] * len(coords),
                            c='#03045e',
                            lw=LW,
                            alpha=ALPHA,
                            arrows=False,
                            hl=2,
                            hw=1.2,
                            hsc=.05)
fig.savefig(path.join(
    PT_DTA, '{}-{}-{}.png'.format(EXP_FNAME,
                                  str(pNum).zfill(3), MOD)),
            dpi=250,
            bbox_inches='tight',
            pad_inches=0)
plt.close('all')
###############################################################################
# Export files
###############################################################################
Exemplo n.º 3
0
psiN = migMat  # fun.deleteLoopsFromMatrix(migMat)
# np.apply_along_axis(sum, 1, psiN)
(minX, minY) = np.apply_along_axis(min, 0, sites)
(maxX, maxY) = np.apply_along_axis(max, 0, sites)
###############################################################################
# Plot landscape
###############################################################################
(BBN, BQN) = (psiN[:sitesNum, :sitesNum], psiN[:sitesNum, sitesNum:])
(LW, ALPHA, SCA) = (.125, .5, 50)
# Generate figure -------------------------------------------------------------
(fig, ax) = plt.subplots(figsize=(15, 15))
# Plot networks ---------------------------------------------------------------
(fig, ax) = aux.plotNetwork(fig,
                            ax,
                            BBN * SCA,
                            sites,
                            sites, [0],
                            c='#03045e',
                            lw=LW,
                            alpha=ALPHA)
# Plot sites and traps --------------------------------------------------------
if pTypes is None:
    plt.scatter(sites.T[0],
                sites.T[1],
                marker='^',
                color='#03045eDB',
                s=150,
                zorder=20,
                edgecolors='w',
                linewidths=1.5)
else:
    for (i, site) in enumerate(sites):
Exemplo n.º 4
0
    (fig, ax) = plt.subplots(figsize=(15, 15))
    plt.imshow(tauN, vmax=1e-1, cmap='Purples', interpolation='nearest')
    fig.savefig(path.join(PT_IMG, EXP_FNAME + '_trapsMatrix.png'),
                dpi=500,
                bbox_inches='tight')
###############################################################################
# Plot landscape
###############################################################################
BBN = tauN[:sitesNum, :sitesNum]
BQN = tauN[:sitesNum, sitesNum:]
(LW, ALPHA, SCA) = (.125, .2, 50)
(fig, ax) = plt.subplots(figsize=(15, 15))
(fig, ax) = aux.plotNetwork(fig,
                            ax,
                            BQN * SCA,
                            traps,
                            sites, [0],
                            c='#f72585',
                            lw=LW * 2.5,
                            alpha=.75)
(fig, ax) = aux.plotNetwork(fig,
                            ax,
                            BBN * SCA,
                            sites,
                            sites, [0],
                            c='#2B62F7',
                            lw=LW,
                            alpha=ALPHA)
plt.scatter(sites.T[0],
            sites.T[1],
            marker='^',
            color='#03045eDB',