18#ifndef PERTURB_PERTURB_HPP
19#define PERTURB_PERTURB_HPP
25#ifndef PERTURB_DISABLE_IO
35using Vec3 = std::array<double, 3>;
56 EPOCH_ELEMENTS_SUB_ORBITAL,
274#ifndef PERTURB_DISABLE_IO
287 char *line_1,
char *line_2,
GravModel grav_model = GravModel::WGS72
291#ifndef PERTURB_DISABLE_IO
299 std::string &line_1, std::string &line_2,
GravModel grav_model = GravModel::WGS72
Represents a specific orbital ephemeris for an Earth-centered trajectory.
Definition: perturb.hpp:241
sgp4::elsetrec sat_rec
Internal SGP4 type.
Definition: perturb.hpp:244
static Satellite from_tle(char *line_1, char *line_2, GravModel grav_model=GravModel::WGS72)
Construct and initialize a Satellite from a TLE record.
Definition: perturb.cpp:189
Sgp4Error propagate_from_epoch(double mins_from_epoch, StateVector &sv)
Propagate the SGP4 model based on time around the epoch.
Definition: perturb.cpp:228
Sgp4Error propagate(JulianDate jd, StateVector &sv)
Propagate the SGP4 model to a specific time point.
Definition: perturb.cpp:236
JulianDate epoch() const
Return the epoch of the orbital ephemeris, likely from a TLE.
Definition: perturb.cpp:224
Sgp4Error last_error() const
Return the last recorded error in the internal SGP4 record.
Definition: perturb.cpp:220
Primary namespace for the perturb library, everything is in here.
Definition: perturb.hpp:32
std::array< double, 3 > Vec3
Alias for representing position and velocity vectors.
Definition: perturb.hpp:35
GravModel
Choice of gravity model / constants for the underlying SGP4 impl.
Definition: perturb.hpp:69
Sgp4Error
Possible issues during SGP4 propagation or even TLE parsing.
Definition: perturb.hpp:50
Header for the internal SGP4 impl from Vallado.
Classical Keplerian orbital elements.
Definition: perturb.hpp:211
double arg_of_perigee
Argument of perigee in [rad].
Definition: perturb.hpp:217
double semilatus_rectum
Samilatus rectum in [km].
Definition: perturb.hpp:212
double eccentricity
Eccentricity (unitless)
Definition: perturb.hpp:214
double semimajor_axis
Semimajor axis in [km].
Definition: perturb.hpp:213
double arg_of_latitude
Argument of latitude in [rad].
Definition: perturb.hpp:220
double longitude_of_periapsis
Longitude of periapsis in [rad].
Definition: perturb.hpp:222
double mean_anomaly
Mean anomaly in [rad].
Definition: perturb.hpp:219
double true_longitude
True longitude in [rad].
Definition: perturb.hpp:221
double inclination
Inlination in [rad].
Definition: perturb.hpp:215
double true_anomaly
True anomaly in [rad].
Definition: perturb.hpp:218
double raan
Right ascension of ascending node in [rad].
Definition: perturb.hpp:216
A basic and human readable representation of a point in time.
Definition: perturb.hpp:95
int month
Month from 1 to 12.
Definition: perturb.hpp:97
double sec
Fractional seconds from 0.0 to 59.999...
Definition: perturb.hpp:101
int day
Day from 1 to {28, 29, 30, 31} (depending on month)
Definition: perturb.hpp:98
int min
Minute from 0 to 59.
Definition: perturb.hpp:100
int year
Year from 1900 to 2100.
Definition: perturb.hpp:96
int hour
Hour from 0 to 23.
Definition: perturb.hpp:99
Represents a specific point in time on the Julian calendar.
Definition: perturb.hpp:117
JulianDate & operator+=(const double &delta_jd)
Add a delta number of days offset to this time point.
Definition: perturb.cpp:91
DateTime to_datetime() const
Convert to a DateTime representing the same time point.
Definition: perturb.cpp:53
void normalize()
Normalizes a Julian date representation to a canonical representation.
Definition: perturb.cpp:59
bool operator>=(const JulianDate &rhs) const
Compare if after than or same as another time point.
Definition: perturb.cpp:115
JulianDate()
Construct an empty julian date initialized to 0.
Definition: perturb.cpp:40
bool operator>(const JulianDate &rhs) const
Compare if chronologically after than another time point.
Definition: perturb.cpp:107
JulianDate operator+(const double &delta_jd) const
Returns another time point offset by a number of days.
Definition: perturb.cpp:85
double operator-(const JulianDate &rhs) const
Returns the difference/delta in times as a fractional number of days.
Definition: perturb.cpp:80
bool operator<=(const JulianDate &rhs) const
Compare if earlier than or same as another time point.
Definition: perturb.cpp:111
bool operator<(const JulianDate &rhs) const
Compare if chronologically earlier than another time point.
Definition: perturb.cpp:103
JulianDate normalized() const
Get a normalized copy of a julian date.
Definition: perturb.cpp:74
JulianDate & operator-=(const double &delta_jd)
Subtracts a delta number of days offset to this time point.
Definition: perturb.cpp:99
double jd_frac
Smaller fractional number of days.
Definition: perturb.hpp:121
double jd
Fractional number of days since the epoch (4713 B.C.)
Definition: perturb.hpp:119
Represents the output prediction from SGP4.
Definition: perturb.hpp:198
Vec3 velocity
Velocity in the TEME frame in [km/s].
Definition: perturb.hpp:204
JulianDate epoch
Time-stamp of the state vector.
Definition: perturb.hpp:200
Vec3 position
Position in the TEME frame in [km].
Definition: perturb.hpp:202
Represents a pre-parsed TLE record.
Definition: tle.hpp:65
Header for custom TLE (two line element) processing.