from read_iterdb_x import * from read_EFIT import * from finite_differences_x import * from interp import * import matplotlib.pyplot as plt import numpy as np import sys ITERDBdict1 = read_iterdb_x(sys.argv[1]) ITERDBdict2 = read_iterdb_x(sys.argv[2]) impurityCharge = 6. if 1 == 1: plt.plot(ITERDBdict1['rhot_vrot'], ITERDBdict1['vrot'], label='1') plt.plot(ITERDBdict2['rhot_vrot'], ITERDBdict2['vrot'], '.', label='2') plt.axis((0.9, 1., -1E5, 1E5)) plt.title('vrot (rad/s)') plt.xlabel('rhot') plt.legend() plt.show() if 1 == 1: plt.plot(ITERDBdict1['rhot_ti'], ITERDBdict1['ti'], label='1') plt.plot(ITERDBdict2['rhot_ti'], ITERDBdict2['ti'], '.', label='2') plt.title('ti (eV)') plt.xlabel('rhot') plt.legend() plt.show() if 1 == 1: plt.plot(ITERDBdict1['rhot_te'], ITERDBdict1['te'], label='1') plt.plot(ITERDBdict2['rhot_te'], ITERDBdict2['te'], '.', label='2')
#from read_iterdb_file import * from read_iterdb_x import * import sys from interp import * from finite_differences_x import * from read_EFIT import * from calc_volume_from_EFIT import * from write_iterdb import * import numpy as np ITERDBdict = read_iterdb_x(sys.argv[1]) EFITdict = read_EFIT(sys.argv[2]) vrot0 = ITERDBdict['vrot'] rhot_vrot0 = ITERDBdict['rhot_vrot'] shift = 0.005 vrot_shifted = interp(rhot_vrot0 - shift, vrot0, rhot_vrot0) plt.plot(rhot_vrot0, vrot0, label='before') plt.plot(ITERDBdict['rhot_te'], vrot_shifted, label='new') plt.legend() plt.show() file_out_base = 'efit_DIIID153764_' + 'off7Zp2bsx11_120_exp_vrot_left' base_number = '153764' time_str = '0.0' psipn = interp(EFITdict['rhotn'], EFITdict['psipn'], ITERDBdict['rhot_te']) rhop = np.sqrt(abs(psipn)) output_iterdb(ITERDBdict['rhot_te'], \ rhop, \ ITERDBdict['ne']*1.E-19, \ ITERDBdict['te']*1.E-3, \ ITERDBdict['ni']*1.E-19, \ ITERDBdict['ti']*1.E-3, \
from read_iterdb_x import * from read_EFIT import * from finite_differences_x import * from interp import * import matplotlib.pyplot as plt import numpy as np import sys iterdbFileName = sys.argv[1] efitFileName = sys.argv[2] er_data = np.genfromtxt(sys.argv[3]) use_psip = False EFITdict = read_EFIT(efitFileName) ITERDBdict = read_iterdb_x(iterdbFileName) Rgrid = EFITdict['R'] uniR = np.linspace(Rgrid[0], Rgrid[-1], len(Rgrid) * 8) rhot_uniR = interp(Rgrid, EFITdict['rhotn'], uniR) psip_uniR = interp(Rgrid, EFITdict['psipn'], uniR) if 1 == 0: plt.plot(ITERDBdict['rhot_ni'], ITERDBdict['ni'] * 1E-19, label='ni (1E19)') plt.plot(ITERDBdict['rhot_ti'], ITERDBdict['ti'] * 1E-03, label='ti (1E3)') plt.plot(ITERDBdict['rhot_ne'], ITERDBdict['ne'] * 1E-19, label='ne (1E19)')
# n0_global = 16 # kymin = 0.1511 # x0 = 0.9725 # Diallo off7 aGENE_m = 0.7567 n0_global = 13 kymin = 0.1032 x0 = 0.97 e = 1.6*10**(-19) mref = 2. M_kg = 3.3*10**(-27) #rhot0, te0, ti0, ne0, ni0, nz0, vrot0 = read_iterdb_file(iterdb_file_name) ITERDBdict = read_iterdb_x(iterdb_file_name) print(list(ITERDBdict.keys())) #['rhot_te', 'te', 'rhot_ti', 'ti', 'rhot_ne', 'ne', \ #'rhot_ni', 'ni', 'rhot_nz', 'nz', 'rhot_vrot', 'vrot'] uni_rhot = np.linspace(min(ITERDBdict['rhot_te']), \ max(ITERDBdict['rhot_te']), len(ITERDBdict['rhot_te']) * 10) te_u = interp(ITERDBdict['rhot_te'], ITERDBdict['te'], uni_rhot) ne_u = interp(ITERDBdict['rhot_ne'], ITERDBdict['ne'], uni_rhot) vrot_u = interp(ITERDBdict['rhot_vrot'], ITERDBdict['vrot'], uni_rhot) tprime_e = -first_derivative(te_u,uni_rhot)/te_u nprime_e = -first_derivative(ne_u,uni_rhot)/ne_u #kyGENE = 102*np.sqrt(mref)*np.sqrt(te_u)/Bref_Gauss*k_theta_cm*k2Factor
from read_iterdb_x import * import sys from interp import * from finite_differences_x import * from read_EFIT import * from calc_volume_from_EFIT import * from write_iterdb import * import numpy as np ITERDBdict = read_iterdb_x('./CMOD1120907032May12.iterdb') EFITdict = read_EFIT('../extract_info_from_EFIT/g1120907032.01012') #ITERDBdict = read_iterdb_x(sys.argv[1]) #EFITdict = read_EFIT(sys.argv[2]) if 1 == 1: plt.figure(figsize=(9, 3.5)) mid_ped = 0.97 mid_ped_ind = np.argmin(abs(ITERDBdict['rhot_te'] - mid_ped)) plt.plot(ITERDBdict['rhot_te'], ITERDBdict['te'] * 1E-3, linewidth=4.5, color='blue') plt.plot(ITERDBdict['rhot_ti'], ITERDBdict['ti'] * 1E-3, linewidth=4.5, color='red') plt.plot(ITERDBdict['rhot_ne'],