backup save
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
import numpy as np
|
||||
import os
|
||||
import sys
|
||||
from astropy import units as u
|
||||
import matplotlib
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
homebase = os.getenv('HOMEBASE')
|
||||
if homebase == None:
|
||||
homebase = "/home/jonas/new_workspace/Coding/ACRONYM/acronym"
|
||||
|
||||
includes = homebase + "/src/grpic/boundaries_3d"
|
||||
|
||||
sys.path.append(includes)
|
||||
|
||||
import precalculation.functions.plasmaFunctions as plasmaFuncs
|
||||
import analysis.plotDataFromAcronym.plot_standards as pltStd
|
||||
|
||||
import precalculation.functions.importDataFromKarl as karl
|
||||
|
||||
# Input
|
||||
# =======================
|
||||
|
||||
thesis_path = "/home/jonas/new_workspace/notes/katrin-plasma/docs/phd/jkellerer"
|
||||
output_file = thesis_path+"/fig/Chapter4_KARL/ZeroElectricFieldCase/current.pdf"
|
||||
|
||||
karl_data_dir = "/home/jonas/new_workspace/Coding/KARL/calcs/thesis_plots/sim_data/sim1/"
|
||||
karl_filename = "df_part_e.csv"
|
||||
|
||||
# Calculation
|
||||
# =======================
|
||||
|
||||
data = karl.KarlParticleData(karl_data_dir, karl_filename)
|
||||
current_distribution_center = data.getCurrentDistribution(z_pos=3)
|
||||
current_distribution_rw = data.getCurrentDistribution(z_pos=-3)
|
||||
|
||||
energies = current_distribution_center['Emid']
|
||||
current_center = current_distribution_center['j'] *1E-4
|
||||
current_center_neg = current_center * -1
|
||||
|
||||
current_rw = current_distribution_rw['j'] * 1E-4
|
||||
|
||||
|
||||
# Plot
|
||||
# =======================
|
||||
|
||||
pltStd.setRcParams()
|
||||
prop_cycle = plt.rcParams['axes.prop_cycle']
|
||||
colors = prop_cycle.by_key()['color']
|
||||
|
||||
(width, height) = pltStd.set_size('thesis')
|
||||
fig, ax = plt.subplots(1, 1, figsize=(width, height))
|
||||
|
||||
#data.plotDensityDistribution(fig=fig, ax=ax)
|
||||
|
||||
ax.plot(energies, current_rw, label='Rearwall')
|
||||
|
||||
ax.plot(energies, current_center, '--', label='Center pos.')
|
||||
#ax.plot(energies, current_center_neg, 'o', label='Center neg.')
|
||||
|
||||
|
||||
|
||||
ax.set_xscale('log')
|
||||
ax.set_yscale('log')
|
||||
ax.set_xlabel(r'Energy $E$ [eV]')
|
||||
ax.set_ylabel(r'Current distribution $\frac{\partial j}{\partial E}$ $\left[ \frac{1}{cm^2 eV}\right]$')
|
||||
|
||||
ax.legend()
|
||||
|
||||
plt.show()
|
||||
|
||||
fig.savefig(output_file,bbox_inches='tight')
|
||||
@@ -0,0 +1,65 @@
|
||||
import numpy as np
|
||||
import os
|
||||
import sys
|
||||
from astropy import units as u
|
||||
import matplotlib
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
homebase = os.getenv('HOMEBASE')
|
||||
if homebase == None:
|
||||
homebase = "/home/jonas/new_workspace/Coding/ACRONYM/acronym"
|
||||
|
||||
includes = homebase + "/src/grpic/boundaries_3d"
|
||||
|
||||
sys.path.append(includes)
|
||||
|
||||
import precalculation.functions.plasmaFunctions as plasmaFuncs
|
||||
import analysis.plotDataFromAcronym.plot_standards as pltStd
|
||||
|
||||
import precalculation.functions.importDataFromKarl as karl
|
||||
|
||||
# Input
|
||||
# =======================
|
||||
|
||||
thesis_path = "/home/jonas/new_workspace/notes/katrin-plasma/docs/phd/jkellerer"
|
||||
output_file = thesis_path+"/fig/Chapter4_KARL/ZeroElectricFieldCase/density.pdf"
|
||||
|
||||
karl_data_dir = "/home/jonas/new_workspace/Coding/KARL/calcs/thesis_plots/sim_data/sim1/"
|
||||
karl_filename = "df_part_e.csv"
|
||||
|
||||
# Calculation
|
||||
# =======================
|
||||
|
||||
data = karl.KarlParticleData(karl_data_dir, karl_filename)
|
||||
density_distribution_center = data.getDensityDistribution(z_pos=5)
|
||||
density_distribution_rw = data.getDensityDistribution(z_pos=-3)
|
||||
|
||||
energies = density_distribution_center['Emid']
|
||||
densities_center = density_distribution_center['n'] * 1E-6
|
||||
densities_rw = density_distribution_rw['n'] * 1E-6
|
||||
|
||||
# Plot
|
||||
# =======================
|
||||
|
||||
pltStd.setRcParams()
|
||||
prop_cycle = plt.rcParams['axes.prop_cycle']
|
||||
colors = prop_cycle.by_key()['color']
|
||||
|
||||
(width, height) = pltStd.set_size('thesis')
|
||||
fig, ax = plt.subplots(1, 1, figsize=(width, height))
|
||||
|
||||
#data.plotDensityDistribution(fig=fig, ax=ax)
|
||||
|
||||
ax.plot(energies, densities_center, label='Center')
|
||||
ax.plot(energies, densities_rw, label='Rearwall')
|
||||
|
||||
ax.set_xscale('log')
|
||||
ax.set_yscale('log')
|
||||
ax.set_xlabel(r'Energy $E$ [eV]')
|
||||
ax.set_ylabel(r'Density distribution $\frac{\partial n}{\partial E}$ $\left[ \frac{1}{cm^3 eV}\right]$')
|
||||
|
||||
ax.legend()
|
||||
|
||||
plt.show()
|
||||
|
||||
fig.savefig(output_file,bbox_inches='tight')
|
||||
@@ -0,0 +1,76 @@
|
||||
import numpy as np
|
||||
import os
|
||||
import sys
|
||||
from astropy import units as u
|
||||
import matplotlib
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
homebase = os.getenv('HOMEBASE')
|
||||
if homebase == None:
|
||||
homebase = "/home/jonas/new_workspace/Coding/ACRONYM/acronym"
|
||||
|
||||
includes = homebase + "/src/grpic/boundaries_3d"
|
||||
|
||||
sys.path.append(includes)
|
||||
|
||||
import precalculation.functions.plasmaFunctions as plasmaFuncs
|
||||
import analysis.plotDataFromAcronym.plot_standards as pltStd
|
||||
|
||||
import precalculation.functions.importDataFromKarl as karl
|
||||
|
||||
# Input
|
||||
# =======================
|
||||
|
||||
thesis_path = "/home/jonas/new_workspace/notes/katrin-plasma/docs/phd/jkellerer"
|
||||
output_file = thesis_path+"/fig/Chapter4_KARL/ZeroElectricFieldCase/density_vs_z.pdf"
|
||||
|
||||
karl_data_dir = "/home/jonas/new_workspace/Coding/KARL/calcs/thesis_plots/sim_data/sim1/"
|
||||
karl_filename = "df_part_e.csv"
|
||||
|
||||
# Calculation
|
||||
# =======================
|
||||
|
||||
data = karl.KarlParticleData(karl_data_dir, karl_filename)
|
||||
|
||||
z_positions = np.arange(-3, 11, 1)
|
||||
densities_e_total = np.zeros_like(z_positions)
|
||||
densities_e_beta = np.zeros_like(z_positions)
|
||||
densities_e_thermal = np.zeros_like(z_positions)
|
||||
densities_e_nonthermal = np.zeros_like(z_positions)
|
||||
|
||||
for i,z_pos in enumerate(z_positions):
|
||||
densities_e_total[i] = data.getDensity(z_pos=z_pos).value * 1E-6
|
||||
densities_e_nonthermal[i] = data.getDensity(z_pos=z_pos,energy_range=[1E-1, 1E1]).value * 1E-6
|
||||
densities_e_beta[i] = data.getDensity(z_pos=z_pos, energy_range=[1E1, 20E4]).value * 1E-6
|
||||
densities_e_thermal[i] = data.getDensity(z_pos=z_pos, energy_range=[0., 1E-1]).value * 1E-6
|
||||
|
||||
|
||||
# Plot
|
||||
# =======================
|
||||
|
||||
pltStd.setRcParams()
|
||||
prop_cycle = plt.rcParams['axes.prop_cycle']
|
||||
colors = prop_cycle.by_key()['color']
|
||||
|
||||
(width, height) = pltStd.set_size('thesis')
|
||||
fig, ax = plt.subplots(1, 1, figsize=(width, height))
|
||||
|
||||
|
||||
#ax.plot(z_positions+3, densities_e_total, label=r'e$^-$')
|
||||
ax.plot(z_positions+3, densities_e_thermal, label=r'e$^- \left(E<0.1\,eV\right)$')
|
||||
ax.plot(z_positions+3, densities_e_nonthermal, label=r'e$^- (0.1\, eV < E < 10\,eV)$')
|
||||
ax.plot(z_positions+3, densities_e_beta, label=r'e$^- (E>10\,eV)$')
|
||||
|
||||
|
||||
ax.plot(z_positions+3, densities_e_thermal*0.5,'--', label=r'T$^+_n$')
|
||||
|
||||
|
||||
ax.set_yscale('log')
|
||||
ax.set_xlabel(r'Position $z$ [m]')
|
||||
ax.set_ylabel(r'Density $n$ $\left[ \frac{1}{cm^3}\right]$')
|
||||
#ax.set_ylim((1E4, 1E8))
|
||||
ax.legend(loc="lower right")
|
||||
|
||||
plt.show()
|
||||
|
||||
fig.savefig(output_file,bbox_inches='tight')
|
||||
@@ -0,0 +1,72 @@
|
||||
import numpy as np
|
||||
import os
|
||||
import sys
|
||||
from astropy import units as u
|
||||
import matplotlib
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
homebase = os.getenv('HOMEBASE')
|
||||
if homebase == None:
|
||||
homebase = "/home/jonas/new_workspace/Coding/ACRONYM/acronym"
|
||||
|
||||
includes = homebase + "/src/grpic/boundaries_3d"
|
||||
|
||||
sys.path.append(includes)
|
||||
|
||||
import precalculation.functions.plasmaFunctions as plasmaFuncs
|
||||
import analysis.plotDataFromAcronym.plot_standards as pltStd
|
||||
|
||||
import precalculation.functions.importDataFromKarl as karl
|
||||
|
||||
# Input
|
||||
# =======================
|
||||
|
||||
thesis_path = "/home/jonas/new_workspace/notes/katrin-plasma/docs/phd/jkellerer"
|
||||
output_file = thesis_path+"/fig/Chapter4_KARL/ZeroElectricFieldCase/energy_density.pdf"
|
||||
|
||||
karl_data_dir = "/home/jonas/new_workspace/Coding/KARL/calcs/thesis_plots/sim_data/sim1/"
|
||||
karl_filename = "df_part_e.csv"
|
||||
|
||||
# Calculation
|
||||
# =======================
|
||||
|
||||
data = karl.KarlParticleData(karl_data_dir, karl_filename)
|
||||
energy_distribution_center = data.getEnergyDensityDistribution(z_pos=3)
|
||||
energy_distribution_rw = data.getEnergyDensityDistribution(z_pos=-3)
|
||||
|
||||
energies = energy_distribution_center['Emid']
|
||||
energy_center = energy_distribution_center['energydensity'] * 1E-6
|
||||
|
||||
energy_rw = energy_distribution_rw['energydensity'] * 1E-6
|
||||
|
||||
|
||||
# Plot
|
||||
# =======================
|
||||
|
||||
pltStd.setRcParams()
|
||||
prop_cycle = plt.rcParams['axes.prop_cycle']
|
||||
colors = prop_cycle.by_key()['color']
|
||||
|
||||
(width, height) = pltStd.set_size('thesis')
|
||||
fig, ax = plt.subplots(1, 1, figsize=(width, height))
|
||||
|
||||
#data.plotDensityDistribution(fig=fig, ax=ax)
|
||||
|
||||
ax.plot(energies, energy_center, '-', label='Center')
|
||||
ax.plot(energies, energy_rw, '--', label='Rearwall')
|
||||
|
||||
|
||||
#ax.plot(energies, current_center_neg, 'o', label='Center neg.')
|
||||
|
||||
|
||||
|
||||
ax.set_xscale('log')
|
||||
ax.set_yscale('log')
|
||||
ax.set_xlabel(r'Energy $E$ [eV]')
|
||||
ax.set_ylabel(r'Energy density distribution $u$ $\left[ \frac{eV}{cm^3 eV}\right]$')
|
||||
|
||||
ax.legend()
|
||||
|
||||
plt.show()
|
||||
|
||||
fig.savefig(output_file,bbox_inches='tight')
|
||||
Reference in New Issue
Block a user