Version 2, position dependent E/B, kinetic ions, boris mover, terminator
This commit is contained in:
Binary file not shown.
Executable
+1000000
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,42 @@
|
||||
import numpy as np
|
||||
import h5py as h5py
|
||||
import pandas as pd
|
||||
|
||||
|
||||
def writeData(data, output_filename):
|
||||
file = h5py.File(output_filename, "w")
|
||||
|
||||
file.create_dataset("z_position(m)", data=data[:, 0])
|
||||
file.create_dataset("B(T)", data=data[:, 1])
|
||||
|
||||
file.close()
|
||||
|
||||
|
||||
def createApproximateMagneticField(filename_z_position, filename_B_field):
|
||||
z = np.genfromtxt(filename_z_position, dtype=float,
|
||||
delimiter=",", usecols=(0))
|
||||
Bz = np.genfromtxt(filename_B_field, dtype=float,
|
||||
delimiter=",", usecols=(0))
|
||||
|
||||
Bz *= -1
|
||||
|
||||
deltaz = 500 # use only every 500th datapoint
|
||||
position_rw = 47.2
|
||||
z_data = z[0::deltaz] + position_rw
|
||||
Bz_data = Bz[0::deltaz]
|
||||
|
||||
Bz_data = Bz_data[z_data > 0]
|
||||
z_data = z_data[z_data > 0]
|
||||
|
||||
data = np.column_stack((z_data, Bz_data))
|
||||
|
||||
return data
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
output_filename = "./B_vs_z_kassiopeia_approximated.h5"
|
||||
filename_z_position = "./z_positions.dat"
|
||||
filename_B_field = "./Bz.dat"
|
||||
writeData(createApproximateMagneticField(
|
||||
filename_z_position, filename_B_field), output_filename)
|
||||
+117
File diff suppressed because one or more lines are too long
+1000000
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user