libpredict
2.0.0
A satellite orbit prediction library
|
#include <time.h>
#include <stdbool.h>
Go to the source code of this file.
Data Structures | |
struct | predict_orbital_elements_t |
Container for processed TLE data from TLE strings. More... | |
struct | predict_position |
Predicted orbital values for satellite at a given time. 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... | |
Macros | |
#define | PREDICT_VERSION_MAJOR 2 |
#define | PREDICT_VERSION_MINOR 0 |
#define | PREDICT_VERSION_PATCH 0 |
#define | PREDICT_VERSION (PREDICT_VERSION_MAJOR * 100 * 100 + PREDICT_VERSION_MINOR * 100 + PREDICT_VERSION_PATCH) |
#define | PREDICT_VERSION_STRING "2.0.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. More... | |
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. More... | |
int | predict_version_minor () |
Get the minor version number of the library. More... | |
int | predict_version_patch () |
Get the patch version number of the library. More... | |
int | predict_version () |
Get the version number of the library. More... | |
char * | predict_version_string () |
Get the version number string of the library. More... | |
predict_julian_date_t | predict_to_julian (time_t time) |
Convert time_t in UTC to Julian date in UTC. More... | |
time_t | predict_from_julian (predict_julian_date_t date) |
Convert Julian date in UTC back to a time_t in UTC. More... | |
predict_orbital_elements_t * | predict_parse_tle (const char *tle_line_1, const char *tle_line_2) |
Create predict_orbital_elements_t from TLE strings. More... | |
void | predict_destroy_orbital_elements (predict_orbital_elements_t *orbital_elements) |
Free memory allocated in orbital elements structure. More... | |
int | predict_orbit (const predict_orbital_elements_t *orbital_elements, struct predict_position *x, predict_julian_date_t time) |
Main prediction function. More... | |
bool | predict_is_geosynchronous (const predict_orbital_elements_t *orbital_elements) |
Find whether an orbit is geosynchronous. More... | |
double | predict_apogee (const predict_orbital_elements_t *x) |
Get apogee of satellite orbit. More... | |
double | predict_perigee (const predict_orbital_elements_t *x) |
Get perigee of satellite orbit. More... | |
bool | predict_aos_happens (const predict_orbital_elements_t *x, double latitude) |
Find whether an AOS can ever happen on the given latitude. More... | |
predict_observer_t * | predict_create_observer (const char *name, double lat, double lon, double alt) |
Create observation point (QTH). More... | |
void | predict_destroy_observer (predict_observer_t *obs) |
Free observer. More... | |
void | predict_observe_orbit (const predict_observer_t *observer, const struct predict_position *orbit, struct predict_observation *obs) |
Find relative position of satellite with respect to an observer. More... | |
void | predict_observe_moon (const predict_observer_t *observer, predict_julian_date_t time, struct predict_observation *obs) |
Estimate relative position of the moon. More... | |
double | predict_moon_ra (predict_julian_date_t time) |
Calculate right ascension of the moon. More... | |
double | predict_moon_declination (predict_julian_date_t time) |
Calculate declination of the moon. More... | |
double | predict_moon_gha (predict_julian_date_t time) |
Calculate the greenwich hour angle (longitude) of the moon. More... | |
void | predict_observe_sun (const predict_observer_t *observer, predict_julian_date_t time, struct predict_observation *obs) |
Estimate relative position of the sun. More... | |
double | predict_sun_ra (predict_julian_date_t time) |
Calculate right ascension of the sun. More... | |
double | predict_sun_declination (predict_julian_date_t time) |
Calculate declination of the sun. More... | |
double | predict_sun_gha (predict_julian_date_t time) |
Calculate the greenwich hour angle (longitude) of the sun. More... | |
struct predict_observation | predict_next_aos (const predict_observer_t *observer, const predict_orbital_elements_t *orbital_elements, predict_julian_date_t start_time) |
Find next acquisition of signal (AOS) of satellite (when the satellite rises above the horizon). More... | |
struct predict_observation | predict_next_los (const predict_observer_t *observer, const predict_orbital_elements_t *orbital_elements, predict_julian_date_t start_time) |
Find next loss of signal (LOS) of satellite (when the satellite goes below the horizon). More... | |
struct predict_observation | predict_at_max_elevation (const predict_observer_t *observer, const predict_orbital_elements_t *orbital_elements, predict_julian_date_t start_time) |
Find maximum elevation of next or current pass. More... | |
double | predict_doppler_shift (const struct predict_observation *observation, double downlink_frequency) |
Calculate doppler shift of a given downlink frequency with respect to an observer. More... | |
double | predict_squint_angle (const predict_observer_t *observer, const struct predict_position *orbit, double alon, double alat) |
Calculate squint angle for satellite, i.e. More... | |
double | predict_refraction (double el) |
Calculate refraction angle. More... | |
double | predict_refraction_ext (double el, double pressure, double temp) |
Calculate refraction angle. More... | |
double | predict_refraction_from_apparent (double apparent_el) |
Calculate refraction angle from apparent elevation. More... | |
double | predict_refraction_from_apparent_ext (double apparent_el, double pressure, double temp) |
Calculate refraction angle from apparent elevation. More... | |
double | predict_refraction_rate (double el, double el_rate) |
Calculate refraction rate of change. More... | |
double | predict_refraction_rate_ext (double el, double el_rate, double pressure, double temp) |
Calculate refraction rate of change. More... | |
double | predict_apparent_elevation (double el) |
Calculate apparent elevation from true elevation. More... | |
double | predict_apparent_elevation_ext (double el, double pressure, double temp) |
Calculate apparent elevation from true elevation. More... | |
double | predict_apparent_elevation_rate (double el, double el_rate) |
Calculate apparent elevation rate. More... | |
double | predict_apparent_elevation_rate_ext (double el, double el_rate, double pressure, double temp) |
Calculate apparent elevation rate. More... | |
#define PREDICT_VERSION (PREDICT_VERSION_MAJOR * 100 * 100 + PREDICT_VERSION_MINOR * 100 + PREDICT_VERSION_PATCH) |
#define PREDICT_VERSION_MAJOR 2 |
#define PREDICT_VERSION_MINOR 0 |
#define PREDICT_VERSION_PATCH 0 |
#define PREDICT_VERSION_STRING "2.0.0" |
typedef double predict_julian_date_t |
The representation of time used by libpredict: The number of days since 31Dec79 00:00:00 UTC.
enum predict_ephemeris |
bool predict_aos_happens | ( | const predict_orbital_elements_t * | x, |
double | latitude | ||
) |
Find whether an AOS can ever happen on the given latitude.
x | Orbital elements |
latitude | Latitude of ground station in radians |
double predict_apogee | ( | const predict_orbital_elements_t * | x | ) |
Get apogee of satellite orbit.
x | Orbital elements |
double predict_apparent_elevation | ( | double | el | ) |
Calculate apparent elevation from true elevation.
el | True elevation angle (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.
el | True elevation angle (rad). |
pressure | Atmospheric pressure (kPa). |
temp | Temperature (deg C). |
double predict_apparent_elevation_rate | ( | double | el, |
double | el_rate | ||
) |
Calculate apparent elevation rate.
el | True elevation angle (rad). |
el_rate | Rate of change of true elevation angle (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.
el | True elevation angle (rad). |
el_rate | Rate of change of true elevation angle (rad/s). |
pressure | Atmospheric pressure (kPa). |
temp | Temperature (deg C). |
struct predict_observation predict_at_max_elevation | ( | const predict_observer_t * | observer, |
const predict_orbital_elements_t * | orbital_elements, | ||
predict_julian_date_t | start_time | ||
) |
Find maximum elevation of next or current pass.
observer | Ground station |
orbital_elements | Orbital elements of satellite |
start_time | Search time. If elevation is negative, max elevation is sought from the start_time and on. If elevation is positive, max elevation is searched for within the current pass |
predict_observer_t* predict_create_observer | ( | const char * | name, |
double | lat, | ||
double | lon, | ||
double | alt | ||
) |
Create observation point (QTH).
name | Name of observation point |
lat | Latitude in radians (easting/northing) |
lon | Longitude in radians (easting/northing) |
alt | Altitude in meters |
void predict_destroy_observer | ( | predict_observer_t * | obs | ) |
Free observer.
obs | Observer to be freed. |
void predict_destroy_orbital_elements | ( | predict_orbital_elements_t * | orbital_elements | ) |
Free memory allocated in orbital elements structure.
orbital_elements | Orbit to free |
double predict_doppler_shift | ( | const struct predict_observation * | observation, |
double | downlink_frequency | ||
) |
Calculate doppler shift of a given downlink frequency with respect to an observer.
observation | Observation of a satellite orbit |
downlink_frequency | Downlink frequency of the satellite |
time_t predict_from_julian | ( | predict_julian_date_t | date | ) |
Convert Julian date in UTC back to a time_t in UTC.
date | Julian date in UTC |
bool predict_is_geosynchronous | ( | const predict_orbital_elements_t * | orbital_elements | ) |
Find whether an orbit is geosynchronous.
This function uses the definition of geosynchronous orbits found in "Classification of geosynchronous objects", Issue 17, 28 March 2015, from the European Space Agency:
The function is mainly used internally for avoiding long iteration loops in functions like predict_at_max_elevation() and predict_next_aos(). The wider definition of a geosynchronous orbits is appropriate here. The definition of a geostationary satellite would be stricter, but is not considered here.
orbital_elements | Orbital elements |
double predict_moon_declination | ( | predict_julian_date_t | time | ) |
Calculate declination of the moon.
time | Time |
double predict_moon_gha | ( | predict_julian_date_t | time | ) |
Calculate the greenwich hour angle (longitude) of the moon.
time | Time |
double predict_moon_ra | ( | predict_julian_date_t | time | ) |
Calculate right ascension of the moon.
time | Time |
struct predict_observation predict_next_aos | ( | const predict_observer_t * | observer, |
const predict_orbital_elements_t * | orbital_elements, | ||
predict_julian_date_t | start_time | ||
) |
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.
observer | Point of observation |
orbital_elements | Orbital elements |
start_time | Start time for AOS search |
struct predict_observation predict_next_los | ( | const predict_observer_t * | observer, |
const predict_orbital_elements_t * | orbital_elements, | ||
predict_julian_date_t | start_time | ||
) |
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.
observer | Point of observation |
orbital_elements | Orbital elements |
start_time | Start time for LOS search |
void predict_observe_moon | ( | const predict_observer_t * | observer, |
predict_julian_date_t | time, | ||
struct predict_observation * | obs | ||
) |
Estimate relative position of the moon.
observer | Point of observation |
time | Time of observation |
obs | Return object for position of the moon relative to the observer |
void predict_observe_orbit | ( | const predict_observer_t * | observer, |
const struct predict_position * | orbit, | ||
struct predict_observation * | obs | ||
) |
Find relative position of satellite with respect to an observer.
Calculates range, azimuth, elevation and relative velocity.
observer | Point of observation |
orbit | Satellite orbit |
obs | Return 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.
observer | Point of observation |
time | Time of observation |
obs | Return object for position of the sun relative to the observer |
int predict_orbit | ( | const predict_orbital_elements_t * | orbital_elements, |
struct predict_position * | x, | ||
predict_julian_date_t | time | ||
) |
Main prediction function.
Predict satellite orbit at given time.
orbital_elements | Orbital elements |
x | Predicted orbit |
time | Julian day in UTC |
predict_orbital_elements_t* predict_parse_tle | ( | const char * | tle_line_1, |
const char * | tle_line_2 | ||
) |
Create predict_orbital_elements_t from TLE strings.
tle_line_1 | First line of NORAD two-line element set string |
tle_line_2 | Second line of NORAD two-line element set string |
double predict_perigee | ( | const predict_orbital_elements_t * | x | ) |
Get perigee of satellite orbit.
x | Orbital elements |
double predict_refraction | ( | double | el | ) |
Calculate refraction angle.
This function assumes atmospheric pressure of 101.0kPa and temperature 10deg celsius.
el | True elevation angle (rad). |
double predict_refraction_ext | ( | double | el, |
double | pressure, | ||
double | temp | ||
) |
Calculate refraction angle.
Corrects for different atmospheric pressure and temperature.
el | True elevation angle in rads. |
pressure | Atmospheric pressure in kPa. |
temp | Temperature in deg celsius. |
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.
apparent_el | Apparent elevation 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.
apparent_el | Apparent elevation angle (rad). |
pressure | Atmospheric pressure in kPa. |
temp | Temperature in deg celsius. |
double predict_refraction_rate | ( | double | el, |
double | el_rate | ||
) |
Calculate refraction rate of change.
el | True elevation angle (rad). |
el_rate | Rate of change of true elevation angle (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.
el | True elevation angle (rad). |
el_rate | Rate of change of true elevation angle (rad/s). |
pressure | Atmospheric pressure in kPa. |
temp | Temperature in deg celsius. |
double predict_squint_angle | ( | const predict_observer_t * | observer, |
const struct predict_position * | orbit, | ||
double | alon, | ||
double | alat | ||
) |
Calculate squint angle for satellite, i.e.
angle between the satellite antenna and the QTH antenna.
observer | Point of observation |
orbit | Current state of satellite orbit |
alon | Attitude longitude in radians (describes orientation of the satellite at apogee) |
alat | Attidue latitude in radians (see above) |
double predict_sun_declination | ( | predict_julian_date_t | time | ) |
Calculate declination of the sun.
observer | Point of observation |
time | Time of observation |
double predict_sun_gha | ( | predict_julian_date_t | time | ) |
Calculate the greenwich hour angle (longitude) of the sun.
time | Time |
double predict_sun_ra | ( | predict_julian_date_t | time | ) |
Calculate right ascension of the sun.
observer | Point of observation |
time | Time of observation |
predict_julian_date_t predict_to_julian | ( | time_t | time | ) |
Convert time_t in UTC to Julian date in UTC.
time | Time in UTC |
int predict_version | ( | ) |
Get the version number of the library.
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.
char* predict_version_string | ( | ) |
Get the version number string of the library.