Example #1
0
                                      np.round(cfg.caseDef.mu * 1000, 1),
                                      np.round(cfg.caseDef.eps * 1000, 1))
obsName = ''
gridPostfix = ''
N = 1
for d in np.arange(dim):
    obsName += '_%s_%s' % (fieldsDef[d][2], indicesName[d][1])
    N *= cfg.grid.nx[d]
    gridPostfix = "%s_n%dl%dh%d" % (gridPostfix, cfg.grid.nx[d],
                                    cfg.grid.nSTDLow[d], cfg.grid.nSTDHigh[d])
cpyBuffer = gridPostfix
gridPostfix = '_%s%s%s' % (srcPostfix, obsName, cpyBuffer)

# Read grid
gridFile = '%s/grid/grid%s.txt' % (cfg.general.resDir, gridPostfix)
(X, Y) = ergoPlot.readGrid(gridFile, dim)
coord = (X.flatten(), Y.flatten())

tauConv = tauDim * timeScaleConversion
postfix = "%s_tau%03d" % (gridPostfix, tauDim * 1000)

print 'Readig spectrum...'
EigValForwardFile = '%s/eigval/eigValForward_nev%d%s.txt' % (cfg.general.specDir, nev, postfix)
EigVecForwardFile = '%s/eigvec/eigVecForward_nev%d%s.txt' % (cfg.general.specDir, nev, postfix)
EigValBackwardFile = '%s/eigval/eigValBackward_nev%d%s.txt' \
                    % (cfg.general.specDir, nev, postfix)
EigVecBackwardFile = '%s/eigvec/eigVecBackward_nev%d%s.txt' \
                    % (cfg.general.specDir, nev, postfix)
statDist = np.loadtxt('%s/transitionMatrix/initDist%s.txt' % (cfg.general.resDir, postfix))
(eigValForward, eigVecForward, eigValBackward, eigVecBackward) \
    = ergoPlot.readSpectrum(nev, EigValForwardFile, EigVecForwardFile,
Example #2
0
xlimEig = [xmineigVal, -xmineigVal/100]
ylimEig = [ymineigVal, -ymineigVal]
zlimEig = [cfg.stat.powerMin, cfg.stat.powerMax]
xticks = None
yticksPos = np.arange(0, ylimEig[1], 5.)
yticksNeg = np.arange(0, ylimEig[0], -5.)[::-1]
yticks = np.concatenate((yticksNeg, yticksPos))
zticks = np.logspace(np.log10(zlimEig[0]), np.log10(zlimEig[1]),
                    int(np.round(np.log10(zlimEig[1]/zlimEig[0]) + 1)))
zticks = np.logspace(np.log10(zlimEig[0]), np.log10(zlimEig[1]),
                     int(np.round(np.log10(zlimEig[1]/zlimEig[0])/2 + 1)))
alpha = 0.01
nev = cfg.spectrum.nev

# Read grid
coord = ergoPlot.readGrid(gridFile, dimObs)
if dimObs == 1:
    X = coord[0]
elif dimObs == 2:
    X, Y = np.meshgrid(coord[0], coord[1])
    coord = (X.flatten(), Y.flatten())
elif dimObs == 3:
    X, Y, Z = np.meshgrid(coord[0], coord[1], coord[2], indexing='ij')
    coord = (X.T.flatten(), Y.T.flatten(), Z.T.flatten())

# Define file names
postfix = "%s_tau%03d" % (gridPostfix, tau * 1000)
eigValForwardFile = '%s/eigval/eigvalForward_nev%d%s.txt' \
                    % (cfg.general.specDir, nev, postfix)
eigVecForwardFile = '%s/eigvec/eigvecForward_nev%d%s.txt' \
                    % (cfg.general.specDir, nev, postfix)
Example #3
0
                                      np.round(cfg.caseDef.mu * 1000, 1),
                                      np.round(cfg.caseDef.eps * 1000, 1))
obsName = ''
gridPostfix = ''
N = 1
for d in np.arange(dimObs):
    obsName += '_%s_%s' % (fieldsDef[d][2], indicesName[d][1])
    N *= cfg.grid.nx[d]
    gridPostfix = "%s_n%dl%dh%d" % (gridPostfix, cfg.grid.nx[d],
                                    cfg.grid.nSTDLow[d], cfg.grid.nSTDHigh[d])
cpyBuffer = gridPostfix
gridPostfix = '_%s%s%s' % (srcPostfix, obsName, cpyBuffer)

# Read grid
gridFile = '%s/grid/grid%s.txt' % (cfg.general.resDir, gridPostfix)
coord = ergoPlot.readGrid(gridFile, dimObs)

# Coordinate matrices read in 'ij' indexing (not 'xy')!
if dimObs == 1:
    X = coord[0]
elif dimObs == 2:
    X, Y = np.meshgrid(coord[0], coord[1], indexing='ij')
    coord = (X.flatten(), Y.flatten())
elif dimObs == 3:
    X, Y, Z = np.meshgrid(coord[0], coord[1], coord[2], indexing='ij')
    coord = (X.flatten(), Y.flatten(), Z.flatten())

tau = tauDim * timeScaleConversion
dstPostfix = gridPostfix
dstPostfixTau = "%s_tau%03d" % (gridPostfix, int(tauDim * 1000 + 0.1))
specDir = '%s/spectrum/' % cfg.general.plotDir
Example #4
0
                                      np.round(cfg.caseDef.mu * 1000, 1),
                                      np.round(cfg.caseDef.eps * 1000, 1))
obsName = ''
gridPostfix = ''
N = 1
for d in np.arange(dim):
    obsName += '_%s_%s' % (fieldsDef[d][2], indicesName[d][1])
    N *= cfg.grid.nx[d]
    gridPostfix = "%s_n%dl%dh%d" % (gridPostfix, cfg.grid.nx[d],
                                    cfg.grid.nSTDLow[d], cfg.grid.nSTDHigh[d])
cpyBuffer = gridPostfix
gridPostfix = '_%s%s%s' % (srcPostfix, obsName, cpyBuffer)

# Read grid
gridFile = '%s/grid/grid%s.txt' % (cfg.general.resDir, gridPostfix)
(X, Y) = ergoPlot.readGrid(gridFile, dim)
coord = (X.flatten(), Y.flatten())

tauConv = tauDim * timeScaleConversion
postfix = "%s_tau%03d" % (gridPostfix, tauDim * 1000)

print 'Readig spectrum...'
EigValForwardFile = '%s/eigval/eigValForward_nev%d%s.txt' % (cfg.general.specDir, nev, postfix)
EigVecForwardFile = '%s/eigvec/eigVecForward_nev%d%s.txt' % (cfg.general.specDir, nev, postfix)
EigValBackwardFile = '%s/eigval/eigValBackward_nev%d%s.txt' \
                    % (cfg.general.specDir, nev, postfix)
EigVecBackwardFile = '%s/eigvec/eigVecBackward_nev%d%s.txt' \
                    % (cfg.general.specDir, nev, postfix)
statDist = np.loadtxt('%s/transfer/initDist/initDist%s.txt' % (cfg.general.resDir, gridPostfix))
(eigValForward, eigVecForward, eigValBackward, eigVecBackward) \
    = ergoPlot.readSpectrum(EigValForwardFile, EigVecForwardFile,
Example #5
0
for d in np.arange(dimObs):
    gridPostfix = "%s_n%dl%dh%d" % (gridPostfix, cfg.grid.nx[d],
                                    cfg.grid.nSTDLow[d], cfg.grid.nSTDHigh[d])
gridPostfix = "%s%s%s" % (srcPostfix, obsName, gridPostfix)
gridFile = '%s/grid/grid%s.txt' % (cfg.general.resDir, gridPostfix)

nLags = len(cfg.transfer.tauRng)

nevPlot = cfg.spectrum.nev
xminEigVal = -cfg.stat.rateMax
yminEigVal = -cfg.stat.angFreqMax
ev_xlabel = r'$x_1$'
ev_ylabel = r'$x_2$'

# Read grid
(X, Y) = ergoPlot.readGrid(ergoPlot.gridFile, ergoPlot.dimObs)
coord = (X.flatten(), Y.flatten())


eigenCondition = np.empty((nLags, cfg.spectrum.nev))
eigVal = np.empty((nLags, cfg.spectrum.nev), dtype=complex)
eigValGen = np.empty((nLags, cfg.spectrum.nev), dtype=complex)
for lag in np.arange(nLags):
    tau = cfg.transfer.tauRng[lag]
    
    # Define file names
    postfix = "%s_tau%03d" % (ergoPlot.gridPostfix, tau * 1000)
    EigValForwardFile = '%s/eigval/eigValForward_nev%d%s.txt' \
                        % (cfg.general.specDir, cfg.spectrum.nev, postfix)
    EigVecForwardFile = '%s/eigvec/eigVecForward_nev%d%s.txt' \
                        % (cfg.general.specDir, cfg.spectrum.nev, postfix)