Skip to content
Snippets Groups Projects
Commit 284ad24d authored by sniklas142's avatar sniklas142
Browse files

can plot histogram now

parent e9fecfa5
No related branches found
No related tags found
No related merge requests found
......@@ -2,29 +2,36 @@ import numpy as np
import h5py
import matplotlib.pyplot as plt
f = h5py.File('test_ou_output.h5','r')
dset = np.array(f['spectra/ou_spectra'])
print(dset.shape)
s = dset.reshape((300,3,3))
print('shape of s is {}'.format(s.shape))
trace = s[:,0,0] + s[:,1,1] + s[:,2,2]
print('shape of trace is {}'.format(trace.shape))
x = np.linspace(1,300,10000)
fivethird = lambda t: t**(-5./3.)
plt.figure(0)
plt.plot(trace)
plt.plot(x,fivethird(x))
plt.show()
def plot_spectrum():
f = h5py.File('test_ou_output.h5','r')
dset = np.array(f['spectra/ou_spectra'])
s = dset.reshape((300,3,3))
print('shape of s is {}'.format(s.shape))
trace = s[:,0,0] + s[:,1,1] + s[:,2,2]
print('shape of trace is {}'.format(trace.shape))
x = np.linspace(1,300,10000)
fivethird = lambda t: t**(-5./3.)
plt.figure(0)
plt.plot(trace)
plt.plot(x,fivethird(x))
plt.show()
def plot_histogram():
f = h5py.File('test_ou_output.h5','r')
dset = np.array(f['histograms/ou'])
x_vel = dset[0,:,0]
y_vel = dset[0,:,1]
z_vel = dset[0,:,2]
plt.figure(1)
plt.plot(x_vel)
plt.plot(y_vel)
plt.plot(z_vel)
plt.show()
# plot_spectrum()
# plot_histogram()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment