COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
state2tle.cpp File Reference
#include "support/configCosmos.h"
#include "support/jsonlib.h"
#include "physics/physicslib.h"
#include "agent/agentclass.h"
#include <fstream>
Include dependency graph for state2tle.cpp:

Functions

int main (int argc, char *argv[])
 

Function Documentation

int main ( int  argc,
char *  argv[] 
)
15 {
16  if (argc != 9) {
17  std::cout << "Usage: state2tle sx sy sz vx vy vz utc reference-tle-file" << std::endl;
18  exit(1);
19  }
20 
21  // Load our TLE.
22  std::ifstream tle_file(argv[8]);
23  std::stringstream ref_tle;
24  ref_tle << tle_file.rdbuf();
25 
26  cartpos eci_pos;
27  eci_pos.s.col[0] = std::stod(argv[1]);
28  eci_pos.s.col[1] = std::stod(argv[2]);
29  eci_pos.s.col[2] = std::stod(argv[3]);
30  eci_pos.v.col[0] = std::stod(argv[4]);
31  eci_pos.v.col[1] = std::stod(argv[5]);
32  eci_pos.v.col[2] = std::stod(argv[6]);
33  eci_pos.utc = std::stod(argv[7]);;
34 
35  string generated_tle;
36  eci2tlestring(eci_pos, generated_tle, ref_tle.str());
37  std::cout << generated_tle
38  << std::endl;
39 }
double utc
UTC of Position.
Definition: convertdef.h:161
Cartesian full position structure.
Definition: convertdef.h:158
int32_t eci2tlestring(cartpos eci, string &tle, string ref_tle, double bstar)
Definition: convertlib.cpp:4249
rvector s
Location.
Definition: convertdef.h:163
double col[3]
Definition: vector.h:55
rvector v
Velocity.
Definition: convertdef.h:165