New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ACF_scargle fails #74
Comments
Hi – it's failing for you when you run the example code directly, or just when you use your own data? If you're getting bad results from the window function, I imagine it's because the data is being centered first. This application is why both astroML and gatspy have an option to turn-off centering when computing the periodogram (in gatpsy, set Let me know if that fixes your issue. |
Strange... are you on Python 2 or 3? It might be due to some sort of division truncation error, but I'm not sure. I'm stumped right now. |
I'm using Python 2.7.9, Anaconda 2.2.0, 64-bit. On actual data the lomb_scargle functions run just fine, it's just in this particular case with all ones that it's failing, if that helps at all |
I can't reproduce this. I ran the following on all versions of Python with all versions of the libraries: import numpy as np
from astroML.time_series import lomb_scargle
N = 100
t = np.sort(1000 * np.random.random(N))
y = np.ones(N)
dy = 0.1 * np.ones(N)
omega = np.linspace(0.1, 100)
P = lomb_scargle(t, y, dy, omega, generalized=False, subtract_mean=False)
print(P) The result contains no NANs or infs. Is there any way you can use a debugger to figure out exactly where the infs are entering the calculation? |
@jakevdp - I have the same problem on python2.7 (with setups of 2.7.6 on Ubuntu 14 and 2.7.10 on Yosemite). However it only occurs when In your example also fails (with the addons):
|
Ah... thanks @bsipocz! It must be some issue in the cython code in addons. I'll try to figure it out. |
Actually, I think that this might already be fixed in this commit: astroML/astroML_addons@300297c |
@jakevdp - I should have had mention that I've tried it with the latest addons (both master and 0.2.2), and also with the previous 0.2.1 version. All versions have this bug. |
I'm trying to run the example from http://www.astroml.org/book_figures/chapter10/fig_autocorrelation.html, but the ACF_scargle function is failing and returning all NaNs. The issue seems to be coming up when computing the power of the window function, which returns all infs. I tried computing a similar periodogram (random times, y=1 everywhere), and had similar results from the astroML and gatspy functions:
Those yield an array of infs and an array of NaNs, respectively. Is this coming from the functions themselves, or the inputs?
I'm using astroML v. 0.3 and gatspy version 0.2, for reference.
The text was updated successfully, but these errors were encountered: