COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
tle2state.cpp File Reference
Include dependency graph for tle2state.cpp:

Functions

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

Function Documentation

int main ( int  argc,
char *  argv[] 
)
36 {
37  cartpos eci;
38  std::vector <tlestruc> tle;
39  double utc = 0.;
40  std::string tlename;
41 
42  switch (argc)
43  {
44  case 3:
45  utc = atof(argv[2]);
46  case 2:
47  tlename = argv[1];
48  break;
49  default:
50  printf("Usage: tle2eci tlename [mjd] \n");
51  exit(1);
52  break;
53  }
54 
55  load_lines(argv[1], tle);
56 
57  if (utc == 0.)
58  {
59  utc = tle[0].utc;
60  }
61 
62  tle2eci(utc, tle[0], eci);
63  eci.utc = utc;
64 
65  std::string jsp;
66  json_out_ecipos(jsp, eci);
67 
68  printf("%s\n", jsp.c_str());
69 }
static std::vector< tlestruc > tle
Definition: agent_antenna.cpp:177
double utc
UTC of Position.
Definition: convertdef.h:161
string tlename
Definition: fast_contacts.cpp:39
Cartesian full position structure.
Definition: convertdef.h:158
int32_t json_out_ecipos(string &jstring, cartpos value)
ECI position to JSON.
Definition: jsonlib.cpp:2324
int32_t load_lines(string fname, vector< tlestruc > &lines)
Load TLE from file. TODO!!! Rename Function to loadTle and create new class for dealing with TLEs...
Definition: convertlib.cpp:3612
int tle2eci(double utc, tlestruc tle, cartpos &eci)
Definition: convertlib.cpp:3466