LinkedEarth / Pyleoclim_util

Python Package for the Analysis of Paleoclimate Data. Documentation at
https://pyleoclim-util.readthedocs.io
GNU General Public License v3.0
87 stars 33 forks source link

Frequency axis for the Lomb-Scargle method #114

Closed CommonClimate closed 3 years ago

CommonClimate commented 3 years ago

Describe the bug L-S method shows a singularity at the Nyquist frequency.

To Reproduce generate a harmonic, evenly spaced series ts and apply ts.spectral(method = 'lomb_scargle). Expected behavior There should be no singularity at the Nyquist frequency Screenshots

image

Additional context Requires updating the method generating the frequency vector for the L-S method.

khider commented 3 years ago

Issue is due to unevenly vs evenly spaced signal for the last frequency point (regardless whether it's the Nyquist frequency).

See here: https://github.com/KnowledgeCaptureAndDiscovery/autoTS/blob/master/notebooks/Methods/Lomb%20Scargle%20Performance%20on%20Evenly%20Spaced%20Signal.ipynb

This is a problem with the original implementation rather than the Pyleoclim wrapper. Suggest putting a warning if the series is evenly-spaced that there might be a spurious value at high frequency end.

khider commented 3 years ago

Fixed in commit 715ac75