AstDyS wrapper in python
Project description
AstDyS Python Wrapper
This is a Python wrapper for the AstDyS catalogue of asteroids in the Solar system, providing access to both osculating orbital elements and synthetic proper elements.
Installation
pip install astdys
Quick Start
import astdys
# Get osculating elements for asteroid 1 (Ceres)
elements = astdys.search(1)
print(elements)
# Get synthetic proper elements for the same asteroid
astdys.set_type("synthetic")
proper_elements = astdys.search(1)
print(proper_elements)
Usage
Basic Search
Search for a single asteroid by number:
import astdys
# Search for asteroid 1 (Ceres)
elements = astdys.search(1)
if elements:
print(f"Semi-major axis: {elements['a']} AU")
print(f"Eccentricity: {elements['e']}")
print(f"Inclination: {elements['inc']} radians")
Search for multiple asteroids:
# Search for multiple asteroids
objects = astdys.search([1, 2, 3, 4, 5])
for num, elements in objects.items():
print(f"Asteroid {num}: a={elements['a']:.3f} AU")
Search by Semi-major Axis
Find asteroids within a specific range of semi-major axis:
# Find asteroids around 2.7 AU (with default sigma=0.1 AU)
asteroids = astdys.search_by_axis(2.70)
print(f"Found {len(asteroids)} asteroids")
# Use custom range (sigma=0.05 AU)
asteroids = astdys.search_by_axis(2.70, sigma=0.05)
print(asteroids[['a', 'e', 'inc']].head())
Working with Different Catalog Types
The library supports two types of orbital elements:
Osculating Elements (Default)
Classical Keplerian orbital elements at a specific epoch:
# Default catalog type is 'osculating'
astdys.set_type("osculating") # This is the default
elements = astdys.search(1)
# Available elements:
# - a: semi-major axis (AU)
# - e: eccentricity
# - inc: inclination (radians)
# - Omega: longitude of ascending node (radians)
# - omega: argument of perihelion (radians)
# - M: mean anomaly (radians)
# - epoch: epoch (MJD)
Synthetic Proper Elements
Proper elements are averaged orbital elements that eliminate short-term perturbations, useful for asteroid family studies:
# Switch to synthetic proper elements
astdys.set_type("synthetic")
elements = astdys.search(1)
# Available elements:
# - a: proper semi-major axis (AU)
# - e: proper eccentricity
# - sinI: sine of proper inclination
# - n: mean motion frequency (arcsec/year)
# - g: perihelion precession frequency (arcsec/year)
# - s: node precession frequency (arcsec/year)
# - lce: Lyapunov Characteristic Exponent
# - my: integration time (Myr)
# - mag: absolute magnitude
Catalog Information
Get information about the catalog:
# Get catalog epoch as string
date_str = astdys.catalog_time()
print(f"Catalog epoch: {date_str}")
# Get catalog epoch as datetime object
import astdys
date = astdys.datetime()
print(f"Catalog date: {date}")
Rebuilding the Catalog
Force a fresh download and rebuild of the catalog:
# This will download fresh data from AstDyS
astdys.rebuild()
Angle Conversions
Note that angular elements (inclination, node, perihelion, mean anomaly) are returned in radians.
Comparing osculating and proper elements
import astdys
asteroid_num = 4 # Vesta
# Get osculating elements
astdys.set_type("osculating")
osc = astdys.search(asteroid_num)
# Get proper elements
astdys.set_type("synthetic")
prop = astdys.search(asteroid_num)
print("Osculating vs Proper elements:")
print(f"Semi-major axis: {osc['a']:.4f} vs {prop['a']:.4f} AU")
print(f"Eccentricity: {osc['e']:.4f} vs {prop['e']:.4f}")
License
MIT
Credits
This wrapper provides access to the AstDyS database. The AstDyS catalog and synthetic proper elements were created by:
Zoran Knežević (Astronomical Observatory, Belgrade) and Andrea Milani (University of Pisa)
Key references:
- Knežević, Z. & Milani, A. (2003). "Proper element catalogs and asteroid families." Astronomy & Astrophysics, 403, 1165-1173.
- Knežević, Z. & Milani, A. (2001). "Synthetic proper elements for outer main belt asteroids." Celestial Mechanics and Dynamical Astronomy, 78, 17-46.
The AstDyS service is available at: https://newton.spacedys.com/astdys2/
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file astdys-0.9.4.tar.gz.
File metadata
- Download URL: astdys-0.9.4.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.11.9 Darwin/24.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6f511a5bdb8a477ed1ba16b6d40be8c46ca409e1f7ab762c6298bdbb1fb3fe4
|
|
| MD5 |
b2c4fd76b21111df651be2479e951db4
|
|
| BLAKE2b-256 |
1d1d2755731f7e93aa19fd8145672dd5df94682c1d4785a0b934c1ab47d18630
|
File details
Details for the file astdys-0.9.4-py3-none-any.whl.
File metadata
- Download URL: astdys-0.9.4-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.11.9 Darwin/24.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a709122992724915e3fdfc661297be1abadf5f7680003e840747484bf680a16
|
|
| MD5 |
505ed829c181e6664225ab61f60e1a10
|
|
| BLAKE2b-256 |
b0c5c5a0c49de3ad19c1c59e5db73c43d1e312d2ac9bae1be09603cc926d5d03
|