resonances

A python package for identification of mean-motion resonances in the Solar system and other planetary systems.

https://github.com/smirik/resonances

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 12 DOI reference(s) in README
  • Academic publication links
    Links to: sciencedirect.com
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (17.0%) to scientific vocabulary

Keywords

astronomy mean-motion-resonance secular-resonance solar-system-simulation
Last synced: 6 months ago · JSON representation ·

Repository

A python package for identification of mean-motion resonances in the Solar system and other planetary systems.

Basic Info
  • Host: GitHub
  • Owner: smirik
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 10.5 MB
Statistics
  • Stars: 9
  • Watchers: 2
  • Forks: 2
  • Open Issues: 2
  • Releases: 0
Topics
astronomy mean-motion-resonance secular-resonance solar-system-simulation
Created over 4 years ago · Last pushed 6 months ago
Metadata Files
Readme License Citation

README.md

Mean-Motion Resonances

Code style: black Resonances

resonances is an open-source package dedicated to the identification of mean-motion resonances of small bodies. Many examples are for the Solar system; however, you might use the package for any possible planetary system, including exoplanets.

For more information, read the documentation.

Note: while this app has many functional and integration tests built in, it is still in the dev stage. Hence, it might include some inconsistencies. So, any community help is appreciated!

What's new

June 2025

  1. Clean Architecture Implementation: The Simulation class has been completely refactored into a clean, component-based architecture without backward compatibility concerns. The main simulation.py file has been reduced by 67% (from 613 to 204 lines) by removing unnecessary setters/getters and moving specialized functionality into dedicated components: SimulationConfig, BodyManager, IntegrationEngine, and DataManager.
  2. Modern Configuration Syntax: Configuration parameters are now accessed using the clean sim.config.property syntax (e.g., sim.config.dt = 0.1, sim.config.save = 'all'). Essential properties needed by external modules (like libration analysis) are still available directly on the simulation object.
  3. Comprehensive Test Refactoring: All tests have been updated to use the new clean architecture, with 46 simulation component tests passing, ensuring the refactoring maintains full functionality while improving code quality.

February 2025

  1. Full support for nasa Horizon source of the initial data.
  2. find and check methods for quick identification of the resonant status of objects.
  3. create_mmr method now supports variaty of options: string, a list of strings, an object, a list of objects.
  4. Simulation constructor got many new parameters allowing to change the settings directly when instantiating.
  5. Instead of config.json, .env.dist is now used. Furthermore, a developer can specify .env in the directory, which will overwrite the default parameters or just use environment variables.
  6. MMRs now have order function.
  7. Added full support for backward integration (dt=-1.0, tmax=-600000).
  8. Minor updates to graphs.

October 2024

  1. The resonances.find method now accepts extra parameters: name, sigma2, and sigma3, see the documentation.
  2. Fixed bug with wrong titles on the plots (periodograms for the resonant angle and semi-major axis).
  3. Fixed bug when adding an asteroid that has no relevant MMRs (previously it caused exception).

July 2024

  1. Now you can choose the type of the output image: it could be either pdforpng`.

python sim = resonances.Simulation() ... sim.image_type = 'pdf'

  1. You can plot only resonant asteroids:

python sim = resonances.Simulation() ... sim.plot_only_identified = True

If it is true, then the app will plot every resonant asteroid even if plot is False. If plot is True, this option is ignored.

  1. New finder module (easy resonance identification):

```python import resonances

sim = resonances.find([463, 490], planets=['Mars', 'Jupiter', 'Saturn']) sim.run() ```

Features

The package:

  • can automatically identify two-body and three-body mean-motion resonance in the Solar system,
  • accurately differentiates different types of resonances (pure, transient, uncertain),
  • provides an interface for mass tasks (i.e. find resonant areas in a planetary system),
  • can plot time series and periodograms,
  • and, yeah, it is well tested ;)

It actively uses REBOUND integrator maintained by Hanno Rein and others.

Installation

To install resonances on your system, follow the instructions on the appropriate installation guide

Mean-motion resonances

For those who are not familiar with the mean-motion resonances, here is the list of papers used to develop this package:

Papers about the automatic identification of resonant asteroids

  1. Smirnov, E. A. & Dovgalev, I. S. Identification of Asteroids in Two-Body Resonances. Solar System Research 52, 347–354 (2018).
  2. Smirnov, E. A. (2023). A new python package for identifying celestial bodies trapped in mean-motion resonances. Astronomy and Computing, 100707. https://doi.org/10.1016/j.ascom.2023.100707
  3. Smirnov, E. A. & Shevchenko, I. I. Massive identification of asteroids in three-body resonances. Icarus 222, 220–228 (2013).
  4. Smirnov, E. A., Dovgalev, I. S. & Popova, E. A. Asteroids in three-body mean motion resonances with planets. Icarus (2017) doi:10.1016/j.icarus.2017.09.032.
  5. Nesvorný, D. & Morbidelli, A. Three-Body Mean Motion Resonances and the Chaotic Structure of the Asteroid Belt. The Astronomical Journal 116, 3029–3037 (1998).

Papers about mean-motion resonances

  1. Chirikov, B. V. A universal instability of many-dimensional oscillator systems. Physics reports 52, 263–379 (1979).
  2. Gallardo, T. Strength, stability and three dimensional structure of mean motion resonances in the solar system. Icarus 317, 121–134 (2019).
  3. Gallardo, T. Atlas of the mean motion resonances in the Solar System. Icarus 184, 29–38 (2006).
  4. Gallardo, T., Coito, L. & Badano, L. Planetary and satellite three body mean motion resonances. Icarus 274, 83–98 (2016).
  5. Milani, A., Cellino, A., Knezevic, Z., Novaković, B. & Spoto, F. Asteroid families classification: Exploiting very large datasets. Icarus 239, 46–73 (2014).
  6. Murray, N. & Holman, M. Diffusive chaos in the outer asteroid belt. The Astronomical Journal 114, 1246 (1997).
  7. Murray, N., Holman, M. & Potter, M. On the Origin of Chaos in the Asteroid Belt. The Astronomical Journal 116, 2583–2589 (1998).
  8. Shevchenko, I. I. On the Lyapunov exponents of the asteroidal motion subject to resonances and encounters. Proc. IAU 2, 15–30 (2006).

Books

  1. Murray, C. D. & Dermott, S. F. Solar system dynamics. (Cambridge Univ. Press, 2012).
  2. Morbidelli, A. Modern celestial mechanics: aspects of solar system dynamics. (2002).

References

Whenever you use this package, we are kindly asking you to refer to one of the following papers (please choose the appropriate):

  1. The package itself:
  • Smirnov, E. A. (2023). A new python package for identifying celestial bodies trapped in mean-motion resonances. Astronomy and Computing. https://doi.org/10.1016/j.ascom.2023.100707

tex @article{Smirnov2023, title = {A new python package for identifying celestial bodies trapped in mean-motion resonances}, journal = {Astronomy and Computing}, year = {2023}, issn = {2213-1337}, doi = {https://doi.org/10.1016/j.ascom.2023.100707}, url = {https://www.sciencedirect.com/science/article/pii/S2213133723000227}, author = {E.A. Smirnov}, keywords = {Mean-motion resonances, Python, Identification, Asteroids}, abstract = {In this paper, a new open-source package ‘resonances’ written in python is introduced. It allows to find, analyse, and plot two-body and three-body mean-motion eccentricity-type resonances in the Solar and other planetary systems. The package has a better accuracy of the automatic identification procedure for resonant objects compared to previous studies. Furthermore, it has built-in integrations with AstDyS and NASA JPL catalogues. The code is extensively documented and tested with automatic tests. The package is available on GitHub under MIT Licence.} }

  1. The Libration module and automatic identification of librations:
  • Smirnov, E. A. (2023). A new python package for identifying celestial bodies trapped in mean-motion resonances. Astronomy and Computing, 100707. https://doi.org/10.1016/j.ascom.2023.100707
  1. Mass identification of mean-motion resonances:
  • Smirnov, E. A., & Dovgalev, I. S. (2018). Identification of Asteroids in Two-Body Resonances. Solar System Research, 52(4), 347–354. https://doi.org/10.1134/S0038094618040056
  • Smirnov, E. A., Dovgalev, I. S. & Popova, E. A. Asteroids in three-body mean motion resonances with planets. Icarus (2017) doi:10.1016/j.icarus.2017.09.032.

Authors

The authors of the package:

Acknowledgement

  • Many thanks to the co-authors of the papers (prof. I. I. Shevchenko, I. Dovgalev, and Dr. E. Popova).
  • The creators of REBOUND integrator.
  • The creators of Astropy.
  • The creators of numpy, scipy, pandas, and matplotlib.

Contributing

Feel free to contribute to the code by sending pull requests to the repository.

License

MIT

Owner

  • Name: Evgeny Smirnov
  • Login: smirik
  • Kind: user
  • Location: Barcelona, Spain

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
  - family-names: Smirnov
    given-names: Evgeny
    orcid: https://orcid.org/0000-0001-8264-8668
title: "resonances python package"
version: 0.3.1
identifiers:
  - type: doi
    value: 10.1016/j.ascom.2023.100707
date-released: 2023-03-18

GitHub Events

Total
  • Watch event: 3
  • Delete event: 9
  • Issue comment event: 5
  • Push event: 27
  • Pull request event: 14
  • Create event: 12
Last Year
  • Watch event: 3
  • Delete event: 9
  • Issue comment event: 5
  • Push event: 27
  • Pull request event: 14
  • Create event: 12

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 16
  • Total Committers: 3
  • Avg Commits per committer: 5.333
  • Development Distribution Score (DDS): 0.125
Top Committers
Name Email Commits
Evgeny Smirnov s****k@g****m 14
Alexander Petrov a****s@g****m 1
dependabot[bot] 4****]@u****m 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 1
  • Total pull requests: 45
  • Average time to close issues: N/A
  • Average time to close pull requests: about 1 month
  • Total issue authors: 1
  • Total pull request authors: 3
  • Average comments per issue: 1.0
  • Average comments per pull request: 0.24
  • Merged pull requests: 26
  • Bot issues: 0
  • Bot pull requests: 27
Past Year
  • Issues: 0
  • Pull requests: 16
  • Average time to close issues: N/A
  • Average time to close pull requests: about 2 months
  • Issue authors: 0
  • Pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 0.38
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 14
Top Authors
Issue Authors
  • apetrov (1)
Pull Request Authors
  • dependabot[bot] (29)
  • smirik (17)
  • apetrov (1)
Top Labels
Issue Labels
Pull Request Labels
dependencies (29) python (8)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 28 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 11
  • Total maintainers: 1
pypi.org: resonances

Identification of mean-motion resonances

  • Versions: 11
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 28 Last month
Rankings
Dependent packages count: 10.0%
Average: 20.1%
Stargazers count: 21.5%
Dependent repos count: 21.7%
Forks count: 22.6%
Downloads: 24.8%
Maintainers (1)
Last synced: 6 months ago

Dependencies

poetry.lock pypi
  • appdirs 1.4.4 develop
  • atomicwrites 1.4.0 develop
  • attrs 21.2.0 develop
  • black 21.7b0 develop
  • click 8.0.1 develop
  • colorama 0.4.4 develop
  • coverage 5.5 develop
  • flake8 3.9.2 develop
  • flake8-bugbear 21.4.3 develop
  • iniconfig 1.1.1 develop
  • mccabe 0.6.1 develop
  • mypy-extensions 0.4.3 develop
  • packaging 21.0 develop
  • pathspec 0.9.0 develop
  • pluggy 0.13.1 develop
  • py 1.10.0 develop
  • pycodestyle 2.7.0 develop
  • pyflakes 2.3.1 develop
  • pytest 6.2.4 develop
  • regex 2021.7.6 develop
  • toml 0.10.2 develop
  • tomli 1.2.0 develop
  • typed-ast 1.4.3 develop
  • astropy 4.3.post1
  • cycler 0.10.0
  • importlib-metadata 4.6.3
  • kiwisolver 1.3.1
  • matplotlib 3.4.2
  • numpy 1.21.1
  • pandas 1.3.1
  • pillow 8.3.1
  • pyerfa 2.0.0
  • pyparsing 2.4.7
  • python-dateutil 2.8.2
  • pytz 2021.1
  • rebound 3.17.4
  • scipy 1.7.1
  • seaborn 0.11.1
  • six 1.16.0
  • typing-extensions 3.10.0.0
  • zipp 3.5.0
pyproject.toml pypi
  • black ^21.6b0 develop
  • coverage ^5.5 develop
  • flake8 ^3.9.2 develop
  • flake8-bugbear ^21.4.3 develop
  • pytest ^6.2.4 develop
  • astropy ^4.2.1
  • matplotlib ^3.4.2
  • numpy ^1.21.0
  • pandas ^1.3.0
  • python >=3.7.1,<3.10
  • rebound ^3.17.3
  • scipy ^1.7.0
  • seaborn ^0.11.1
.github/workflows/ci.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite