G(f/y)&&a("overflow"),n*=y;t=b.length+1,N=c(g-o,t,0==o),G(g/t)>f-h&&a("overflow"),h+=G(g/t),g%=t,b.splice(g++,0,h)}return u(b)}function d(e){var t,r,i,s,o,u,p,l,d,y,b,S,g,h,N,I=[];for(e=n(e),S=e.length,t=D,r=0,o=v,u=0;u=t&&bG((f-r)/g)&&a("overflow"),r+=(p-t)*g,t=p,u=0;uf&&a("overflow"),b==t){for(l=r,d=T;y=d<=o?C:d>=o+k?k:d-o,!(l= 0x80 (not a basic code point)","invalid-input":"Invalid input"},L=T-C,G=Math.floor,w=String.fromCharCode;if(N={version:"1.3.2",ucs2:{decode:n,encode:u},decode:l,encode:d,toASCII:b,toUnicode:y},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return N});else if(S&&g)if(t.exports==S)g.exports=N;else for(I in N)N.hasOwnProperty(I)&&(S[I]=N[I]);else i.punycode=N}(this)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],434:[function(e,t,r){"use strict";function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,r,s){t=t||"&",r=r||"=";var o={};if("string"!=typeof e||0===e.length)return o;var n=/\+/g;e=e.split(t);var u=1e3;s&&"number"==typeof s.maxKeys&&(u=s.maxKeys);var p=e.length;u>0&&p>u&&(p=u);for(var m=0;m=0?(c=b.substr(0,S),l=b.substr(S+1)):(c=b,l=""),d=decodeURIComponent(c),y=decodeURIComponent(l),i(o,d)?a(o[d])?o[d].push(y):o[d]=[o[d],y]:o[d]=y}return o};var a=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],435:[function(e,t,r){"use strict";function i(e,t){if(e.map)return e.map(t);for(var r=[],i=0;i0&&u>n&&(u=n);for(var p=0;p=0?(m=y.substr(0,b),c=y.substr(b+1)):(m=y,c=""),l=decodeURIComponent(m),d=decodeURIComponent(c),i(s,l)?Array.isArray(s[l])?s[l].push(d):s[l]=[s[l],d]:s[l]=d}return s}},{}],438:[function(e,t,r){"use strict";var i=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,a){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map(function(a){var s=encodeURIComponent(i(a))+r;return Array.isArray(e[a])?e[a].map(function(e){return s+encodeURIComponent(i(e))}).join(t):s+encodeURIComponent(i(e[a]))}).join(t):a?encodeURIComponent(i(a))+r+encodeURIComponent(i(e)):""}},{}],439:[function(e,t,r){arguments[4][436][0].apply(r,arguments)},{"./decode":437,"./encode":438,dup:436}],440:[function(e,t,r){(function(t,i){(function(){function a(e,t){this._id=e,this._clearFn=t}var s=e("process/browser.js").nextTick,o=Function.prototype.apply,n=Array.prototype.slice,u={},p=0;r.setTimeout=function(){return new a(o.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new a(o.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(e){e.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},r.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},r._unrefActive=r.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},r.setImmediate="function"==typeof t?t:function(e){var t=p++,i=!(arguments.length<2)&&n.call(arguments,1);return u[t]=!0,s(function(){u[t]&&(i?e.apply(null,i):e.call(null),r.clearImmediate(t))}),t},r.clearImmediate="function"==typeof i?i:function(e){delete u[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":432,timers:440}],441:[function(e,t,r){function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function a(e,t,r){if(e&&p(e)&&e instanceof i)return e;var a=new i;return a.parse(e,t,r),a}function s(e){return u(e)&&(e=a(e)),e instanceof i?e.format():i.prototype.format.call(e)}function o(e,t){return a(e,!1,!0).resolve(t)}function n(e,t){return e?a(e,!1,!0).resolveObject(t):t}function u(e){return"string"==typeof e}function p(e){return"object"==typeof e&&null!==e}function m(e){return null===e}function c(e){return null==e}var l=e("punycode");r.parse=a,r.resolve=o,r.resolveObject=n,r.format=s,r.Url=i;var d=/^([a-z0-9.+-]+:)/i,y=/:[0-9]*$/,b=["<",">",'"',"`"," ","\r","\n","\t"],S=["{","}","|","\\","^","`"].concat(b),g=["'"].concat(S),h=["%","/","?",";","#"].concat(g),N=["/","?","#"],I=/^[a-z0-9A-Z_-]{0,63}$/,f=/^([a-z0-9A-Z_-]{0,63})(.*)$/,T={javascript:!0,"javascript:":!0},C={javascript:!0,"javascript:":!0},k={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},R=e("querystring");i.prototype.parse=function(e,t,r){if(!u(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e;i=i.trim();var a=d.exec(i);if(a){a=a[0];var s=a.toLowerCase();this.protocol=s,i=i.substr(a.length)}if(r||a||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var o="//"===i.substr(0,2);!o||a&&C[a]||(i=i.substr(2),this.slashes=!0)}if(!C[a]&&(o||a&&!k[a])){for(var n=-1,p=0;p127?D+="x":D+=v[P];if(!D.match(I)){var q=S.slice(0,p),E=S.slice(p+1),M=v.match(f);M&&(q.push(M[1]),E.unshift(M[2])),E.length&&(i="/"+E.join(".")+i),this.hostname=q.join(".");break}}}if(this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),!b){for(var L=this.hostname.split("."),G=[],p=0;p0)&&r.host.split("@");S&&(r.auth=S.shift(),r.host=r.hostname=S.shift())}return r.search=e.search,r.query=e.query,m(r.pathname)&&m(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!y.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var g=y.slice(-1)[0],h=(r.host||e.host)&&("."===g||".."===g)||""===g,N=0,I=y.length;I>=0;I--)g=y[I],"."==g?y.splice(I,1):".."===g?(y.splice(I,1),N++):N&&(y.splice(I,1),N--);if(!l&&!d)for(;N--;N)y.unshift("..");!l||""===y[0]||y[0]&&"/"===y[0].charAt(0)||y.unshift(""),h&&"/"!==y.join("/").substr(-1)&&y.push("");var f=""===y[0]||y[0]&&"/"===y[0].charAt(0);if(b){r.hostname=r.host=f?"":y.length?y.shift():"";var S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");S&&(r.auth=S.shift(),r.host=r.hostname=S.shift())}return l=l||r.host&&y.length,l&&!f&&y.unshift(""),y.length?r.pathname=y.join("/"):(r.pathname=null,r.path=null),m(r.pathname)&&m(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},i.prototype.parseHost=function(){var e=this.host,t=y.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{punycode:433,querystring:436}],442:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],443:[function(e,t,r){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],444:[function(e,t,r){(function(t,i){(function(){function a(e,t){var i={seen:[],stylize:o};return arguments.length>=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),b(t)?i.showHidden=t:t&&r._extend(i,t),f(i.showHidden)&&(i.showHidden=!1),f(i.depth)&&(i.depth=2),f(i.colors)&&(i.colors=!1),f(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=s),u(i,e,i.depth)}function s(e,t){var r=a.styles[t];return r?"["+a.colors[r][0]+"m"+e+"["+a.colors[r][1]+"m":e}function o(e,t){return e}function n(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}function u(e,t,i){if(e.customInspect&&t&&A(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var a=t.inspect(i,e);return N(a)||(a=u(e,a,i)),a}var s=p(e,t);if(s)return s;var o=Object.keys(t),b=n(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),R(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return m(t);if(0===o.length){if(A(t)){var S=t.name?": "+t.name:"";return e.stylize("[Function"+S+"]","special")}if(T(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(k(t))return e.stylize(Date.prototype.toString.call(t),"date");if(R(t))return m(t)}var g="",h=!1,I=["{","}"];if(y(t)&&(h=!0,I=["[","]"]),A(t)){g=" [Function"+(t.name?": "+t.name:"")+"]"}if(T(t)&&(g=" "+RegExp.prototype.toString.call(t)),k(t)&&(g=" "+Date.prototype.toUTCString.call(t)),R(t)&&(g=" "+m(t)),0===o.length&&(!h||0==t.length))return I[0]+g+I[1];if(i<0)return T(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var f;return f=h?c(e,t,i,b,o):o.map(function(r){return l(e,t,i,b,r,h)}),e.seen.pop(),d(f,g,I)}function p(e,t){if(f(t))return e.stylize("undefined","undefined");if(N(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return h(t)?e.stylize(""+t,"number"):b(t)?e.stylize(""+t,"boolean"):S(t)?e.stylize("null","null"):void 0}function m(e){return"["+Error.prototype.toString.call(e)+"]"}function c(e,t,r,i,a){for(var s=[],o=0,n=t.length;o-1&&(n=s?n.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+n.split("\n").map(function(e){return" "+e}).join("\n"))):n=e.stylize("[Circular]","special")),f(o)){if(s&&a.match(/^\d+$/))return n;o=JSON.stringify(""+a),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+n}function d(e,t,r){var i=0;return e.reduce(function(e,t){return i++,t.indexOf("\n")>=0&&i++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function y(e){return Array.isArray(e)}function b(e){return"boolean"==typeof e}function S(e){return null===e}function g(e){return null==e}function h(e){return"number"==typeof e}function N(e){return"string"==typeof e}function I(e){return"symbol"==typeof e}function f(e){return void 0===e}function T(e){return C(e)&&"[object RegExp]"===D(e)}function C(e){return"object"==typeof e&&null!==e}function k(e){return C(e)&&"[object Date]"===D(e)}function R(e){return C(e)&&("[object Error]"===D(e)||e instanceof Error)}function A(e){return"function"==typeof e}function v(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function D(e){return Object.prototype.toString.call(e)}function P(e){return e<10?"0"+e.toString(10):e.toString(10)}function x(){var e=new Date,t=[P(e.getHours()),P(e.getMinutes()),P(e.getSeconds())].join(":");return[e.getDate(),G[e.getMonth()],t].join(" ")}function q(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var E=/%[sdj%]/g;r.format=function(e){if(!N(e)){for(var t=[],r=0;r=s)return e;switch(e){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(e){return"[Circular]"}default:return e}}),n=i[r];r>>((3&t)<<3)&255;return s}}},{}],448:[function(e,t,r){function i(e,t,r){var i=t&&r||0,m=t||[];e=e||{};var c=e.node||a,l=void 0!==e.clockseq?e.clockseq:s;if(null==c||null==l){var d=o();null==c&&(c=a=[1|d[0],d[1],d[2],d[3],d[4],d[5]]),null==l&&(l=s=16383&(d[6]<<8|d[7]))}var y=void 0!==e.msecs?e.msecs:(new Date).getTime(),b=void 0!==e.nsecs?e.nsecs:p+1,S=y-u+(b-p)/1e4;if(S<0&&void 0===e.clockseq&&(l=l+1&16383),(S<0||y>u)&&void 0===e.nsecs&&(b=0),b>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");u=y,p=b,s=l,y+=122192928e5;var g=(1e4*(268435455&y)+b)%4294967296;m[i++]=g>>>24&255,m[i++]=g>>>16&255,m[i++]=g>>>8&255,m[i++]=255&g;var h=y/4294967296*1e4&268435455;m[i++]=h>>>8&255,m[i++]=255&h,m[i++]=h>>>24&15|16,m[i++]=h>>>16&255,m[i++]=l>>>8|128,m[i++]=255&l;for(var N=0;N<6;++N)m[i+N]=c[N];return t||n(m)}var a,s,o=e("./lib/rng"),n=e("./lib/bytesToUuid"),u=0,p=0;t.exports=i},{"./lib/bytesToUuid":446,"./lib/rng":447}],449:[function(e,t,r){function i(e,t,r){var i=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null),e=e||{};var o=e.random||(e.rng||a)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t)for(var n=0;n<16;++n)t[i+n]=o[n];return t||s(o)}var a=e("./lib/rng"),s=e("./lib/bytesToUuid");t.exports=i},{"./lib/bytesToUuid":446,"./lib/rng":447}],450:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=e("./utils/LRU"),a=1e3,s=function(){function e(e){void 0===e&&(e=a),this.maxSize=e,this.cache=new i.LRUCache(e)}return Object.defineProperty(e.prototype,"size",{get:function(){return this.cache.length},enumerable:!0,configurable:!0}),e.prototype.put=function(t,r){var i="string"!=typeof t?e.getKeyString(t):t,a=this.populateValue(r);this.cache.put(i,a)},e.prototype.get=function(t){var r="string"!=typeof t?e.getKeyString(t):t,i=Date.now(),a=this.cache.get(r);if(a){for(var s=a.length-1;s>=0;s--){a[s].Expire (idx + 1) / (colors.length - 0) ) { idx++; }
+ let r = Math.round(colors[idx][0] * 255);
+ let g = Math.round(colors[idx][1] * 255);
+ let b = Math.round(colors[idx][2] * 255);
+ return [r, g, b];
+}
+
+function partial(name) {
+ if (name.endsWith('_r')) {
+ return function(x) { return evaluate_cmap(x, name.substring(0, name.length - 2), true) };
+ } else {
+ return function(x) { return evaluate_cmap(x, name, false) };
+ }
+}
\ No newline at end of file
diff --git a/js/tracker.js b/js/tracker.js
index 50c9b0d..15c450a 100644
--- a/js/tracker.js
+++ b/js/tracker.js
@@ -5,6 +5,7 @@ var receivers_url = "https://api.v2.sondehub.org/listeners/telemetry";
var predictions_url = "https://api.v2.sondehub.org/predictions?vehicles=";
var launch_predictions_url = "https://api.v2.sondehub.org/predictions/reverse";
var recovered_sondes_url = "https://api.v2.sondehub.org/recovered";
+var recovered_sondes_stats_url = "https://api.v2.sondehub.org/recovered/stats";
var launches_url = "https://api.v2.sondehub.org/sites";
var livedata = "wss://ws-reader.v2.sondehub.org/";
@@ -31,6 +32,10 @@ var recoveries = [];
var launchPredictions = {};
+var stationHistoricalData = {};
+var historicalPlots = {};
+var historicalAjax = [];
+
var sites = null;
var launches = new L.LayerGroup();
var showLaunches = false;
@@ -160,6 +165,15 @@ var v1manufacturers = {
var ls_receivers = false;
var ls_pred = false;
+// AWS S3
+AWS.config.region = 'us-east-1';
+
+var s3 = new AWS.S3({
+ params: {Bucket: 'sondehub-history'}
+});
+
+var tempLaunchData = {};
+
var plot = null;
var plot_open = false;
var plot_holder = "#telemetry_graph .holder";
@@ -566,6 +580,28 @@ function load() {
L.control.periodcontrol({ position: 'topleft' }).addTo(map);
+ L.Control.HistoricalControl = L.Control.extend({
+ onAdd: function(map) {
+ var div = L.DomUtil.create('div');
+
+ div.innerHTML = '';
+ div.id = "historicalControlButton";
+ div.style.display = "none";
+
+ return div;
+ },
+
+ onRemove: function(map) {
+ // Nothing to do here
+ }
+ });
+
+ L.control.historicalontrol = function(opts) {
+ return new L.Control.HistoricalControl(opts);
+ }
+
+ L.control.historicalontrol({ position: 'topleft' }).addTo(map);
+
// update current position if we geolocation is available
if(currentPosition) updateCurrentPosition(currentPosition.lat, currentPosition.lon);
@@ -589,6 +625,19 @@ function load() {
map.addLayer(launches);
}
+ // Save popup content on close for stations
+ map.on('popupclose', function(e) {
+ try {
+ var station = e["popup"]["_source"]["title"];
+ var popup = $("#popup" + station);
+ if (popup.length) {
+ e.popup.setContent("");
+ }
+ } catch(err) {
+ return;
+ }
+ });
+
map.on('moveend', function (e) {
lhash_update();
});
@@ -722,15 +771,481 @@ function setTimeValue() {
}, 100);
}
-function launchSitePredictions(times, station, properties, marker) {
- var popup = launches.getLayer(marker).getPopup();
- var popupContent = popup.getContent();
- var popupContentSplit = popupContent.split("";
- popup.setContent(popupContentSplit);
- if (popupContent.includes("Delete")) {
- deletePredictions(marker);
- popupContent = popupContent.split("