Skip to content
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

Using lombscargle in orbital dynamics - question to adjust parameters #11218

Open
gacarita opened this issue Jan 6, 2021 · 3 comments
Open

Comments

@gacarita
Copy link

gacarita commented Jan 6, 2021

Hi,

I am trying to use astropy.LombScargle in orbital dynamics to find resonances between giant planets and test particles, my orbits are not Keplerian and my integrator has adaptive time steps.

Running a test on an orbit that has a 1/1 resonance I found nothing close to 1/1 on the LS graphs.

Does anyone have any suggestions?

Here is my code:

ls = LombScargle(data_ptest_cartesian.t, data_ptest_cartesian.x,nterms=2)
ls1 = LombScargle(data_planet_cartesian.t, data_planet_cartesian.x,nterms=2)

freq,power = ls.autopower()

freq1,power1 = ls1.autopower()

plt.plot(freq, power,color="black")
plt.plot(freq1, power1,color="red")

image

I expected to see two central peaks very close together. I'm inserting the time and inertial cartesian coordinates for both bodys.

@pllim
Copy link
Member

pllim commented Jan 6, 2021

Thanks for reaching out! If you don't get replies here, you might want to try one of the mailing lists listed at https://www.astropy.org/help .

@adrn
Copy link
Member

adrn commented Jan 7, 2021

Hi @gabiruzo - Depending a bit on the context, LS (or at least the default, single-term LS) might not be the best approach here. Especially since you mention the orbits aren't Keplerian, there will be a few signals with different frequencies present in any cartesian coordinate you look at. So it might be helpful to consider doing something like orbital frequency analysis instead (e.g., http://github.com/adrn/superfreq). But I guess if you have non-uniform timesteps, you would either have to snap/interpolate your timesteps to a uniform grid, or would have to use something like a non-uniform Fourier transform instead (e.g., https://cims.nyu.edu/cmcl/nufft/nufft.html). If the frequency structure is simple, you might be able to get away with doing a multi-term LS...but I wouldn't count on it!

@gacarita
Copy link
Author

gacarita commented Jan 7, 2021

Hello @adrn

For my case of 3 bodies and I am finding different frequency values ​​for the 1/1 type resonances, what I expected with the ls was to observe the ratio relationship between my test particle and the secondary body, I know that these relations are not they must be exact but for each 1/1 resonance orbit I am getting different values ​​between the second body and the test particle.
I am using a simplification of my integrator to obtain equispaced steps to use fft but the results seem strange just like in ls.
I would like to test SuperFreq but I need to better understand how it works.

would you have any suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants