missing files

hzcorr
bert hubert 2019-09-22 18:04:46 +02:00
parent 79067714b0
commit d47d61ee5f
10 changed files with 762 additions and 0 deletions

File diff suppressed because one or more lines are too long

2
html/ext/topojson.v1.min.js vendored 100644

File diff suppressed because one or more lines are too long

48
html/observer.html 100644
View File

@ -0,0 +1,48 @@
<!DOCTYPE html>
<meta charset="utf-8">
<style>
text {
font: 12px sans-serif;
}
th, td {
padding-left: 8px;
padding-right: 8px;
padding-top: 1px;
padding-bottom: 1px;
font-family: monospace;
}
tr:nth-child(even) {background: #CCC}
tr:nth-child(odd) {background: #FFF}
.Orbits{margin-top:3em;margin-bottom:1em}.Orbits .Variables{display:inline-block;vertical-align:top;width:28em;height:44em;overflow:auto;position:relative}.Orbits .Variables table{font-family:'Roboto Mono',monospace;color:#000;border-spacing:.5em;display:block;position:absolute;left:50%;transform:translateX(-50%)}.Orbits .Variables table tr{text-align:center}.Orbits .Variables table td{font-size:.85em}.Orbits .Drawing{display:inline-block;vertical-align:top;margin-top:.5em;width:44em;height:44em}.Orbits .Drawing .sats-label{font-size:12px;fill:#454545;font-weight:bold;stroke:transparent}.Orbits .Drawing .satellite circle{stroke-width:2px}.Orbits .Drawing svg{font-family:sans-serif;font-size:10px;text-anchor:middle;fill:none;stroke:#000;width:100%;height:100%}
</style>
<body>
Last update: <span id="freshness"></span>. More information about this Galileo/GPS/BeiDou/Glonass open source monitor can be found <a href="https://github.com/ahupowerdns/galmon/blob/master/README.md#galmon">here</a>. Live map <a href="geo">here!</a>. Contact <a href="https://ds9a.nl/">me</a> if you want access to the Grafana dashboard.<br/>
<table><tr><td valign="top">
<table id="galileo"></table></td><td valign="top">
<div class="Orbits">
<center>
<div class="Drawing"></div>
</center>
</div>
</td></tr></table>
<p>
This table shows live output from four Galileo/GPS/BeiDou/GLONASS receivers hosted in Nootdorp, The Netherlands and California, United States.
It is very much a work in progress, and will not be available at all times. Extremely rough code is on
<a href="https://github.com/ahuPowerDNS/galmon">GitHub</a>.
Some technical detail behind this setup can be found in <a href="https://ds9a.nl/articles/posts/galileo-notes/">this post</a>.
For updates, follow <a href="https://twitter.com/GalileoSats">@GalileoSats</a> on Twitter, or join us on our IRC channel (chat) via the
<a href="https://webchat.oftc.net/?channels=galileo">web gateway</a>.
<script src="d3.v4.min.js"></script>
<script src="ext/moment-with-locales.js"></script>
<script src="observer.js"></script>
</body>
</html>

240
html/observer.js 100644
View File

@ -0,0 +1,240 @@
"use strict";
var repeat;
moment.relativeTimeThreshold('m', 120);
function flippedStereographic(x, y) {
var cx = Math.cos(x), cy = Math.cos(y), k = 1 / (1 + cx * cy);
return [k * cy * Math.sin(x), -k * Math.sin(y)];
}
var gnss_position=[];
function componentDidMount() {
var sats = d3.select(".Drawing").html("").append("svg");
var width = 500; //sats.clientWidth;
var height = 500; //sats.clientHeight;
sats.attr("width", 500);
sats.attr("height", 500);
var projection = d3.geoProjection(flippedStereographic)
.scale(width * 0.40)
.clipAngle(130)
.rotate([0, -90])
.translate([width / 2 + 0.5, height / 2 + 0.5])
.precision(1);
var path = d3.geoPath().projection(projection);
sats.append("path")
.datum(d3.geoCircle().center([0, 90]).radius(90))
.attr("stroke-width", 1.5)
.attr("d", path);
sats.append("path")
.datum(d3.geoGraticule())
.attr("stroke-width", 0.15)
.attr("d", path);
// .attr("fill", "none").attr("stroke", "black").attr("width", "100%").attr("height", "100%");
sats.append("g")
.selectAll("line")
.data(d3.range(360))
.enter().append("line")
.each(function(d) {
var p0 = projection([d, 0]),
p1 = projection([d, d % 10 ? -1 : -2]);
d3.select(this)
.attr("x1", p0[0])
.attr("y1", p0[1])
.attr("x2", p1[0])
.attr("y2", p1[1]);
});
sats.append("g")
.attr("fill", "black")
.attr("stroke", "none")
.selectAll("text")
.data(d3.range(0, 360, 10))
.enter().append("text")
.each(function(d) {
var p = projection([d, -4]);
d3.select(this).attr("x", p[0]).attr("y", p[1]);
})
.attr("dy", "0.35em")
.text(function(d) { return d === 0 ? "N" : d === 90 ? "E" : d === 180 ? "S" : d === 270 ? "W" : d + "°"; })
.data(d3.range(0, 360, 90), function(d) { return d; })
.attr("font-weight", "bold")
.attr("font-size", 14);
sats.append("g")
.attr("fill", "#A3ACA9")
.attr("stroke", "none")
.selectAll("text")
.data(d3.range(10, 91, 10))
.enter().append("text")
.each(function(d) {
var p = projection([0, d]);
d3.select(this).attr("x", p[0]).attr("y", p[1]);
})
.attr("dy", "-0.4em")
.text(function(d) { return d + "°"; });
sats.select('g.satellites').remove();
console.log(gnss_position);
let points = sats
.insert("g")
.attr("class", "satellites")
.selectAll('g.satellite')
.data(gnss_position)
.enter()
.append('g')
.attr("transform", function(d) {
var p = projection(d);
return 'translate(' + p[0] + ', ' + p[1] + ')';
});
points
.attr('class', 'satellite')
.append("circle")
.attr("stroke", function(d) {
return d[3] > 0 ? "transparent" : d[5];
})
.attr("r", function(d) {
return d[3] > 0 ? d[3]*0.5 : 3;
})
.attr("fill", function(d) {
return d[3] > 0 ? d[5] : "transparent";
});
points
.attr("r", 50)
.append("text")
.attr("class", "sats-label")
.attr('dy', function(d) {
return d[3] > 0 ? `${10+(d[3]/2)}px` : "1.3em";
})
.attr('dx', function(d) {
return d[3] > 0 ? `${3+(d[3]/2)}px` : "0.7em";
})
.text(function(d){return d[2]})
}
function makeTable(str, obj)
{
var table=d3.select(str);
table.html("");
var thead=table.append("thead");
var tbody=table.append("tbody");
var arr=[];
gnss_position=[];
Object.keys(obj).forEach(function(e) {
if(e=="svs") {
Object.keys(obj[e]).forEach(function(k) {
arr.push({id: k, elev: obj[e][k].elev.toFixed(1),
sigid: obj[e][k].sigid,
db: obj[e][k].db, azi: obj[e][k].azi.toFixed(1), prres: obj[e][k].prres.toFixed(1), "age-s": obj[e][k]["age-s"]});
let color="blue";
let gnssid = obj[e][k].gnss;
if(gnssid == 0)
color="green";
else if(gnssid == 2)
color="blue";
else if(gnssid==3)
color="red"
else if(gnssid==6)
color="yellow";
gnss_position.push([obj[e][k].azi, obj[e][k].elev, k.split("@")[0] , obj[e][k].db/4,4, color]);
});
}
else
arr.push({id: e, value: obj[e]});
});
var rows=tbody.selectAll("tr").
data(arr).
enter().
append("tr");
var columns= ["id", "value", "sigid", "azi", "elev", "db", "prres", "age-s"];
// append the header row
thead.append("tr")
.selectAll("th")
.data(columns)
.enter()
.append("th")
.text(function(d) {
return d;
});
var cells = rows.selectAll("td").
data(function(row) {
return columns.map(function(column) {
var ret={};
ret.align = "right";
if(column=="id1" || column == "id2")
ret.value = row[column]+":";
else
ret.value = row[column];
ret.color= null;
return ret;
})}).
enter().append("td").html(function(d) {
return d.value;
}).attr("align", d=> d.align).style("background-color", d=> d.color);
}
var sats={};
var lastseen=null;
var observer=0;
function update()
{
var seconds = 10;
clearTimeout(repeat);
repeat=setTimeout(update, 1000.0*seconds);
if(lastseen != null)
d3.select("#freshness").html(lastseen.fromNow());
d3.json("./global.json", function(d) {
lastseen = moment(1000*d["last-seen"]);
d3.select("#freshness").html(lastseen.fromNow());
});
d3.queue(1).defer(d3.json, "./observers.json").defer(d3.json, "./almanac.json").awaitAll(ready);
function ready(error, results) {
var obj = {};
for(var n = 0 ; n < results[0].length; ++n) {
if(results[0][n].id == observer) {
obj=results[0][n];
break;
}
}
makeTable("#galileo", obj);
componentDidMount();
};
}
console.log(window.location.href);
var url = new URL(window.location.href);
observer = url.searchParams.get("observer");
repeat=update();

View File

@ -0,0 +1,60 @@
<!DOCTYPE html>
<meta charset="utf-8">
<style>
text {
font: 12px sans-serif;
}
th, td {
padding-left: 8px;
padding-right: 8px;
padding-top: 1px;
padding-bottom: 1px;
font-family: monospace;
}
tr:nth-child(even) {background: #CCC}
tr:nth-child(odd) {background: #FFF}
.CellWithComment{
position:relative;
}
.CellComment{
display:none;
position:absolute;
z-index:100;
border:1px;
background-color:white;
border-style:solid;
border-width:1px;
border-color:red;
padding:3px;
color:red;
top:20px;
left:20px;
}
.CellWithComment:hover span.CellComment{
display:block;
}
</style>
<body>
Last update: <span id="freshness"></span>. More information about this Galileo/GPS/BeiDou/Glonass open source monitor can be found <a href="https://github.com/ahupowerdns/galmon/blob/master/README.md#galmon">here</a>. Live map <a href="geo">here!</a>. Contact <a href="https://ds9a.nl/">me</a> if you want access to the Grafana dashboard.<br/>
<table id="galileo"></table>
<p>
This table shows live output from four Galileo/GPS/BeiDou/GLONASS receivers hosted in Nootdorp, The Netherlands and California, United States.
It is very much a work in progress, and will not be available at all times. Extremely rough code is on
<a href="https://github.com/ahuPowerDNS/galmon">GitHub</a>.
Some technical detail behind this setup can be found in <a href="https://ds9a.nl/articles/posts/galileo-notes/">this post</a>.
For updates, follow <a href="https://twitter.com/GalileoSats">@GalileoSats</a> on Twitter, or join us on our IRC channel (chat) via the
<a href="https://webchat.oftc.net/?channels=galileo">web gateway</a>.
<script src="d3.v4.min.js"></script>
<script src="ext/moment-with-locales.js"></script>
<script src="observers.js"></script>
</body>
</html>

94
html/observers.js 100644
View File

@ -0,0 +1,94 @@
"use strict";
var repeat;
moment.relativeTimeThreshold('m', 120);
function makeTable(str, arr)
{
var table=d3.select(str);
table.html("");
var thead=table.append("thead");
var tbody=table.append("tbody");
var rows=tbody.selectAll("tr").
data(arr).
enter().
append("tr");
var columns= ["id", "last-seen", "latitude", "longitude", "satellites"];
// append the header row
thead.append("tr")
.selectAll("th")
.data(columns)
.enter()
.append("th")
.text(function(d) {
return d;
});
var cells = rows.selectAll("td").
data(function(row) {
return columns.map(function(column) {
var ret={};
ret.align = "right";
ret.color = null;
if(column == "last-seen") {
ret.value = moment(1000*row["last-seen"]).fromNow();
let lastSeen = moment(1000*row["last-seen"]);
let age = (moment() - lastSeen);
// console.log(age.valueOf()/1000);
if(age.valueOf() / 60000 > 5)
ret.color = "red";
}
else if(column == "satellites") {
ret.value = "<small>";
Object.keys(row["svs"]).forEach(function(d) {ret.value = ret.value +" " + d; });
ret.value += "</small>";
ret.align = "left";
}
else {
ret.value = row[column];
}
return ret;
})}).
enter().append("td").html(function(d) {
return d.value;
}).attr("align", d=> d.align).style("background-color", d=> d.color);
}
var sats={};
var lastseen=null;
function update()
{
var seconds = 2;
clearTimeout(repeat);
repeat=setTimeout(update, 5000.0*seconds);
if(lastseen != null)
d3.select("#freshness").html(lastseen.fromNow());
d3.json("./global.json", function(d) {
lastseen = moment(1000*d["last-seen"]);
d3.select("#freshness").html(lastseen.fromNow());
});
d3.queue(1).defer(d3.json, "./svs.json").defer(d3.json, "./observers.json").awaitAll(ready);
function ready(error, results) {
var arr=[];
Object.keys(results[1]).forEach(function(e) {
arr.push(results[1][e]);
});
makeTable("#galileo", arr, results[0]);
};
}
repeat=update();

60
html/overview.html 100644
View File

@ -0,0 +1,60 @@
<!DOCTYPE html>
<meta charset="utf-8">
<style>
text {
font: 12px sans-serif;
}
th, td {
padding-left: 8px;
padding-right: 8px;
padding-top: 1px;
padding-bottom: 1px;
font-family: monospace;
}
tr:nth-child(even) {background: #CCC}
tr:nth-child(odd) {background: #FFF}
.CellWithComment{
position:relative;
}
.CellComment{
display:none;
position:absolute;
z-index:100;
border:1px;
background-color:white;
border-style:solid;
border-width:1px;
border-color:red;
padding:3px;
color:red;
top:20px;
left:20px;
}
.CellWithComment:hover span.CellComment{
display:block;
}
</style>
<body>
Last update: <span id="freshness"></span>. More information about this Galileo/GPS/BeiDou/Glonass open source monitor can be found <a href="https://github.com/ahupowerdns/galmon/blob/master/README.md#galmon">here</a>. Live map <a href="geo">here!</a>. Contact <a href="https://ds9a.nl/">me</a> if you want access to the Grafana dashboard.<br/>
<table id="galileo"></table>
<p>
This table shows live output from four Galileo/GPS/BeiDou/GLONASS receivers hosted in Nootdorp, The Netherlands and California, United States.
It is very much a work in progress, and will not be available at all times. Extremely rough code is on
<a href="https://github.com/ahuPowerDNS/galmon">GitHub</a>.
Some technical detail behind this setup can be found in <a href="https://ds9a.nl/articles/posts/galileo-notes/">this post</a>.
For updates, follow <a href="https://twitter.com/GalileoSats">@GalileoSats</a> on Twitter, or join us on our IRC channel (chat) via the
<a href="https://webchat.oftc.net/?channels=galileo">web gateway</a>.
<script src="d3.v4.min.js"></script>
<script src="ext/moment-with-locales.js"></script>
<script src="overview.js"></script>
</body>
</html>

97
html/overview.js 100644
View File

@ -0,0 +1,97 @@
"use strict";
var repeat;
moment.relativeTimeThreshold('m', 120);
function makeTable(str, arr, svs)
{
var table=d3.select(str);
table.html("");
var thead=table.append("thead");
var tbody=table.append("tbody");
var header=["",""];
var rows=tbody.selectAll("tr").
data(header).
enter().
append("tr");
var columns = arr;
columns.unshift("@");
console.log(columns);
// append the header row
thead.append("tr")
.selectAll("th")
.data(columns)
.enter()
.append("th")
.text(function(d) {
return d;
});
var sigid = 1;
var cells = rows.selectAll("td").
data(function(row) {
var oldsigid = sigid;
sigid = 5;
return columns.map(function(column) {
var ret={};
ret.sigid = oldsigid;
console.log("column: "+column);
console.log("sigid: "+oldsigid);
if(column=="@")
ret.value = oldsigid;
else if(sigid == 1)
ret.value = svs[column+"@"+sigid].e1bhs;
else if(sigid == 5)
ret.value = svs[column+"@"+sigid].e5bhs;
if(ret.value == 0 || column=='@')
ret.color = null;
else if(ret.value == 3)
ret.color="orange";
else ret.color = "red";
return ret;
})}).
enter().append("td").html(function(d) {
return d.value;
}).attr("align", "right").style("background-color", d=> d.color);
}
var sats={};
var lastseen=null;
function update()
{
var seconds = 2;
clearTimeout(repeat);
repeat=setTimeout(update, 5000.0*seconds);
if(lastseen != null)
d3.select("#freshness").html(lastseen.fromNow());
d3.json("global", function(d) {
lastseen = moment(1000*d["last-seen"]);
d3.select("#freshness").html(lastseen.fromNow());
});
d3.queue(1).defer(d3.json, "../svs").defer(d3.json, "../almanac").defer(d3.json, "../observers").awaitAll(ready);
function ready(error, results) {
var arr=[];
Object.keys(results[0]).forEach(function(e) {
// console.log(results[0][e]);
if(results[0][e].gnssid == 2 && results[0][e].sigid==1)
arr.push(e.slice(0,3));
});
makeTable("#galileo", arr, results[0]);
};
}
repeat=update();

60
html/sv.html 100644
View File

@ -0,0 +1,60 @@
<!DOCTYPE html>
<meta charset="utf-8">
<style>
text {
font: 12px sans-serif;
}
th, td {
padding-left: 8px;
padding-right: 8px;
padding-top: 1px;
padding-bottom: 1px;
font-family: monospace;
}
tr:nth-child(even) {background: #CCC}
tr:nth-child(odd) {background: #FFF}
.CellWithComment{
position:relative;
}
.CellComment{
display:none;
position:absolute;
z-index:100;
border:1px;
background-color:white;
border-style:solid;
border-width:1px;
border-color:red;
padding:3px;
color:red;
top:20px;
left:20px;
}
.CellWithComment:hover span.CellComment{
display:block;
}
</style>
<body>
Last update: <span id="freshness"></span>. More information about this Galileo/GPS/BeiDou/Glonass open source monitor can be found <a href="https://github.com/ahupowerdns/galmon/blob/master/README.md#galmon">here</a>. Live map <a href="geo">here!</a>. Contact <a href="https://ds9a.nl/">me</a> if you want access to the Grafana dashboard.<br/>
<table id="galileo"></table>
<p>
This table shows live output from four Galileo/GPS/BeiDou/GLONASS receivers hosted in Nootdorp, The Netherlands and California, United States.
It is very much a work in progress, and will not be available at all times. Extremely rough code is on
<a href="https://github.com/ahuPowerDNS/galmon">GitHub</a>.
Some technical detail behind this setup can be found in <a href="https://ds9a.nl/articles/posts/galileo-notes/">this post</a>.
For updates, follow <a href="https://twitter.com/GalileoSats">@GalileoSats</a> on Twitter, or join us on our IRC channel (chat) via the
<a href="https://webchat.oftc.net/?channels=galileo">web gateway</a>.
<script src="d3.v4.min.js"></script>
<script src="ext/moment-with-locales.js"></script>
<script src="sv.js"></script>
</body>
</html>

99
html/sv.js 100644
View File

@ -0,0 +1,99 @@
"use strict";
var repeat;
moment.relativeTimeThreshold('m', 120);
function makeTable(str, arr)
{
var table=d3.select(str);
table.html("");
var thead=table.append("thead");
var tbody=table.append("tbody");
var rows=tbody.selectAll("tr").
data(arr).
enter().
append("tr");
var columns= ["id1", "value1", "id2", "value2"];
// append the header row
thead.append("tr")
.selectAll("th")
.data(columns)
.enter()
.append("th")
.text(function(d) {
return d;
});
var cells = rows.selectAll("td").
data(function(row) {
return columns.map(function(column) {
var ret={};
ret.align = "right";
if(column=="id1" || column == "id2")
ret.value = row[column]+":";
else
ret.value = row[column];
ret.color= null;
return ret;
})}).
enter().append("td").html(function(d) {
return d.value;
}).attr("align", d=> d.align).style("background-color", d=> d.color);
}
var sats={};
var lastseen=null;
var sv=2;
var gnssid=3;
function update()
{
var seconds = 2;
clearTimeout(repeat);
repeat=setTimeout(update, 1000.0*seconds);
if(lastseen != null)
d3.select("#freshness").html(lastseen.fromNow());
d3.json("./global.json", function(d) {
lastseen = moment(1000*d["last-seen"]);
d3.select("#freshness").html(lastseen.fromNow());
});
d3.queue(1).defer(d3.json, "./sv.json?gnssid="+gnssid+"&sv="+sv).defer(d3.json, "./almanac.json").awaitAll(ready);
function ready(error, results) {
var arr=[];
Object.keys(results[0]).forEach(function(e) {
arr.push({id: e, value: results[0][e]});
});
var newarr=[];
for(var n=0 ; n < arr.length; n+=2) {
if(n + 1 < arr.length)
newarr.push({id1: arr[n].id, value1: arr[n].value, id2: arr[n+1].id, value2: arr[n+1].value});
else
newarr.push({id1: arr[n].id, value1: arr[n].value, id2: "", value2: ""});
}
makeTable("#galileo", newarr, results[0]);
};
}
console.log(window.location.href);
var url = new URL(window.location.href);
sv = url.searchParams.get("sv");
gnssid = url.searchParams.get("gnssid");
repeat=update();