コード例 #1
0
import matplotlib.pyplot as plt

import scipy.optimize as optimize

from solveq2d import solveq2d




num_fig = 1000
SAVE_FIG = 1
name_file = 'fig_time_mean_forcingw_f_c.eps'

create_fig = CreateFigArticles(
    short_name_article='SW1l', 
    SAVE_FIG=SAVE_FIG, 
    FOR_BEAMER=False, 
    fontsize=19
    )




def load_from_namedir(set_of_dir, name_dir_results, tstatio):
    path_dir_results = set_of_dir.path_dirs[name_dir_results]
    sim = solveq2d.create_sim_plot_from_dir(path_dir_results)
    (dico_time_means, dico_results
     ) = sim.output.spatial_means.compute_time_means(tstatio)
    c2 = sim.param['c2']
    EK = dico_time_means['EK']
    Fr = np.sqrt(2*EK/c2)
    EA = dico_time_means['EA']
コード例 #2
0
import matplotlib.pylab as plt
import glob
import numpy as np

from solveq2d import solveq2d


from create_figs_articles import CreateFigArticles


SAVE_FIG = False

create_fig = CreateFigArticles(
    short_name_article='SW1l',
    SAVE_FIG=SAVE_FIG,
    FOR_BEAMER=False,
    fontsize=19)

dir_base  = create_fig.path_base_dir+'/Results_SW1lw'

c = 40

resol = 240*2**5

str_resol = repr(resol)
str_to_find_path = (
    dir_base+'/Pure_standing_waves_'+
    str_resol+'*/SE2D*c='+repr(c))+'_*'
print(str_to_find_path)
コード例 #3
0
import glob

from solveq2d import solveq2d

from create_figs_articles import CreateFigArticles

num_fig = 1000
SAVE_FIG = 0

c = 40
resol = 240 * 2**5

name_file = ('fig_nothin_c={0}_nh={1}'.format(c, resol))

create_fig = CreateFigArticles(short_name_article='SW1l',
                               SAVE_FIG=SAVE_FIG,
                               FOR_BEAMER=False,
                               fontsize=19)

dir_base = create_fig.path_base_dir + '/Results_SW1lw'

str_resol = repr(resol)
str_to_find_path = (dir_base + '/Pure_standing_waves_' + str_resol +
                    '*/SE2D*c=' + repr(c)) + '_*'
print str_to_find_path

paths_dir = glob.glob(str_to_find_path)

print paths_dir

sim = solveq2d.create_sim_plot_from_dir(paths_dir[0])
コード例 #4
0
import numpy as np
import matplotlib.pyplot as plt

from create_figs_articles import CreateFigArticles
SAVE_FIG = 0

c = np.array([10, 20, 40, 70, 100, 200])
eps = np.array([1, 0.94, 0.93, 0.89, 0.76, 0.8])
# eps = np.array([1, 0.94, 0.93, 0.89, 0.85, 0.8])

c = np.array([10, 20, 20, 40, 70, 100, 200, 400, 700, 1000])
eps = np.array([1, 0.99, 0.97, 0.93, 0.9, 0.89, 0.88, 0.85, 0.79, 0.79])

fontsize = 20
create_fig = CreateFigArticles(short_name_article='SW1l',
                               SAVE_FIG=SAVE_FIG,
                               FOR_BEAMER=False,
                               fontsize=fontsize)

fig, ax1 = create_fig.figure_axe(name_file='fig_eps_c')
ax1.set_xlabel(r'$c$')
ax1.set_ylabel(r'$\varepsilon$')

coef = 0.0

ax1.plot(c, eps * c**coef, 'k', linewidth=2)

# ax1.set_xscale('log')
# ax1.set_yscale('log')

# ax1.set_xlim([kmin, kmax])
# ax1.set_ylim([8e-3, 3e0])
コード例 #5
0
# small trick in order to import the module lindborg1999.py
path_here = os.getcwd()
path_mod_lindborg1999 = os.path.split(path_here)[0] + '/Flatness_atm'
sys.path.append(path_mod_lindborg1999)
from lindborg1999 import r, FL, FT

flatnessT = FT
flatnessL = FL

from create_figs_articles import CreateFigArticles
SAVE_FIG = 1

fontsize = 21

create_fig = CreateFigArticles(short_name_article='SW1l',
                               SAVE_FIG=SAVE_FIG,
                               FOR_BEAMER=False,
                               fontsize=fontsize)

fig, ax1 = create_fig.figure_axe(name_file='fig_flatness_atm',
                                 fig_width_mm=200,
                                 fig_height_mm=155,
                                 size_axe=[0.13, 0.127, 0.84, 0.835])

ax1.set_xscale('log')
ax1.set_yscale('log')

ax1.set_xlabel('$r$ (km)')
ax1.set_ylabel('$F_T$, $F_L$')

l_FT = ax1.plot(r, flatnessT, 'k', linewidth=2)
l_FL = ax1.plot(r, flatnessL, 'y', linewidth=2)
コード例 #6
0
import baseSW1lw
from solveq2d import solveq2d

from create_figs_articles import CreateFigArticles

SAVE_FIG = 0
nh = 960 * 2
c = 20
# c = 200

if SAVE_FIG:
    nh = 960 * 2

fontsize = 21
create_fig = CreateFigArticles(short_name_article='SW1l',
                               SAVE_FIG=SAVE_FIG,
                               FOR_BEAMER=False,
                               fontsize=fontsize)

paths = baseSW1lw.paths_from_nh_c_f(nh, c, f=0)

set_of_dir = solveq2d.SetOfDirResults(paths)
dirs = set_of_dir.dirs_from_values(solver='SW1lwaves', FORCING=True, c2=c**2)

path = set_of_dir.paths[0]

sim = solveq2d.load_state_phys_file(t_approx=1000, name_dir=path)

nx = sim.param.nx
c2 = sim.param.c2
c = np.sqrt(c2)
f = sim.param.f
コード例 #7
0
import baseSW1lw
from solveq2d import solveq2d

from create_figs_articles import CreateFigArticles

num_fig = 1000
SAVE_FIG = 1

nh = 240 * 2**3
# nh = 240*2**4

name_file = 'fig_spectra_c_Nx={0}'.format(nh)

fontsize = 21
create_fig = CreateFigArticles(short_name_article='SW1l',
                               SAVE_FIG=SAVE_FIG,
                               FOR_BEAMER=False,
                               fontsize=fontsize)

kf = baseSW1lw.kf

paths = baseSW1lw.paths_from_nh(nh)

set_of_dir = solveq2d.SetOfDirResults(paths)
set_of_dir = set_of_dir.filter(solver='SW1lwaves', FORCING=True, f=0)


def sprectra_from_c(c):

    set_of_dir_c = set_of_dir.filter(c=c)
    path = set_of_dir_c.path_larger_t_start()
コード例 #8
0
import h5py

import matplotlib.pylab as plt
import glob
import numpy as np

import baseSW1lw
from solveq2d import solveq2d

from create_figs_articles import CreateFigArticles

SAVE_FIG = 0

fontsize = 19
create_fig = CreateFigArticles(short_name_article='SW1l',
                               SAVE_FIG=SAVE_FIG,
                               FOR_BEAMER=False,
                               fontsize=fontsize)

dir_base = create_fig.path_base_dir + '/Results_SW1lw'

c = 40
resol = 240 * 2**5

key_var = 'uy'  # for transverse since r = delta x
# key_var = 'ux' # for longitudinal since r = delta x

str_resol = repr(resol)
str_to_find_path = (dir_base + '/Pure_standing_waves_' + str_resol +
                    '*/SE2D*c=' + repr(c)) + '_*'
# print str_to_find_path