libpredict  0.1.0
A satellite orbit prediction library
Data Structures | Defines | Typedefs | Enumerations | Functions
include/predict/predict.h File Reference
#include <time.h>
#include <stdbool.h>
Include dependency graph for predict.h:

Go to the source code of this file.

Data Structures

struct  predict_tle_t
 Container for processed TLE data from TLE strings. More...
struct  predict_orbit_t
 Satellite orbit definitions, according to defined NORAD TLE. More...
struct  predict_observer_t
 Observation point/ground station (QTH). More...
struct  predict_observation
 Data relevant for a relative observation of an orbit or similar with respect to an observation point. More...

Defines

#define PREDICT_VERSION_MAJOR   0
#define PREDICT_VERSION_MINOR   1
#define PREDICT_VERSION_PATCH   0
#define PREDICT_VERSION   (PREDICT_VERSION_MAJOR * 100 * 100 + PREDICT_VERSION_MINOR * 100 + PREDICT_VERSION_PATCH)
#define PREDICT_VERSION_STRING   "0.1.0"

Typedefs

typedef double predict_julian_date_t
 The representation of time used by libpredict: The number of days since 31Dec79 00:00:00 UTC.

Enumerations

enum  predict_ephemeris { EPHEMERIS_SGP4 = 0, EPHEMERIS_SDP4 = 1, EPHEMERIS_SGP8 = 2, EPHEMERIS_SDP8 = 3 }
 Simplified perturbation models used in modeling the satellite orbits. More...

Functions

int predict_version_major ()
 Get the major version number of the library.
int predict_version_minor ()
 Get the minor version number of the library.
int predict_version_patch ()
 Get the patch version number of the library.
int predict_version ()
 Get the version number of the library.
char * predict_version_string ()
 Get the version number string of the library.
predict_julian_date_t predict_to_julian (time_t time)
 Convert time_t in UTC to Julian date in UTC.
time_t predict_from_julian (predict_julian_date_t date)
 Convert Julian date in UTC back to a time_t in UTC.
predict_orbit_tpredict_create_orbit (const char *tle[])
 Create orbit structure.
void predict_destroy_orbit (predict_orbit_t *orbit)
 Free memory allocated in orbit structure.
int predict_orbit (predict_orbit_t *x, predict_julian_date_t time)
 Main prediction function.
bool predict_is_geostationary (const predict_orbit_t *x)
 Find whether orbit is geostationary.
double predict_apogee (const predict_orbit_t *x)
 Get apogee of satellite orbit.
double predict_perigee (const predict_orbit_t *x)
 Get perigee of satellite orbit.
bool predict_aos_happens (const predict_orbit_t *x, double latitude)
 Find whether an AOS can ever happen on the given latitude.
bool predict_decayed (const predict_orbit_t *x)
 Find whether an orbit has decayed.
bool predict_is_eclipsed (const predict_orbit_t *x)
 Find whether a satellite is currently eclipsed.
double predict_eclipse_depth (const predict_orbit_t *x)
 Return the eclipse depth.
predict_observer_tpredict_create_observer (const char *name, double lat, double lon, double alt)
 Create observation point (QTH).
void predict_destroy_observer (predict_observer_t *obs)
 Free observer.
void predict_observe_orbit (const predict_observer_t *observer, const predict_orbit_t *orbit, struct predict_observation *obs)
 Find relative position of satellite with respect to an observer.
void predict_observe_moon (const predict_observer_t *observer, predict_julian_date_t time, struct predict_observation *obs)
 Estimate relative position of the moon.
void predict_observe_sun (const predict_observer_t *observer, predict_julian_date_t time, struct predict_observation *obs)
 Estimate relative position of the sun.
predict_julian_date_t predict_next_aos (const predict_observer_t *observer, predict_orbit_t *orbit, predict_julian_date_t start_time)
 Find next acquisition of signal (AOS) of satellite (when the satellite rises above the horizon).
predict_julian_date_t predict_next_los (const predict_observer_t *observer, predict_orbit_t *orbit, predict_julian_date_t start_time)
 Find next loss of signal (LOS) of satellite (when the satellite goes below the horizon).
double predict_doppler_shift (const predict_observer_t *observer, const predict_orbit_t *orbit, double downlink_frequency)
 Calculate doppler shift of a given downlink frequency with respect to the observer.
double predict_refraction (double el)
 Calculate refraction angle.
double predict_refraction_ext (double el, double pressure, double temp)
 Calculate refraction angle.
double predict_refraction_from_apparent (double apparent_el)
 Calculate refraction angle from apparent elevation.
double predict_refraction_from_apparent_ext (double apparent_el, double pressure, double temp)
 Calculate refraction angle from apparent elevation.
double predict_refraction_rate (double el, double el_rate)
 Calculate refraction rate of change.
double predict_refraction_rate_ext (double el, double el_rate, double pressure, double temp)
 Calculate refraction rate of change.
double predict_apparent_elevation (double el)
 Calculate apparent elevation from true elevation.
double predict_apparent_elevation_ext (double el, double pressure, double temp)
 Calculate apparent elevation from true elevation.
double predict_apparent_elevation_rate (double el, double el_rate)
 Calculate apparent elevation rate.
double predict_apparent_elevation_rate_ext (double el, double el_rate, double pressure, double temp)
 Calculate apparent elevation rate.

Define Documentation

#define PREDICT_VERSION_MAJOR   0
#define PREDICT_VERSION_MINOR   1
#define PREDICT_VERSION_PATCH   0
#define PREDICT_VERSION_STRING   "0.1.0"

Typedef Documentation

typedef double predict_julian_date_t

The representation of time used by libpredict: The number of days since 31Dec79 00:00:00 UTC.


Enumeration Type Documentation

Simplified perturbation models used in modeling the satellite orbits.

Enumerator:
EPHEMERIS_SGP4 
EPHEMERIS_SDP4 
EPHEMERIS_SGP8 
EPHEMERIS_SDP8 

Function Documentation

bool predict_aos_happens ( const predict_orbit_t x,
double  latitude 
)

Find whether an AOS can ever happen on the given latitude.

Parameters:
xSatellite orbit
latitudeLatitude of ground station
Returns:
true if AOS can happen, otherwise false
double predict_apogee ( const predict_orbit_t x)

Get apogee of satellite orbit.

Parameters:
xSatellite orbit
Returns:
Apogee of orbit
double predict_apparent_elevation ( double  el)

Calculate apparent elevation from true elevation.

Parameters:
elTrue elevation angle (rad).
Returns:
Apparent elevation (rad).
double predict_apparent_elevation_ext ( double  el,
double  pressure,
double  temp 
)

Calculate apparent elevation from true elevation.

Corrects for different atmospheric pressures and temperatures.

Parameters:
elTrue elevation angle (rad).
pressureAtmospheric pressure (kPa).
tempTemperature (deg C).
Returns:
Apparent elevation (rad).
double predict_apparent_elevation_rate ( double  el,
double  el_rate 
)

Calculate apparent elevation rate.

Parameters:
elTrue elevation angle (rad).
el_rateRate of change of true elevation angle (rad/s).
Returns:
Rate of change of apparent elevation (rad/s).
double predict_apparent_elevation_rate_ext ( double  el,
double  el_rate,
double  pressure,
double  temp 
)

Calculate apparent elevation rate.

Corrects for different atmospheric pressures and temperatures.

Parameters:
elTrue elevation angle (rad).
el_rateRate of change of true elevation angle (rad/s).
pressureAtmospheric pressure (kPa).
tempTemperature (deg C).
Returns:
Rate of change of apparent elevation (rad/s).
predict_observer_t* predict_create_observer ( const char *  name,
double  lat,
double  lon,
double  alt 
)

Create observation point (QTH).

Parameters:
nameName of observation point
latLatitude in radians (easting/northing)
lonLongitude in radians (easting/northing)
altAltitude in meters
Returns:
Allocated observation point
predict_orbit_t* predict_create_orbit ( const char *  tle[])

Create orbit structure.

Allocate memory and prepare internal data.

Parameters:
tleNORAD two-line element set as string array
Returns:
Allocated orbit structure
bool predict_decayed ( const predict_orbit_t x)

Find whether an orbit has decayed.

Parameters:
xCurrent state of orbit
Returns:
true if orbit has decayed, otherwise false

Free observer.

Parameters:
obsObserver to be freed.

Free memory allocated in orbit structure.

Parameters:
orbitOrbit to free
double predict_doppler_shift ( const predict_observer_t observer,
const predict_orbit_t orbit,
double  downlink_frequency 
)

Calculate doppler shift of a given downlink frequency with respect to the observer.

Parameters:
observerPoint of observation
orbitCurrent state of satellite orbit
downlink_frequencyDownlink frequency of the satellite
Returns:
The frequency difference from the original frequency
double predict_eclipse_depth ( const predict_orbit_t x)

Return the eclipse depth.

Parameters:
xCurrent state of orbit
Returns:
Eclipse depth (rad)

Convert Julian date in UTC back to a time_t in UTC.

Parameters:
dateJulian date in UTC
Returns:
Time in UTC
bool predict_is_eclipsed ( const predict_orbit_t x)

Find whether a satellite is currently eclipsed.

Parameters:
xCurrent state of orbit
Returns:
true if orbit is eclipsed, otherwise false

Find whether orbit is geostationary.

Parameters:
xSatellite orbit
Returns:
true if orbit is geostationary, otherwise false

Find next acquisition of signal (AOS) of satellite (when the satellite rises above the horizon).

Ignores previous AOS of current pass if the satellite is in range at the start time.

Parameters:
observerPoint of observation
orbitSatellite orbit
start_timeStart time for AOS search
Returns:
Time of AOS

Find next loss of signal (LOS) of satellite (when the satellite goes below the horizon).

Finds LOS of the current pass if the satellite currently is in range, finds LOS of next pass if not.

Parameters:
observerPoint of observation
orbitSatellite orbit
start_timeStart time for LOS search
Returns:
Time of LOS
void predict_observe_moon ( const predict_observer_t observer,
predict_julian_date_t  time,
struct predict_observation obs 
)

Estimate relative position of the moon.

Parameters:
observerPoint of observation
timeTime of observation
obsReturn object for position of the moon relative to the observer
void predict_observe_orbit ( const predict_observer_t observer,
const predict_orbit_t orbit,
struct predict_observation obs 
)

Find relative position of satellite with respect to an observer.

Calculates range, azimuth, elevation and relative velocity.

Parameters:
observerPoint of observation
orbitSatellite orbit
obsReturn of object for position of the satellite relative to the observer.
void predict_observe_sun ( const predict_observer_t observer,
predict_julian_date_t  time,
struct predict_observation obs 
)

Estimate relative position of the sun.

Parameters:
observerPoint of observation
timeTime of observation
obsReturn object for position of the sun relative to the observer

Main prediction function.

Predict satellite orbit at given time.

Parameters:
xSatellite orbit
timeJulian day in UTC
Returns:
0 if everything went fine
double predict_perigee ( const predict_orbit_t x)

Get perigee of satellite orbit.

Parameters:
xSatellite orbit
Returns:
Perigee of orbit
double predict_refraction ( double  el)

Calculate refraction angle.

This function assumes atmospheric pressure of 101.0kPa and temperature 10deg celsius.

Parameters:
elTrue elevation angle (rad).
Returns:
Refraction angle (rad).
double predict_refraction_ext ( double  el,
double  pressure,
double  temp 
)

Calculate refraction angle.

Corrects for different atmospheric pressure and temperature.

Parameters:
elTrue elevation angle in rads.
pressureAtmospheric pressure in kPa.
tempTemperature in deg celsius.
Returns:
Refraction angle (rad).
double predict_refraction_from_apparent ( double  apparent_el)

Calculate refraction angle from apparent elevation.

This function assumes atmospheric pressure of 101.0kPa and temperature 10deg celsius.

Parameters:
apparent_elApparent elevation angle (rad).
Returns:
Refraction angle (rad).
double predict_refraction_from_apparent_ext ( double  apparent_el,
double  pressure,
double  temp 
)

Calculate refraction angle from apparent elevation.

Corrects for different atmospheric pressure and temperature.

Parameters:
apparent_elApparent elevation angle (rad).
pressureAtmospheric pressure in kPa.
tempTemperature in deg celsius.
Returns:
Refraction angle (rad).
double predict_refraction_rate ( double  el,
double  el_rate 
)

Calculate refraction rate of change.

Parameters:
elTrue elevation angle (rad).
el_rateRate of change of true elevation angle (rad/s).
Returns:
Refraction rate of change (rad/s).
double predict_refraction_rate_ext ( double  el,
double  el_rate,
double  pressure,
double  temp 
)

Calculate refraction rate of change.

Corrects for different atmospheric pressure and temerature.

Parameters:
elTrue elevation angle (rad).
el_rateRate of change of true elevation angle (rad/s).
pressureAtmospheric pressure in kPa.
tempTemperature in deg celsius.
Returns:
Apparent elevation (rad).

Convert time_t in UTC to Julian date in UTC.

Parameters:
timeTime in UTC
Returns:
Julian day in UTC
int predict_version ( )

Get the version number of the library.

Returns:
2 digit major, 2 digit minor, 2 digit patch decimal version number

Get the major version number of the library.

Returns:
Major version number

Get the minor version number of the library.

Returns:
Minor version number

Get the patch version number of the library.

Returns:
Patch version number

Get the version number string of the library.

Returns:
Version number string ("major.minor.patch")
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines