コード例 #1
0
ファイル: plot_utils.py プロジェクト: domwhill/premag
    def __init__(self,
                 scale_length=1,
                 bz_in=400.0,
                 lambda_p=5,
                 pert_amp='0p',
                 dim='2D'):
        paths = hk.DataDirectoryPaths()
        self.dim = dim
        self.path = paths.get_path(scale_length,
                                   bz_in,
                                   lambda_p,
                                   pert_amp=pert_amp,
                                   dim=self.dim)
        self.bz = bz_in
        self.scale_length = scale_length
        self.lambda_p = lambda_p
        self.pert_amp = pert_amp

        # --->  getting path ->
        t_list, tc_list = cf.get_t_list(self.path, var='Te')
        self.time_max = t_list[-1]
        self.tag = self.get_tag()
        self.save_tag = 'LT%i_%i_%s_%s' % (self.scale_length, self.bz,
                                           self.pert_amp, self.time_max)

        norm_dir = paths.norm_dir
        log_file = norm_dir + 'norm.log'
        [T_ref, n_ref, Z_ref, Bz_ref] = np.loadtxt(log_file)
        self.norm = cf.ConversionFactors(norm_dir, Z_ref, Ar=6.51)
        self.save_path = paths.save_dir
        self.Te_factor = 2.0 * T_ref * 1e-3
コード例 #2
0
        python plotters/plot_initial_profile_lineouts.py output_folder_to_save_plot/
'''
import os
import sys
import matplotlib.pyplot as plt
import matplotlib as mpl

sys.path.extend(["./"])

import modules.house_keeping as hk
import modules.chfoil_module as cf
import modules.figure_latex as fprl

paths = hk.DataDirectoryPaths()
norm_path = paths.norm_dir
cfg = cf.ConversionFactors(norm_path)

q_e = 1.602e-19
m_e = 9.11e-31
m_p = 1.67e-27
k_b = 1.38e-23
epsilon0 = 8.854e-12
#---------------
# user parameters
mult = 6
cfg.yi = 1

dim = '1D'
bz_in = 50
# scale length (1,2,3) - (1 = 20um conduction zone sim,1.5, 2 = 40um conduction zone sim etc. )
s_len = 1
コード例 #3
0
k_B = 1.38e-23
m_e = 9.11e-31
#-----

#---> file inputs
paths = hk.DataDirectoryPaths()
src_dir = paths.src_dir
data_dir = paths.data_dir_2D
if len(sys.argv) > 1:
    save_path = sys.argv[1] + "/"
else:
    save_path = "./"
norm_dir = paths.norm_dir
log_file = norm_dir + 'norm.log'
[T_ref, n_ref, Z_ref, Bz_ref] = np.loadtxt(log_file)
cd5 = cf.ConversionFactors(norm_dir, Z_ref, Ar=6.51)

Te_factor = 2.0 * T_ref * 1e-3
#--->  getting path ->
lambda_p = 5
time_list = ['03', '05', '07']
path_list = []
bz_in = 0.0    # selected magnetic field [Tesla]

#--- generating  path_list
s_list = [2]
file_name_without_path = (__file__.split('/')[-1]).split('.')[0]
save_tag = '%s_%iT_' % (file_name_without_path, bz_in)
for ip in range(len(s_list)):
    path_loc = paths.get_path(s_list[ip], bz_in, lambda_p)
    path_list.append(path_loc)
コード例 #4
0
ファイル: lineout_plotting.py プロジェクト: domwhill/premag
import modules.house_keeping as hk
import modules.figure_latex as fprl
from pylab import *

SI_on = cd5_switches.SI_on
save_on = cd5_switches.save_on
hlines_on = cd5_switches.hlines_on
grid_on = cd5_switches.grid_on
horizontal_on = cd5_switches.horizontal_on
separate_plots_on = cd5_switches.separate_plots_on
marker_on = False  #cd5_switches.marker_on
MSIZE = 4
init_path = os.getcwd()

norm_path = hk.DataDirectoryPaths().norm_dir
cd5 = cfoil.ConversionFactors(norm_path)

cl_index = int(cd5.cl_index)
c_index = int(cd5.c_index)

SI_on = cd5.SI_on
tau_ei = cd5.tau_ei
nu_ei = cd5.nu_ei
lambda_mfp = cd5.lambda_mfp
xstep_factor = cd5.xstep_factor
tstep_factor = cd5.tstep_factor
xlab = cd5.xlab
ylab = cd5.ylab
leg_title = cd5.leg_title
color_lineout = cd5.color_lineout
lineout_list = cd5.lineout_list