Pyorbital is a python package to compute orbital parameters for satellites from TLE files as well as astronomical parameters of interest for satellite remote sensing. Currently pyorbital only supports low earth orbit satellites.
Pyorbital has a module for parsing NORAD TLE-files
>>> from pyorbital import tlefile
>>> tle = tlefile.read('noaa 18', '/path/to/my/tle_file.txt')
>>> tle.inclination
99.043499999999995
If no path is given pyorbital tries to read the earth observation TLE-files from celestrak.com
The orbital module enables computation of satellite position and velocity at a specific time:
>>> from pyorbital.orbital import Orbital
>>> from datetime import datetime
>>> orb = Orbital("noaa 18")
>>> now = datetime.utcnow()
>>> # Get normalized position and velocity of the satellite:
>>> orb.get_position(now)
([0.57529384846822862, 0.77384005228105424, 0.59301408257897559],
[0.031846489698768146, 0.021287993461926374, -0.05854106186659274])
>>> # Get longitude, latitude and altitude of the satellite:
>>> orb.get_lonlatalt(now)
(-1.1625895579622014, 0.55402132517640568, 847.89381184656702)
The astronomy module enables computation of certain parameters of interest for satellite remote sensing for instance the Sun-zenith angle:
>>> from pyorbital import astronomy
>>> from datetime import datetime
>>> utc_time = datetime(2012, 5, 15, 15, 45)
>>> lon, lat = 12, 56
>>> astronomy.sun_zenith_angle(utc_time, lon, lat)
62.685986438071602
Module for computing the orbital parameters of satellites.
Class holding the orbital elements.
Class for orbital computations.
The satellite parameter is the name of the satellite to work on and is used to retreive the right TLE data for internet or from tle_file in case it is provided.
Calculate time of last ascending node relative to the specified time
Calculate sublon, sublat and altitude of satellite. http://celestrak.com/columns/v02n03/
Calculate passes for the next hours for a given start time and a given observer.
Original by Martin.
utc_time: Observation time (datetime object) length: Number of hours to find passes (int) lon: Longitude of observer position on ground (float) lat: Latitude of observer position on ground (float) alt: Altitude above sea-level (geoid) of observer position on ground (float) tol: precision of the result in seconds
Return: [(rise-time, fall-time, max-elevation-time), ...]
Calculate observers look angle to a satellite. http://celestrak.com/columns/v02n02/
utc_time: Observation time (datetime object) lon: Longitude of observer position on ground lat: Latitude of observer position on ground alt: Altitude above sea-level (geoid) of observer position on ground
Return: (Azimuth, Elevation)
Calculate orbit number at specified time. Optionally use TBUS-style orbit numbering (TLE orbit number + 1)
Get the cartesian position and velocity from the satellite.
Class holding TLE objects.
fetch TLE from internet and save it to destination.
Read TLE for satellite from tle_file, from line1 and line2, or from internet if none is provided.
Astronomy module. Parts taken from http://www.geoastro.de/elevaz/basics/index.htm
Cosine of the sun-zenith angle for lon, lat at utc_time. utc_time: datetime.datetime instance of the UTC time lon and lat in degrees.
Return sun altitude and azimuth from utc_time, lon, and lat. lon,lat in degrees What is the unit of the returned angles and heights!? FIXME!
Greenwich mean sidereal utc_time, in radians.
As defined in the AIAA 2006 implementation: http://www.celestrak.com/publications/AIAA/2006-6753/
Get the julian day of utc_time.
Get the days since year 2000.
Calculate observer ECI position.
Calculate the sun earth distance correction, relative to 1 AU.
Ecliptic longitude of the sun at utc_time.
Right ascension and declination of the sun at utc_time.
Sun-zenith angle for lon, lat at utc_time. lon,lat in degrees. The angle returned is given in degrees