perturb 1.0.0
A modern C++11 wrapper for the SGP4 orbit propagator
Loading...
Searching...
No Matches
perturb::TwoLineElement Struct Reference

Represents a pre-parsed TLE record. More...

#include <tle.hpp>

Public Member Functions

TLEParseError parse (const char *line_1, const char *line_2)
 Parse a TLE record string. More...
 
TLEParseError parse (const std::string &line_1, const std::string &line_2)
 Wrapper for TwoLineElement::parse that accepts C++ style strings. More...
 

Public Attributes

char catalog_number [6]
 Satellite catalog number.
 
char classification
 Classification {U: Unclassified, C: Classified, S: Secret}.
 
unsigned int launch_year
 International Designator - Launch year (last two digits)
 
unsigned int launch_number
 International Designator - Launch number of the year.
 
char launch_piece [4]
 International Designator - Piece of launch.
 
unsigned int epoch_year
 Epoch year (last two digits)
 
double epoch_day_of_year
 Epoch fractional day of year.
 
double n_dot
 First derivative of mean motion (ballistic coefficient) [rev/day^2].
 
double n_ddot
 Second derivative of mean motion [rev/day^3].
 
double b_star
 B* radiation pressure coefficient [1 / (earth radii)].
 
unsigned char ephemeris_type
 Orbital model used to generate data (usually 0)
 
unsigned int element_set_number
 Element set number.
 
unsigned char line_1_checksum
 Line 1 check-sum.
 
double inclination
 Inclination, 0 ≤ [deg] ≤ 180.
 
double raan
 Right ascension of the ascending node, 0 ≤ [deg] ≤ 360.
 
double eccentricity
 Eccentricity (0 ≤ [] ≤ 1)
 
double arg_of_perigee
 Argument of perigee, 0 ≤ [deg] ≤ 360.
 
double mean_anomaly
 Mean anomaly, 0 ≤ [deg] ≤ 360.
 
double mean_motion
 Mean motion, 0 < [rev/day].
 
unsigned long revolution_number
 Revolution number at epoch, 0 ≤ [rev] ≤ 99999.
 
unsigned char line_2_checksum
 Line 2 check-sum.
 

Detailed Description

Represents a pre-parsed TLE record.

Can be generated via TwoLineElement::parse, but not particularly useful unless you care about the specific TLE values. If you want to parse a TLE from a string and use it for SGP4 in one go, then better to use the Satellite::from_tle methods.

The primary purpose of this type is when the PERTURB_DISABLE_IO flag is set, as then there's no way to construct a Satellite from a TLE. In such a case where all I/O and string processing is removed, this type still allows you to construct and initialize a Satellite manually. However, you must handle your own method of creating the TwoLineElements.

Member Function Documentation

◆ parse() [1/2]

TLEParseError perturb::TwoLineElement::parse ( const char *  line_1,
const char *  line_2 
)

Parse a TLE record string.

You probably don't need this method. As I explain in the TwoLineElement and and Satellite() constructor docs, you should probably just use the Satellite::from_tle method directly. This method must be called on an existing TwoLineElement variable, so it can return the error code.

This currently uses my own implementation of a parser that doesn't support every case that Vallado's impl does, so there may be the occasional false error.

Postcondition
See the perturb::TLEParseError docs for the guaranteed error ordering.
Parameters
line_1First line of TLE as C-string of length perturb::TLE_LINE_LEN
line_2Second line of TLE as C-string of length perturb::TLE_LINE_LEN
Returns
Issues with parsing, should usually be TLEParseError::NONE. The parsed values are written into the TwoLineElement instance.

◆ parse() [2/2]

TLEParseError perturb::TwoLineElement::parse ( const std::string &  line_1,
const std::string &  line_2 
)

Wrapper for TwoLineElement::parse that accepts C++ style strings.

Parameters
line_1First line of TLE
line_2Second line of TLE
Returns
Issues with parsing, should usually be TLEParseError::NONE

The documentation for this struct was generated from the following files: