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

Functions

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

Function Documentation

int main ( int  argc,
char *  argv[] 
)
37 {
38  string filename = argv[1];
39  double deltat = atof(argv[2])/86400.;
40 
41  string input;
42 
43  FILE *fp = fopen(filename.c_str(), "r");
44  int ic;
45  int32_t id;
46  int32_t im;
47  int32_t iy;
48  int32_t ihh;
49  int32_t imm;
50  int32_t iss;
51  float x;
52  float y;
53  float z;
54  float a;
55  float b;
56  float c;
57  double initialutc = 0.;
58 
59  while ((ic=fscanf(fp, "%d/%d/%d %d:%d:%d %f %f %f %f %f %f\n", &im, &id, &iy, &ihh, &imm, &iss, &x, &y, &z, &a, &b, &c)) != EOF)
60  {
61  locstruc loc;
62  loc.pos.eci.utc = cal2mjd(iy, im, id, ihh, imm, iss);
63  if (initialutc == 0.)
64  {
65  initialutc = loc.pos.eci.utc;
66  }
67  loc.pos.eci.s.col[0] = x;
68  loc.pos.eci.s.col[1] = y;
69  loc.pos.eci.s.col[2] = z;
70  loc.pos.eci.pass++;
71  pos_eci(loc);
72  avector abc(RADOF(a), RADOF(b), RADOF(c));
73  loc.att.icrf.utc = loc.pos.eci.utc;
74  loc.att.icrf.s = q_euler2quaternion(abc);
75  loc.att.icrf.pass++;
76  att_icrf(loc);
77 
78  loc.pos.geoc.utc += deltat;
79  loc.pos.geoc.pass++;
80  pos_geoc(loc);
81  loc.att.geoc.utc += deltat;
82  loc.att.geoc.pass++;
83  att_geoc(loc);
84 
85  abc = a_quaternion2euler(loc.att.icrf.s);
86  calstruc date = mjd2cal(loc.pos.eci.utc);
87 
88  printf("%d/%d/%d %d:%02d:%02d\t%.0f\t%f\t%f\t%f\t%f\t%f\t%f\n", date.month, date.dom, date.year, date.hour, date.minute, date.second, 86400.*(loc.pos.eci.utc - initialutc), loc.pos.eci.s.col[0], loc.pos.eci.s.col[1], loc.pos.eci.s.col[2], DEGOF(abc.h), DEGOF(abc.e), DEGOF(abc.b));
89  };
90 
91  fclose(fp);
92 
93 }
quaternion q_euler2quaternion(avector rpw)
Definition: vector.cpp:1233
int32_t dom
Definition: timelib.h:110
calstruc mjd2cal(double mjd)
MJD to Calendar.
Definition: timelib.cpp:180
qatt geoc
Definition: convertdef.h:828
y
Definition: inputfile.py:6
double utc
UTC of Position.
Definition: convertdef.h:161
uint32_t pass
pass indicator: allows synchronization with other attitude and position values.
Definition: convertdef.h:170
cartpos geoc
Definition: convertdef.h:739
int32_t att_icrf(locstruc *loc)
Definition: convertlib.cpp:1836
int32_t hour
Definition: timelib.h:112
long b
Definition: jpegint.h:371
double utc
Definition: convertdef.h:477
static double initialutc
Definition: physicslib.cpp:43
Definition: timelib.h:106
rvector s
Location.
Definition: convertdef.h:163
attstruc att
attstruc for this time.
Definition: convertdef.h:883
int32_t month
Definition: timelib.h:109
3 element attitude vector.
Definition: vector.h:277
qatt icrf
Definition: convertdef.h:830
double cal2mjd(int32_t year, int32_t month, int32_t day, int32_t hour, int32_t minute, int32_t second, int32_t nsecond)
Calendar representation to Modified Julian Day - full.
Definition: timelib.cpp:294
int32_t pos_geoc(locstruc *loc)
Set Geocentric position.
Definition: convertlib.cpp:366
#define DEGOF(rad)
Degrees of a Radian value.
Definition: math/constants.h:33
int32_t att_geoc(locstruc *loc)
Definition: convertlib.cpp:1682
int32_t pos_eci(locstruc *loc)
Set ECI position.
Definition: convertlib.cpp:258
x
Definition: inputfile.py:6
Definition: eci2kep_test.cpp:33
int32_t minute
Definition: timelib.h:113
avector a_quaternion2euler(quaternion q)
Definition: vector.cpp:1256
posstruc pos
posstruc for this time.
Definition: convertdef.h:881
uint32_t pass
pass indicator: allows synchronization with other attitude and position values.
Definition: convertdef.h:485
quaternion s
0th derivative: Quaternion
Definition: convertdef.h:479
double col[3]
Definition: vector.h:55
int32_t year
Definition: timelib.h:108
cartpos eci
Definition: convertdef.h:737
FILE * fp
Definition: rw_test.cpp:38
int32_t second
Definition: timelib.h:114
Definition: convertdef.h:876
#define RADOF(deg)
Radians of a Degree value.
Definition: math/constants.h:29