backup save

This commit is contained in:
Jonas Kellerer
2021-03-04 11:47:03 +01:00
parent e7c298983e
commit 9e5c2f068f
241 changed files with 2354544 additions and 319 deletions
@@ -0,0 +1,70 @@
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
# Input
# =======================
thesis_path = "/home/jonas/new_workspace/notes/katrin-plasma/docs/phd/jkellerer"
output_file = thesis_path+"/fig/Chapter5_ACRONYM/ParticleInjection/pml_far_field.pdf"
# Calculation
# =======================
zs = np.arange(0,30)
d_inj0 = np.ones_like(zs)
d_inj0[0] = -10
d_inj0[1] = -5
d_inj2_rel = np.ones_like(zs)/d_inj0
d_inj5_rel = 2*np.ones_like(zs)/d_inj0
d_inj8_rel = 3*np.ones_like(zs)/d_inj0
d_inj10_rel = 4*np.ones_like(zs)/d_inj0
# Plot
# =======================
pltStd.setRcParams()
prop_cycle = plt.rcParams['axes.prop_cycle']
colors = prop_cycle.by_key()['color']
(width, height) = pltStd.set_size('thesis')
fig, (ax0, ax1) = plt.subplots(2, 1, figsize=(width, height))
ax0.set_ylabel(r'Electric field $E$ $\left[\frac{V}{cm}\right]$')
ax0.plot(zs, d_inj0, '-', label=r'$d_{inj} = 0 dx$')
ax0.legend()
ax1.plot(zs, d_inj2_rel, '--', label=r'$d_{inj} = 2 dx$', color=colors[1])
ax1.plot(zs, d_inj5_rel, '-.', label=r'$d_{inj} = 5 dx$', color=colors[2])
ax1.plot(zs, d_inj8_rel, ':', label=r'$d_{inj} = 8 dx$', color=colors[3])
ax1.plot(zs, d_inj10_rel, linestyle=(0, (3, 5, 1, 5, 1, 5)), label=r'$d_{inj} = 10 dx$', color=colors[4])
ax1.set_xlabel(r'Position $z$ [dx]')
ax1.set_ylabel(r'rel. electric field $\frac{E}{E_0}$')
ax1.legend()
plt.show()
fig.savefig(output_file,bbox_inches='tight')
@@ -0,0 +1,59 @@
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
# Input
# =======================
thesis_path = "/home/jonas/new_workspace/notes/katrin-plasma/docs/phd/jkellerer"
output_file = thesis_path+"/fig/Chapter5_ACRONYM/ParticleInjection/pml_near_field.pdf"
# Calculation
# =======================
zs = np.arange(180,200)
d_inj0 = np.log(200-zs)*1
d_inj2 = np.log(200-zs)*2
d_inj5 = np.log(200-zs)*3
d_inj8 = np.log(200-zs)*4
d_inj10 = np.log(200-zs)*5
# 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.set_ylabel(r'Electric field $E$ $\left[\frac{V}{cm}\right]$')
ax.set_xlabel(r'Position $z - z_0$ [dx]')
ax.plot(zs - 200, d_inj0, '-', label=r'$d_{inj} = 0 dx$')
ax.plot(zs - 200, d_inj2, '--', label=r'$d_{inj} = 2 dx$')
ax.plot(zs - 200, d_inj5, '-.', label=r'$d_{inj} = 5 dx$')
ax.plot(zs - 200, d_inj8, ':', label=r'$d_{inj} = 8 dx$')
ax.plot(zs - 200, d_inj10, linestyle=(0, (3, 5, 1, 5, 1, 5)), label=r'$d_{inj} = 10 dx$')
ax.legend()
plt.show()
fig.savefig(output_file,bbox_inches='tight')