[AstroPy] timeing analysis(scipy.fftpack)

Matteo matteo at matteobachetti.it
Thu Oct 22 06:18:57 EDT 2015


Hi Hang,


> L-S and FFT should get a similar result  if we 'treat' the data correctly?
>
In principle yes.


> Using the same regularly sampled data, I meet artifacts generated by some
> method, but this kind of artifact does not necessarily appear in some other
> method.
>
Artifacts might be given by a number of different effects. What kinds of
artifacts are you talking about? Harmonics? Peaks at regular frequencies?
Do you have gaps in your time series?

Can you provide a minimum working example with a few lines of the code used
to calculate the spectra and a sample data file? If you have proprietary
data problems, you can simulate them. Copy and paste some code from this
iPython notebook if you want (Section Finding pulsars: the buried clock):
https://bitbucket.org/mbachett/timing-lectures/src/8ac9774f2c8a8d33e8f214af0045801ced32f539/Pulsar_Timing.ipynb?at=master&fileviewer=file-view-default

Cheers,
Matteo



>
> Hang
>
> On Thu, Oct 22, 2015 at 3:20 PM, Matteo <matteo at matteobachetti.it> wrote:
>
>> Hi Hang,
>> that plot does not measure significance but just the value of the FFT. In
>> the real world, significance depends also on the uncertainties of the time
>> series. For example, for event data (and Poisson-distributed light curves)
>> people often calculate the power density spectrum (|FFT|^2) and normalize
>> it by 2 / <number of photons>. Then, significances are calculated based on
>> the chi^2 statistics (Leahy et al. '83).
>>
>> For the comparison between L-S and fft, it's difficult to answer without
>> at least some example data. Do you take the square modulus of the FFT? Do
>> you use an irregular sampling? Do you have gaps in data? How do you
>> normalize the periodograms?  Etc.
>> e.g.
>> http://stackoverflow.com/questions/20658318/my-power-spectra-are-believable-a-comparison-between-lomb-scargle-and-fft-scip
>>
>> Cheers,
>>
>> Matteo
>>
>>
>> PS: for X-ray timing analysis, you can take a look at
>> http://maltpynt.readthedocs.org
>>
>>
>> On Thu, Oct 22, 2015 at 6:21 AM, gonghang.naoc <ghang.naoc at gmail.com>
>> wrote:
>>
>>> Hi all,
>>> Does anyone use scipy.fftpack to do power spectrum for time series?
>>> Its doc file is here:
>>> http://docs.scipy.org/doc/scipy-0.14.0/reference/tutorial/fftpack.html
>>>
>>> What does the y axis in figure 1 and figure 2 mean? In Figure 1, it
>>> seems y axis does not  stand for the sifnificane at least.
>>>
>>> Besides FFT, I use Lomb-Scargle to do timing analysis, and find there is
>>> a big difference between the significance given by L-S and fft. Significant
>>> peaks which appear in L-S do not necessarily appear in FFT.
>>> Which method should I believe then?
>>>
>>> Thank you.
>>> regards
>>> Hang
>>>
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> AstroPy mailing list
>>> AstroPy at scipy.org
>>> https://mail.scipy.org/mailman/listinfo/astropy
>>>
>>>
>>
>>
>> --
>> *********************************************
>> Matteo Bachetti
>>
>> www.matteobachetti.it
>>
>> "I would love to change the world,
>> but they won't give me the source code"
>> *********************************************
>>
>> _______________________________________________
>> AstroPy mailing list
>> AstroPy at scipy.org
>> https://mail.scipy.org/mailman/listinfo/astropy
>>
>>
>
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> https://mail.scipy.org/mailman/listinfo/astropy
>
>


-- 
*********************************************
Matteo Bachetti

www.matteobachetti.it

"I would love to change the world,
but they won't give me the source code"
*********************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20151022/53eabb73/attachment.html>


More information about the AstroPy mailing list