Naming change in E_field_zero and cgs in plots

This commit is contained in:
Jonas Kellerer
2021-05-12 17:12:10 +02:00
parent 3223da11ba
commit 1c6f02a5ee
5 changed files with 31 additions and 1000009 deletions
@@ -13,8 +13,8 @@ def plotCurrentRVsR(filename_current, filename_density, output_folder, z_pos):
prop_cycle = plt.rcParams['axes.prop_cycle']
colors = prop_cycle.by_key()['color']
e_dict = {"key" : "/e-", "linestyle": '-', "label": "e"}
T3_dict = {"key" : "/T3+", "linestyle": '--', "label": "T3+"}
e_dict = {"key" : "/e-", "linestyle": '+-', "label": "e"}
T3_dict = {"key" : "/T3+", "linestyle": '.-', "label": "T3+"}
dicts = [e_dict, T3_dict]
fig, ax = plt.subplots(figsize=pst.set_size('thesis'))
@@ -27,14 +27,12 @@ def plotCurrentRVsR(filename_current, filename_density, output_folder, z_pos):
z_bin = np.abs((z_bins-z_pos)).argmin()
plot_data = np.sum(j_total_r,2)[:,z_bin]
x_mins = r_bins[:-1]
x_maxs = r_bins[1:]
plot_bins, plot_datas = cc.makeBarPlotData(plot_data, x_mins, x_maxs)
plot_x = r_bins[1:]
ax.plot(plot_bins, plot_datas, linestyle=d["linestyle"], label=d["label"])
ax.plot(plot_x*100, plot_data*1E-4, linestyle=d["linestyle"], label=d["label"])
ax.set_xlabel(r"Radius $r$ [m]")
ax.set_ylabel(r"Particle Current $j_r$ [$m^{-2}s^{-1}$]")
ax.set_xlabel(r"Radius $r$ [cm]")
ax.set_ylabel(r"Particle Current $j_r$ [$cm^{-2}s^{-1}$]")
ax.set_facecolor('#e7e7e7ff')
ax.grid(color='white')
@@ -0,0 +1,25 @@
import numpy as np
import h5py as h5py
import os
import sys
import matplotlib
import matplotlib.pyplot as plt
nr = 1
nz = 1
filename = "/home/jonas/new_workspace/Coding/KARL/karl/src/karl/data/E_field_zero.h5"
Efield_r = np.zeros((nr, nz))
Efield_z = np.zeros((nr, nz))
f = h5py.File(filename, 'w')
key_Er = "/Efield/efield_r"
key_Ez = "/Efield/efield_z"
f.create_dataset(key_Er, data=Efield_r, dtype=float)
f.create_dataset(key_Ez, data=Efield_z, dtype=float)
f.close()