Orbits  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
Orbits

Overview

Orbits is a tool to gather earth orbitology and project coverage predictions for specified satellites. It can produce just TLEs, or TLEs and rasters.

PosAtTime is a specialized module that uses Orbits submodules to either print satellite (lon, lat) at a specified seed time, or produce a raster of locations for a list of seed times.

Installation Guidelines

Code from this project will be installed and set up via the following repo install scripts: **busboy_install** This install script is designed for a CentOS environment.

apikeys.json must be provided in orbits/conf/apikeys.json for any Space-Track queries to work. See conf/example_apikeys.json

The install actions can be used to inspire installation in another environment, but no guarantees are made as to functionality.

Execution

Before execution activate the orbits virtual environment, either by calling source orbits/power_on then deactivating with source orbits/power_off, or by using the code included in "shell_header".

Orbits

Orbits multisat execution can be done by:

  1. Using a satcatid list in the json properties file, and calling via Orbits.p. Most efficient, as Orbits.py parallelizes on satcatid
  2. Using a single satcatid in the json properties file
  3. Constructing some other script to call Orbits.py, TLEGen.py, or SatRaster.py with option argument -sID <satcatid> sequentially for each satellite. Less efficient, as Orbits.py parallelizes on satcatid

Below are a sample of common code paths to inspire scripting:

PosAtTime

PosAtTime is a standalone file, and must be run for each satcatid in question. There are two code routes:

  1. Provide a single seed time: with TLE (as string or file) OR without TLE (nearest TLE will be sourced from SpaceTrack)
    • Output is a printed (lon, lat)
  2. Provide a list of seed times: with TLEs as file OR without TLE (TLEs for the time range will be sourced from SpaceTrack)
    • Seed time file 1 time per line, of the format 2008-11-10-17-53-59-000317 (YYYY-MM-DD-hh-mm-ss-µs)
    • TLEs must be in new->old order (default TLEGen output style)
    • Seed time list will be sorted into appropriate order and de-duplicated (no rendundant times)
    • Output is a raster

Time

Precision timing is critical to drawing conclusions from satellite positioning, see details in other sections. When possible, standardize to UTC. Any usage of the special time **"now"** will set time to the current UTC time, this includes output directory naming.

This module utilizes Python datetime objects, and a library of conversion functions is provided in DTHelpers.py

In terms of configuration times can be supplied in two ways, with a consistent "time_format". Mixing these two routes will raise exceptions:

  1. "t0" and "t1". Start and end times can be provided in several formats via JSON file or option argument as a string. t1(end time) > t0 (start time)
  2. "t0", "t_range", "t_range_unit", "t_forward". In this way, t0 and t1 will be calculated either backward or forward from the initial seed time "t0", for the specified length of time.

Manual time can be set by option arguments with the format -t0 <t0> -t1 <t1> -time_format <time_format>

PosAtTime accepts one time format, so "time_format" is not specified. It is 2008-11-10-17-53-59-000317 (YYYY-MM-DD-hh-mm-ss-ms or Y-m-d-H-M-S-f)

Accuracy

Accuracy of this module should be within 1 raster cell (default 0.1 deg).

Type conversion and accumulating float errors are the main sources of error, and within this tolerance, errors are rounded to fit within the raster or (lon, lat) bounds. Errors beyond this tolerance will raise exceptions.

TLEs are another source of error, and therefore the closest TLE to a given time will be used. TLEs > 1 year from the time of a calculation will not be used.

Exceptions

Every effort has been made to raise meaningful exceptions that can be traced back to lines of code and relevant modules for debugging. Errors will be of the form "Traceback (most recent call last): ... Exception".

Since Orbits generates subprocesses, one of these may fail while the others succeed. Check output and exception messages accordingly.

In submodule (TLEGen, SatState, SatRaster) and PosAtTime execution, a single exception will terminate the program.

Path Formatting

Note that paths beginning with '/' will be interpretted as absolute within this module. If a path should be relative, drop the beginning slash. It will be added when paths are joined. This is particularly relevant when specifying manual input and output files.

Default input and output paths are: orbits/output/<YYYY-MM-DD> Any changed to output/input paths should use option arguments.

Output Naming Conventions

Orbits

Format can be overridden by supplying manual output via command line argument or config file.

Default Orbits file format:

{satcatid}

{time_range}

{freq}

{extension}

3LE/TLE output

25919_2013-11-10-00-00-00-000000_to_2014-11-10-00-00-00-000000_5sec.txt 25919_2013-11-10-17-53-59-000317_to_2014-11-10-17-53-59-000317_5sec.txt

SatRaster output

25919_2013-11-10-00-00-00-000000_to_2014-11-10-00-00-00-000000_5sec.tif 25919_2013-11-10-17-53-59-000317_to_2014-11-10-17-53-59-000317_5sec.tif

PosAtTime

Formats are different to distinguish from Orbits output.

Seed Times

Input only, provided by user or made programatically elsewhere, can have different naming convention if specified by option argument. {satcatid}_times.txt 25919_times.txt

TLEGen output

TLEs (if TLEs over multiple seed times sourced because not provided). If user is providing TLEs, they must be in new->old order (TLEGen default format) {satcatid}_{t0}_to_{t1}_tle.txt 25919_2009-01-01-01-07-16-800000_to_2010-12-31-21-45-34-900000_tle.txt

SatRaster output

A raster file {satcatid}_{t0}_to_{t1}_times.tif 25919_2009-01-01-01-07-16-800000_to_2010-12-31-21-45-34-900000_times.tif

Packaging

Code

In alphabetical order, see src for main source code

bin

conf

Configurations will be set in the following priority hierarchy: Module constructors > option arguments > properties JSON > module defaults An option argument can be supplied to override properties JSON value for the same parameter. JSON files can be versioned, and are recommended. Many properties can only be set via JSON.

JSON

conf/apikeys.json

conf/cron_orbits_properties.json

conf/orbits_default_properties.json

conf/example_apikeys.json

conf/example_orbits_properties.json

conf/install_requirements.txt

conf/requirements.txt

conf/my_requirements.txt

conf/setup_orbits

conf/updated

include

lib

man

orbits_ex.sh

orbits2raster.sh

output

power_on

power_off

README.md

shell_header

src

src/drive_tle_raster.sh

src/DTHelpers.py

src/Orbits.py

src/OrbitsBase.py

src/PosAtTime.py

src/SatRaster.py

src/SatState.py

src/TLEGen.py

test

test/test_data

test/test_output

Command line options

External Resources

space-track.org

API documentation

Two Line Element (TLE) Format

Satellite Catalog

GDAL

CelesTrak

Python Libraries

The following libraries are either in use, or worth noting for development purposes.

os & sys

shutil

collections

subprocess

multiprocessing

json

argparse

time & datetime

dateutil

pytz

Requests

sgp4

pyephem

GDAL

astropy

skyfield

numpy

matplotlib

Python Imaging Library

memory_profiler

psutil

nosetests

mock

pyparsing

six

wsgiref

README Markdown

This readme is written using markdown.

Markdown Cheat Sheet

Markdown syntax

Markdown Preview

Copyright 2014 Google Inc. All rights reserved.