Examples of application of Python for orbital analysis
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Plotting 3D meteor orbits from orbital elements calculated by UFO Orbit

These scripts will ingest Orbital Data from a UFO Orbit csv export of unified meteor observations and will Produce a 3D plot each orbit.

We hope that others will be willing to contribute ideas, improvements (bug fixes) and analytical methods so that we can add to this suite and build a more complete set of resources for the meteor community.

File Manifest

  • kepler. py: this script contains generic functions to convert orbital elements to cartesian (XYZ) coordinates
  • ufo_orbit_plot.py: this script reads orbital data and calls the kepler routines to display an interactive 3D visualisation of the orbits
  • ufo_orbit_plot_D.py: As ufo_orbit_plot.py but this script contains a smal adaption to colour code orbits according to similarity to a reference orbit defined by a D criterion value. This code requires data that is preprocessed by SAS.

Instaling and Running

ufo_orbit_plot.py and ufo_orbit_plot_D.py are provided as examples or templates. Their function is to ingest UFO Orbit data, filter by stream name and plot individual orbits. The task of converting orbital elements to cartesian coordinates is performed by functions in kepler_plot.py.

ufo_orbit_plot.py and ufo_orbit_plot_D.py should be instaled in the same directry along with kepler_plot.py

Configuration parameters are as follows:

Parameter Description Example
UFO_FILE Name of input file 'PROCESSED.csv'
Stream Stream name 'Perseids'
Auto_layout Auto sixing of axix True of False
x_limit Min / max range of X Axis (Auto_layout = False) [-22,2]
y_limit Min / max range of Y Axis (Auto_layout = False) [-22,2]
z_limit Min / max range of Z Axis (Auto_layout = False) [-22,2]
Stream_Column Index of column holding stream identifier 1
D_Threshold D colour threshold. If D value < threshold then plot trail as blue else plot as red (ufo_orbit_plot_D.py only) 0
D_Column Index of column holding D value (ufo_orbit_plot_D.py only) 1

Plotting Orbits in 3D

Orbital plots are generated by a set of functions which convert orbital elements to cartesian coordinates. These functions are the original work of Joe Hann (www.spacescience.org) and are redistributed with his kind consent.

Function Description
keplers_eqn Solve's Keplers equation
el2polar convert orbit elements a,e,M to polar coordinates r,f,z,vr,vt,vz in the z=0 orbit plane
polar2cartesian Convert polar coordinates to cartesian coordinates
el2vx Convert orbit elements to cartesian coordinates and velocities
xv2el Convert cartesian coordinates and velocities to orbit elements
Rx Rotate coordinate system about the x axis by angle, in radians
Ry Rotate coordinate system about the y axis by angle, in radians
Rz Rotate coordinate system about the z axis by angle, in radians
elements_deg2rad convert the angular orbit elements from degrees to radians


For implicity the ingestion of UFO Orbit data is positional. It is mportant to ensure that the column numbers are correct if reformatted data is supplied.


This work is shared under the Creative Common Non Commercial Sharealike License V4.0 (www.creativecommons.org/licebses/by-nc-sa/4.0/)