This commit is contained in:
Jianshun Gao 2023-05-19 17:23:20 +02:00
parent 759f772976
commit 8fddd8bb21

View File

@ -8,18 +8,13 @@ import xrft
import finufft
class FFTAnalyser():
def __init__(self) -> None:
pass
def fft(self, dataArray, **kwargs):
def fft(dataArray, **kwargs):
return xrft.fft(dataArray, **kwargs)
def ifft(self, dataArray, **kwargs):
def ifft(dataArray, **kwargs):
return xrft.ifft(dataArray, **kwargs)
def fft_nutou(self, dataArray, modeNum):
def fft_nutou(dataArray, modeNum, **kwargs):
data = dataArray.to_numpy()
data = data.astype('complex128')
@ -41,7 +36,7 @@ class FFTAnalyser():
# calculate the transform
res = xr.DataArray(
data=finufft.nufft1d1(time, data, modeNum),
data=finufft.nufft1d1(time, data, modeNum, **kwargs),
dims=['freq'],
coords={
"freq":np.linspace(-freqUpLim/2, freqUpLim/2, modeNum)
@ -50,6 +45,6 @@ class FFTAnalyser():
return res
def ifft_nutou(self, dataArray, modeNum):
def ifft_nutou(dataArray, modeNum):
pass