analyisis scripts
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
import numpy as np
|
||||
|
||||
from functions.calculate_currents_from_karl import *
|
||||
from functions.calculate_density_from_karl import *
|
||||
import functions.plot_standards as pst
|
||||
|
||||
|
||||
def currentToCsv(filename_densities, filename_currents, filename_output_prefix):
|
||||
|
||||
si_to_cgs = 1E-4
|
||||
e_statC = 4.80320425E-10
|
||||
|
||||
T3 = {
|
||||
"key": "/T3+",
|
||||
"filename_suffix": "_T3.csv",
|
||||
"header": "current T3+ (statC/cm^-2 s^-1), r to left, z to bottom"}
|
||||
e = {
|
||||
"key": "/e-",
|
||||
"filename_suffix": "_e.csv",
|
||||
"header": "current e- (statC/cm^-2 s^-1), r to left, z to bottom"}
|
||||
T2 = {
|
||||
"key": "/T2+",
|
||||
"filename_suffix": "_T2.csv",
|
||||
"header": "current T2+ (statC/cm^-2 s^-1), r to left, z to bottom"}
|
||||
T = {
|
||||
"key": "/T+",
|
||||
"filename_suffix": "_T.csv",
|
||||
"header": "current T+ (statC/cm^-2 s^-1), r to left, z to bottom"}
|
||||
|
||||
dicts = [e, T, T2, T3]
|
||||
|
||||
for d in dicts:
|
||||
total_current = particleCurrentZ(filename_currents, filename_densities, d["key"])
|
||||
current = np.sum(total_current,2)*si_to_cgs*e_statC
|
||||
|
||||
filename_output = filename_output_prefix + d["filename_suffix"]
|
||||
np.savetxt(
|
||||
filename_output,
|
||||
np.transpose(current),
|
||||
delimiter=",",
|
||||
header=d["header"])
|
||||
|
||||
Reference in New Issue
Block a user