Skip to content
Snippets Groups Projects
Commit 0baf8b87 authored by sniklas142's avatar sniklas142
Browse files

restructured field plot

parent 54c10a82
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,6 @@ def plot_spectrum():
plt.figure(0)
plt.plot(trace)
plt.plot(x,fivethird(x))
plt.show()
def plot_histogram():
f = h5py.File('test_ou_output.h5','r')
......@@ -29,10 +28,9 @@ def plot_histogram():
plt.plot(x_vel)
plt.plot(y_vel)
plt.plot(z_vel)
plt.show()
def plot_field():
f = h5py.File('ou_field.h5','r')
def plot_field(file_name):
f = h5py.File(file_name,'r')
dset = np.array(f['ou_field/real/0'])
x_vel = dset[:,:,:,0]
y_vel = dset[:,:,:,1]
......@@ -40,10 +38,27 @@ def plot_field():
plt.figure(2)
plt.imshow(x_vel[:,:,15])
plt.colorbar()
plt.show()
class plot_field:
def __init__(self):
self.count = 2;
def plot(self,file_name):
f = h5py.File(file_name,'r')
dset = np.array(f['ou_field/real/0'])
x_vel = dset[:,:,:,0]
y_vel = dset[:,:,:,1]
z_vel = dset[:,:,:,2]
plt.figure(self.count)
plt.imshow(x_vel[:,:,15])
plt.colorbar()
self.count+=1
# plot_spectrum()
# plot_histogram()
plot_field()
p = plot_field()
p.plot('ou_field.h5')
p.plot('add_ou_test_field.h5')
plt.show()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment