Commit 00af4df6 authored by Hannah Middleton's avatar Hannah Middleton
Browse files

fake data plotting script

parent a390e097
import numpy as np
import matplotlib
#matplotlib.use('Agg')
import matplotlib.pyplot as plt
#time prim ref filt#
data = np.genfromtxt('../../ARLS/here/filteredData.dat', names=True)
injectedData = np.genfromtxt('../../makeFakeData/data.dat',names=True)
injected = injectedData['injected']
import scipy.fftpack
print (data['prim'])
pf = scipy.fftpack.rfft(data['prim'])
ff = scipy.fftpack.rfft(data['filt'])
rf = scipy.fftpack.rfft(data['ref'])
injf = scipy.fftpack.rfft(injected)
T = data['time'][1]-data['time'][0]
sampleRate = int(1./T)
N=len(data['time'])
xf = scipy.fftpack.rfftfreq(N, 1/sampleRate)
plt.axvline(59.995)
plt.plot(xf,np.abs(pf),alpha=0.5)
plt.plot(xf,np.abs(ff),alpha=0.5)
plt.xlim(59.5,60.5)
#plt.plot(xf,np.abs(rf),alpha=0.5)
#plt.plot(xf,np.abs(injf),ls='--')
plt.show()
#
plt.clf()
plt.plot(xf, np.abs(pf)-np.abs(ff))
plt.xlim(59.5,60.5)
plt.show()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment