Skip to content

Instantly share code, notes, and snippets.

@yjroot
Forked from anonymous/FFT
Last active February 24, 2016 10:43
Show Gist options
  • Save yjroot/6247ee8f16e94a4d11a6 to your computer and use it in GitHub Desktop.
Save yjroot/6247ee8f16e94a4d11a6 to your computer and use it in GitHub Desktop.
import pylab as pl
import numpy as np
class FFT :
def __init__(self, file='data.csv'):
self.file=file
self.readFile()
def readFile(self) :
xy = np.loadtxt(self.file, delimiter=",", skiprows=1).transpose()
self.a = xy[4]
self.u = xy[5]
def U(self, angle):
return self.u[min(range(len(self.a)), key=lambda x: abs(self.a[x] - angle))]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment