I’m trying to do a Fourier Transform using TVirtualFFT in PyROOT. Unfortunately the way to do this involves passing an Int_t * to the static TVirtualFFT::FFT function. I don’t know why it has to be an address of an integer instead of just the integer since it’s just an array size…but anyways PyROOT apparently doesn’t deal with it properly:
In [13]: n_size = g.GetN()+1
In [14]: fft_own = ROOT.TVirtualFFT.FFT(1,n_size,"R2C ES K")
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-14-54d40ffbd8cb> in <module>()
----> 1 fft_own = ROOT.TVirtualFFT.FFT(1,n_size,"R2C ES K")
TypeError: static TVirtualFFT* TVirtualFFT::FFT(Int_t ndim, Int_t* n, Option_t* option) =>
could not convert argument 2
Is there a standard way to use FFTs in PyROOT that I don’t know about? Note that I want to do a FFT of a voltage vs time TGraph (or the arrays inside the TGraph), not directly on a TH1.
Thanks,
Jean-François