Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A partial PHP port of the Gpredict program for real-time satellite tracking and orbit prediction.
PHP JavaScript
branch: master

Fixed bug in Predict_TLE::__construct()

* Some TLEs use leading spaces instead of zeros.  This caused
  the casting of the epoch '14 089.1234234' to '14', wreaking
  havoc on predictions.
* See http://www.celestrak.com/columns/v04n03/ for details on
  the format, and which fields may use leading spaces.
* The original code this was ported from is here as of this
  writing:
  http://sourceforge.net/p/gpredict/code/ci/master/tree/src/sgpsdp/sgp_in.c#l139
  g_ascii_strtod() is likely what gpredict uses to solve this.
latest commit 806c835fd6
@shupp authored
Failed to load latest commit information.
Predict Fixed bug in Predict_TLE::__construct()
examples Added findsun and solar_position examples
tests Updated tests to use local copy of Console_Table
xhprof_lib Updated xhprof_lib/list.php to use local copy of EC_XHProf
Predict.php * Fixed some bugs found by hiphop-php
README.md
generatePackage.php Prepped the 0.2.2 release
package.xml Prepped the 0.2.2 release

README.md

Overview

Predict is a partial PHP port of the Gpredict program that allows real-time tracking and orbit prediction of satellites from two line element sets. It supports the SGP4 and SDP4 models for prediction.

Installation

Just clone this repo and try out the tests and examples from the root of the checkout.

Examples/Tests

The tests directory includes a port of the original sgpsdp test files from Gpredict. They are pretty close.

Included in the examples directory is a sample iss.tle (with an update script, which you should run first). There are two examples, the visible_passes.php script and the benchmark.php script. The former is for generating visible pass predictions of the ISS, and its output is similar to what you might get from the Heavens-Above website, and it is heavily commented. The latter just does predictions for benchmarking with xhprof.

You can see an image of a Predict/Google Maps API mash-up I did for fun:

Google Maps Mashup

You can also see an example visible pass plotted from the polar view of the observer:

Google Maps Mashup

About this port

This port largely maintains the style and organization of the original C code, but scopes methods into classes rather than leaving everything in the global scope. The motivation for this is so that changes upstream can more easily be integrated over time. Only the prediction routines have been ported.

Something went wrong with that request. Please try again.