silence some debugging, progress on galcov, rename 'NO SIS' to 'NO SISA'
parent
dd3bc192e7
commit
d09cb2884c
24
coverage.cc
24
coverage.cc
|
@ -12,8 +12,6 @@ using namespace std;
|
|||
extern GetterSetter<map<int, GalileoMessage::Almanac>> g_galileoalmakeeper;
|
||||
extern GetterSetter<svstats_t> g_statskeeper;
|
||||
|
||||
// a vector of pairs of latidude,vector<longitude,numsats>
|
||||
typedef vector<pair<double,vector<pair<double, int> > > > covmap_t;
|
||||
|
||||
covmap_t emitCoverage()
|
||||
{
|
||||
|
@ -24,7 +22,7 @@ covmap_t emitCoverage()
|
|||
auto galileoalma = g_galileoalmakeeper.get();
|
||||
auto svstats = g_statskeeper.get();
|
||||
auto pseudoTow = (time(0) - 820368000) % (7*86400);
|
||||
cout<<"pseudoTow "<<pseudoTow<<endl;
|
||||
// cout<<"pseudoTow "<<pseudoTow<<endl;
|
||||
for(const auto &g : galileoalma) {
|
||||
Point sat;
|
||||
getCoordinates(pseudoTow, g.second, &sat);
|
||||
|
@ -32,21 +30,18 @@ covmap_t emitCoverage()
|
|||
if(g.first < 0)
|
||||
continue;
|
||||
if(svstats[{2,g.first,1}].completeIOD() && svstats[{2,g.first,1}].liveIOD().sisa == 255) {
|
||||
cout<<g.first<<" NAPA!"<<endl;
|
||||
// cout<<g.first<<" NAPA!"<<endl;
|
||||
continue;
|
||||
}
|
||||
sats[g.first]=sat;
|
||||
}
|
||||
cout<<"Have "<<sats.size()<<" SVs active"<<endl;
|
||||
double R = 6371000;
|
||||
for(int latitude = 90 ; latitude > -90; latitude-=1) { // north-south
|
||||
for(double latitude = 90 ; latitude > -90; latitude-=0.5) { // north-south
|
||||
double phi = M_PI* latitude / 180;
|
||||
double longsteps = 1 + 360.0 * cos(phi);
|
||||
double step = 360.0 / longsteps;
|
||||
cout<<"lat "<<latitude<<" Step size: "<<step<<endl;
|
||||
vector<pair<double, int>> latvect;
|
||||
double step = 180.0 / longsteps;
|
||||
vector<tuple<double, int, int, int>> latvect;
|
||||
for(double longitude = -180; longitude < 180; longitude += step) { // east - west
|
||||
cout<<" long "<<longitude<<endl;
|
||||
Point p;
|
||||
// phi = latitude, lambda = longitude
|
||||
|
||||
|
@ -72,11 +67,12 @@ covmap_t emitCoverage()
|
|||
if(elev > 20.0)
|
||||
numsats20++;
|
||||
}
|
||||
latvect.push_back(make_pair(longitude, numsats10));
|
||||
cmap << longitude <<" " <<latitude <<" " << numsats5 << " " <<numsats10<<" "<<numsats20<<endl;
|
||||
if(numsats20 < 4)
|
||||
latvect.push_back(make_tuple(longitude, numsats5, numsats10, numsats20));
|
||||
// cmap << longitude <<" " <<latitude <<" " << numsats5 << " " <<numsats10<<" "<<numsats20<<endl;
|
||||
}
|
||||
ret.push_back(make_pair(latitude, latvect));
|
||||
cout<<endl;
|
||||
if(!latvect.empty())
|
||||
ret.push_back(make_pair(latitude, latvect));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -150,7 +150,7 @@ function maketable(str, arr)
|
|||
if(column == "sisa" && myRe.test(row[column]))
|
||||
ret.color="#ff2222";
|
||||
|
||||
if(column == "sisa" && row[column]=="NO SIS AVAILABLE")
|
||||
if(column == "sisa" && row[column]=="NO SISA AVAILABLE")
|
||||
ret.color="#ff2222";
|
||||
return ret;
|
||||
})
|
||||
|
|
22
navparse.cc
22
navparse.cc
|
@ -93,7 +93,7 @@ string humanSisa(uint8_t sisa)
|
|||
return std::to_string(200 + 16*(sval-100))+" cm";
|
||||
if(sisa < 255)
|
||||
return "SPARE";
|
||||
return "NO SIS AVAILABLE";
|
||||
return "NO SISA AVAILABLE";
|
||||
}
|
||||
|
||||
string humanUra(uint8_t ura)
|
||||
|
@ -715,8 +715,17 @@ try
|
|||
item["observed"] = false;
|
||||
for(uint32_t sigid : {0,1,5}) {
|
||||
if(auto iter = svstats.find({2, (uint32_t)ae.first, sigid}); iter != svstats.end()) {
|
||||
if(time(0) - nanoTime(2, iter->second.wn, iter->second.tow)/1000000000 < 300)
|
||||
|
||||
if(iter->second.completeIOD()) {
|
||||
item["sisa"] = iter->second.liveIOD().sisa;
|
||||
}
|
||||
// if we hit an 'observed', stop trying sigids
|
||||
if(time(0) - nanoTime(2, iter->second.wn, iter->second.tow)/1000000000 < 300) {
|
||||
item["observed"] = true;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -873,7 +882,6 @@ try
|
|||
|
||||
h2s.addHandler("/sv.json", [](auto handler, auto req) {
|
||||
string_view path = convert(req->path);
|
||||
cout<<path<<endl;
|
||||
nlohmann::json ret = nlohmann::json::object();
|
||||
|
||||
SatID id;
|
||||
|
@ -973,7 +981,7 @@ try
|
|||
auto ret = nlohmann::json::array();
|
||||
|
||||
// ret =
|
||||
// [ [90, [[-180, 3], [-179, 3], ... [180,3] ]]
|
||||
// [ [90, [[-180, 3,2,1], [-179, 3,2,1], ... [180,3,2,1] ]]
|
||||
// [89, [[-180, 4], [-179, 4], ... [180,2] ]]
|
||||
// ]
|
||||
for(const auto& latvect : cov) {
|
||||
|
@ -981,8 +989,10 @@ try
|
|||
auto jslongvect = nlohmann::json::array();
|
||||
for(const auto& longpair : latvect.second) {
|
||||
auto jsdatum = nlohmann::json::array();
|
||||
jsdatum.push_back((int)longpair.first);
|
||||
jsdatum.push_back(longpair.second);
|
||||
jsdatum.push_back((int)get<0>(longpair));
|
||||
jsdatum.push_back(get<1>(longpair));
|
||||
jsdatum.push_back(get<2>(longpair));
|
||||
jsdatum.push_back(get<3>(longpair));
|
||||
jslongvect.push_back(jsdatum);
|
||||
}
|
||||
jslatvect.push_back(latvect.first);
|
||||
|
|
|
@ -142,6 +142,8 @@ struct SVStat
|
|||
|
||||
typedef std::map<SatID, SVStat> svstats_t;
|
||||
|
||||
typedef vector<pair<double,vector<pair<double, int> > > > covmap_t;
|
||||
// a vector of pairs of latidude,vector<longitude,numsats>
|
||||
typedef vector<pair<double,vector<tuple<double, int, int, int> > > > covmap_t;
|
||||
|
||||
covmap_t emitCoverage();
|
||||
|
||||
|
|
2
tle.cc
2
tle.cc
|
@ -98,7 +98,7 @@ TLERepo::Match TLERepo::getBestMatch(time_t now, double x, double y, double z, T
|
|||
distances.insert({1000.0*(rot - sat).Magnitude(),sgp4.first});
|
||||
}
|
||||
catch(SatelliteException& se) {
|
||||
cerr<<"TLE error: "<<se.what()<<endl;
|
||||
// cerr<<"TLE error: "<<se.what()<<endl;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue