23 KiB
Executable File
23 KiB
Executable File
In [2]:
import numpy as np
import h5py as h5py
import pandas as pd
import matplotlib.pyplot as plt
filename_z_position = "./z_positions.dat"
filename_B_field = "./Bz.dat"
z = np.genfromtxt(filename_z_position, dtype=float,
delimiter=",", usecols=(0))
Bz = np.genfromtxt(filename_B_field, dtype=float,
delimiter=",", usecols=(0))
Bz *= -1
In [3]:
deltaz = 500 # use only every 100th 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]In [4]:
data = np.column_stack((z_data,Bz_data))In [5]:
plt.plot(data[:,0], data[:,1])Out [5]:
[<matplotlib.lines.Line2D at 0x7f79d7b07c40>]
In [ ]: