BUG: signal: Division by zero in lombscargle #3787
Labels
defect
A clear bug or issue that prevents SciPy from being installed or used as expected
good first issue
Good topic for first contributor pull requests, with a relatively straightforward solution
scipy.signal
Milestone
This problem was reported on stackoverflow: http://stackoverflow.com/questions/24702807/lomb-scargle-vs-fft-power-spectrum-crashes-with-evenly-spaced-data/
Here's a self-contained example:
The problem is that
lombscargle
includes the calculationatan(2 * cs / (cc - ss))
, but it is possible forcc - ss
to be 0.The fix is easy: replace
atan(2 * cs / (cc - ss))
withatan2(2 * cs, cc - ss)
.The text was updated successfully, but these errors were encountered: