40 vector<tlestruc> tles;
51 FILE *
fp = fopen(argv[2],
"r");
53 while ((ic=fgetc(fp)) != EOF)
71 double start =
iso86012utc(member.object.at(
"start").svalue);
74 startloc.pos.eci.pass++;
77 eci2kep(startloc.pos.eci, startkep);
78 tovernal = atan2(startloc.pos.extra.sun2earth.s.col[1], startloc.pos.extra.sun2earth.s.col[0]);
79 double startphase =
fixangle(startkep.
ma + startkep.
raan - tovernal);
81 double end =
iso86012utc(member.object.at(
"end").svalue);
84 endloc.pos.eci.pass++;
87 eci2kep(endloc.pos.eci, endkep);
88 tovernal = atan2(endloc.pos.extra.sun2earth.s.col[1], endloc.pos.extra.sun2earth.s.col[0]);
92 double dphase = (1./86400.) * (endphase - startphase) / (end - start);
94 printf(
"%s\t", member.object.at(
"id").svalue.c_str());
95 printf(
"%s\t", member.object.at(
"start").svalue.c_str());
96 printf(
"%s\t",
to_mjd(start).c_str());
100 printf(
"%s\t", member.object.at(
"end").svalue.c_str());
101 printf(
"%s\t",
to_mjd(end).c_str());
107 if (member.object.at(
"status").svalue ==
"good")
121 if (nodename.find(
":") != string::npos)
123 minelev =
RADOF(stof(nodename.substr(nodename.find(
":")+1)));
124 nodename = nodename.substr(0, nodename.find(
":"));
127 if ((iretn = agent->
wait()) >= 0)
135 bool visible =
false;
138 for (utcnow=59159.642; utcnow<
currentmjd(); utcnow+=1./86400)
144 switch (static_cast<uint8_t>(visible))
157 if (target.
elfrom > highest)
170 if (tca.
elfrom >= minelev)
175 double startphase =
fixangle(startkep.
ma + startkep.
raan - tovernal);
184 printf(
"00000001\t");
209 vector<double> amateurs = {59174.41688, 59177.03267, 59184.09772, 59187.79667, 59188.54722, 59189.95972};
210 for (
double amateur : amateurs)
219 double startphase =
fixangle(startkep.
ma + startkep.
raan - tovernal);
230 double dphase = (1./86400.) * (endphase - startphase) / (endloc.
pos.
eci.
utc - startloc.
pos.
eci.
utc);
232 printf(
"00000000\t");
int32_t eci2kep(cartpos &eci, kepstruc &kep)
Definition: convertlib.cpp:2934
Target structure.
Definition: jsondef.h:1290
double utc
UTC of Position.
Definition: convertdef.h:161
static antstruc target
Definition: agent_antenna.cpp:160
uint32_t pass
pass indicator: allows synchronization with other attitude and position values.
Definition: convertdef.h:170
double ma
Mean Anomoly.
Definition: convertdef.h:555
int32_t update_target(cosmosstruc *cinfo)
Update Track list.
Definition: jsonlib.cpp:11262
int iretn
Definition: rw_test.cpp:37
int32_t wait(State state=State::RUN, double waitsec=10.)
Definition: agentclass.cpp:398
float earthsep
Separation between sun/satellite and sun/limbofearth vectors in radians.
Definition: convertdef.h:746
nodestruc node
Structure for summary information in node.
Definition: jsondef.h:4220
double iso86012utc(string date)
Definition: timelib.cpp:1305
int32_t extract_contents(string json)
Definition: jsonclass.cpp:16
rvector s
Location.
Definition: convertdef.h:163
bool data_isfile(string path, off_t size)
Definition: datalib.cpp:1895
static Agent * agent
ensure the Agent constructor creates only one instance per process
Definition: agent_001.cpp:45
Definition: agentclass.h:139
locstruc loc
Location structure.
Definition: jsondef.h:3596
#define DEGOF(rad)
Degrees of a Radian value.
Definition: math/constants.h:33
double fixangle(double angle)
Limit angle to range 0-2PI.
Definition: mathlib.cpp:2159
int32_t pos_eci(locstruc *loc)
Set ECI position.
Definition: convertlib.cpp:258
extrapos extra
Definition: convertdef.h:744
double raan
Right Ascension of the Ascending Node in radians.
Definition: convertdef.h:549
Classical elements structure.
Definition: convertdef.h:529
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
double currentmjd(double offset)
Current UTC in Modified Julian Days.
Definition: timelib.cpp:65
posstruc pos
posstruc for this time.
Definition: convertdef.h:881
string nodename
Definition: agent_add_soh.cpp:54
locstruc loc
Definition: jsondef.h:1302
double col[3]
Definition: vector.h:55
Definition: jsonclass.h:11
cosmosstruc * cinfo
Definition: agentclass.h:346
cartpos eci
Definition: convertdef.h:737
FILE * fp
Definition: rw_test.cpp:38
string mjd2iso8601(double mjd)
Definition: timelib.cpp:1316
Definition: convertdef.h:876
int lines2eci(double utc, vector< tlestruc >lines, cartpos &eci)
Return position from TLE set.
Definition: convertlib.cpp:3155
float elfrom
Definition: jsondef.h:1296
string to_mjd(double value)
Definition: stringlib.cpp:298
string to_double(double value, uint16_t precision)
Definition: stringlib.cpp:285
Array ArrayContents
Definition: jsonclass.h:82
#define RADOF(deg)
Radians of a Degree value.
Definition: math/constants.h:29