-
Notifications
You must be signed in to change notification settings - Fork 2
/
TestDrive_momRMS.py
executable file
·62 lines (52 loc) · 1.49 KB
/
TestDrive_momRMS.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import numpy as np
from fieldHelper import *
from momHelper import *
from parIOHelper import *
from geomHelper import *
from plotHelper import *
from windowFFT import *
import sys
suffix = sys.argv[1]
if not suffix =='.dat':
suffix = '_'+suffix
tStart = float(sys.argv[2])
tEnd = float(sys.argv[3])
pars = init_read_parameters(suffix)
momen = momfile('mom_e'+suffix,pars)
geom_type, geom_pars, geom_coeff = init_global_geometry(suffix, pars)
zi = complex(0, 1)
nz = pars['nz0']
nx = pars['nx0']
dz = 2.0/nz
zgrid = np.arange(nz)/float(nz-1)*(2.0-dz)-1.0
if 'lx_a' in pars:
xgrid = np.arange(nx)/float(nx-1)*pars['lx_a']+pars['x0']-pars['lx_a']/2.0
else:
xgrid = np.arange(nx)/float(nx-1)*pars['lx'] - pars['lx']/2.0
show_plots = True
plot_format = 'display'
#plot_format = 'ps'
nf = 200
lf = 10.
kygrid = range(pars['nky0'])
zInd = nz/2
kyInd = -1
xInd = nx * 5 / 8
if 1 == 1:
tgrid, dens_tx, tperp_tx = momen_tx(momen, \
geom_coeff, \
zgrid, \
kygrid, \
xgrid, \
zInd, \
tStart, \
tEnd, \
show_plots, \
plot_format)
plot_format = 'ps'
for xInd in range(nx / 4, nx * 3 / 4 + 1, 8):
#t_rms, tperp_rms = momen_rms(tgrid, tperp_tx, xInd, show_plots, plot_format)
t_rms, dens_rms = momen_rms(tgrid, dens_tx, xInd, show_plots, plot_format)