hapsira - Astrodynamics in Python¶
hapsira is an open source (MIT) pure Python library for interactive Astrodynamics and Orbital Mechanics, with a focus on ease of use, speed, and quick visualization. It provides a simple and intuitive API, and handles physical quantities with units. It’s a fork of poliastro, aiming at continuing its development.
View the source code of hapsira
!
Some of its awesome features are:
Analytical and numerical orbit propagation
Conversion between position and velocity vectors and classical orbital elements
Coordinate frame transformations
Hohmann and bielliptic maneuvers computation
Trajectory plotting
Initial orbit determination (Lambert problem)
Planetary ephemerides (using SPICE kernels via Astropy)
Computation of Near-Earth Objects (NEOs)
And more to come!
hapsira
is developed by an open, international community. Release announcements and general discussion take place on our mailing list and chat.
The source code and issue tracker are hosted on GitHub, and all contributions and feedback are more than welcome.
hapsira
works on the recent Python versions and is released under the MIT license, allowing commercial use of the library.
from hapsira.examples import molniya
molniya.plot()
Success stories from the original poliastro
¶
“My team and I used Poliastro for our final project in our Summer App Space program. This module helped us in plotting asteroids by using the data provided to us. It was very challenging finding a module that can take orbits from the orbital elements, plot planets, and multiple ones. This module helped us because we were able to understand the code as most of us were beginners and make some changes the way we wanted our project to turn out. We made small changes such as taking out the axis and creating a function that will create animations. I am happy we used Poliastro because it helped us directs us in a direction where we were satisfied of our final product.”
– Nayeli Ju (2017)
“We are a group of students at University of Illinois at Urbana-Champaign, United States. We are currently working on a student AIAA/AAS satellite competition to design a satellite perform some science missions on asteroid (469219) 2016 HO3. We are using your hapsira python package in designing and visualizing the trajectory from GEO into asteroid’s orbit. Thank you for your work on hapsira, especially the APIs that are very clear and informational, which helps us significantly.”
– Yufeng Luo (University of Illinois at Urbana-Champaign, United States, 2017)
“We, at the Institute of Space and Planetary Astrophysics (ISPA, University of Karachi), are using Poliastro as part of Space Flight Dynamics Text Book development program. The idea is to develop a book suitable for undergrad students which will not only cover theoretical background but will also focus on some computational tools. We chose Poliastro as one of the packages because it was very well written and provided results with good accuracy. It is especially useful in covering some key topics like the Lambert’s problem. We support the use of Poliastro and open source software because they are easily accessible to students (without any charges, unlike some other tools). A great plus point for Poliastro is that it is Python based and Python is now becoming a very important tool in areas related to Space Sciences and Technologies.”
– Prof. Jawed iqbal, Syed Faisal ur Rahman (ISPA, University of Karachi, 2016)
Contents¶
- Installation
- Quickstart
- Defining the orbit:
Orbit
objects - From position and velocity
- From classical orbital elements
- Moving forward in time: propagation
- Studying trajectories:
Ephem
objects - Studying non-keplerian orbits: perturbations
- Studying artificial perturbations: thrust
- Traveling through space: solving the Lambert problem
- Creating a CZML document
- Defining the orbit:
- Gallery
- Analyzing the Parker Solar Probe flybys
- The atmosphere and its layers
- Temperature, pressure and density distributions
- Catch that asteroid!
- Customising static orbit plots
- Visualize orbital data with Cesium
- New Horizons launch and trajectory
- Drawing Earth satellite groundtracks
- Plotting in 3D
- Analyzing NEOs
- Visualizing the SpaceX Tesla Roadster trip to Mars
- Natural and artificial perturbations
- Tisserand plots and applications in gravity assisted maneuvers
- Detecting Events
- Loading OMM and TLE satellite data
- Loading general perturbations data
- Creating ephemerides from general perturbations data
- Contributing
- API reference
- Bibliography
- What’s new
- hapsira 0.18.0 - 2023-12-24
- poliastro 0.17.0 - 2022-07-10
- poliastro 0.16.3 - 2022-05-09
- poliastro 0.16.2 - 2022-02-10
- poliastro 0.16.1 - 2022-02-10
- poliastro 0.16.0 - 2021-12-08
- poliastro 0.15.2 - 2021-06-27
- poliastro 0.15.1 - 2021-06-27
- poliastro 0.15.0 - 2021-05-14
- poliastro 0.14.0 - 2020-05-08
- poliastro 0.13.1 - 2019-12-20
- poliastro 0.13.0 - 2019-08-05
- poliastro 0.12.0 - 2019-02-21
- poliastro 0.11.1 - 2018-12-27
- poliastro 0.11.0 - 2018-09-21
- poliastro 0.10.0 - 2018-07-21
- poliastro 0.9.1 - 2018-05-11
- poliastro 0.9.0 - 2018-04-25
- poliastro 0.8.0 - 2017-11-18
- poliastro 0.7.0 - 2017-09-15
- poliastro 0.6.0 - 2017-02-12
- poliastro 0.5.0 - 2016-03-06
- poliastro 0.4.2 - 2015-12-24
- poliastro 0.4.0 - 2015-12-13
- poliastro 0.3.1 - 2015-06-30
- poliastro 0.3.0 - 2015-05-09
- poliastro 0.2.1 - 2015-04-26
- poliastro 0.2 - 2014-08-16
Note
Older versions of poliastro
, from which hapsira
was forked, relied on some Fortran subroutines written by David A. Vallado for his book “Fundamentals of Astrodynamics and Applications” and available on the Internet as the companion software of the book. The author explicitly gave permission to redistribute these subroutines in this project under a permissive license.