Skip to content

Commit d567549

Browse files
authored
Merge pull request projecthorus#122 from LukePrior/testing
prediction changes
2 parents 831e26e + e955d7d commit d567549

File tree

2 files changed

+8
-33
lines changed

2 files changed

+8
-33
lines changed

js/tracker.js

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ var receiverCanvas = null;
3535

3636
var sondePrefix = ["RS92", "RS92-SGP", "RS92-NGP", "RS41", "RS41-SG", "RS41-SGP", "RS41-SGM", "DFM", "DFM06", "DFM09", "DFM17", "M10", "M20", "iMet-4", "iMet-54", "LMS6", "LMS6-400", "LMS6-1680", "iMS-100", "MRZ", "chase"];
3737
var sondeCodes = {
38-
"07":"iMet-1", "11":"LMS6-403", "13":"RS92", "14":"RS92", "17":"DFM-09", "19":"MRZ-N1", "22":"RS-11G", "23":"RS41", "24":"RS41", "34":"iMet-4", "35":"iMS-100", "41":"RS41", "42":"RS41", "52":"RS92-NGP", "54":"DFM-17",
39-
"62":"MRZ-3MK", "63":"M20", "77":"M10", "82":"LMS6-1680", "84":"iMet-54"
38+
"07":"iMet-1", "11":"LMS6-403", "13":"RS92", "14":"RS92", "17":"DFM-09", "18":"DFM-06", "19":"MRZ-N1", "22":"RS-11G", "23":"RS41", "24":"RS41", "34":"iMet-4", "35":"iMS-100", "41":"RS41", "42":"RS41", "52":"RS92-NGP",
39+
"54":"DFM-17", "62":"MRZ-3MK", "63":"M20", "77":"M10", "82":"LMS6-1680", "84":"iMet-54"
4040
};
4141
var unsupportedSondeCodes = {
42-
"15":"PAZA-12M", "16":"PAZA-22", "18":"DFM-06", "20":"MK3", "21":"1524LA LORAN-C/GL5000", "26":"SRS-C34", "27":"AVK-MRZ", "28":"AVK–AK2-02", "29":"MARZ2-2", "30":"RS2-80", "33":"GTS1-2/GFE(L)", "45":"CF-06", "58":"AVK-BAR",
42+
"15":"PAZA-12M", "16":"PAZA-22", "20":"MK3", "21":"1524LA LORAN-C/GL5000", "26":"SRS-C34", "27":"AVK-MRZ", "28":"AVK–AK2-02", "29":"MARZ2-2", "30":"RS2-80", "33":"GTS1-2/GFE(L)", "45":"CF-06", "58":"AVK-BAR",
4343
"59":"M2K2-R", "68":"AVK-RZM-2", "69":"MARL-A/Vektor-M-RZM-2", "73":"MARL-A", "78":"RS90", "80":"RS92", "88":"MARL-A/Vektor-M-MRZ", "89":"MARL-A/Vektor-M-BAR", "97":"iMet-2", "99":"iMet-2"
4444
};
4545

@@ -855,36 +855,8 @@ function showLaunchSites() {
855855
marker.bindPopup(popup);
856856
launches.addLayer(marker);
857857
if (json[key].hasOwnProperty('times')) {
858-
var tempDate = null;
859858
var popupContent = null;
860-
for (var i = 0; i < json[key]['times'].length; i++) {
861-
var date = new Date();
862-
var now = new Date();
863-
var time = json[key]['times'][i].split(":");
864-
if (time[0] != 0) {
865-
date.setDate(date.getDate() + (7 + time[0] - date.getDay()) % 7);
866-
}
867-
date.setUTCHours(time[1]);
868-
date.setUTCMinutes(time[2]);
869-
date.setSeconds(0);
870-
date.setMinutes( date.getMinutes() - 45 );
871-
while (date < now) {
872-
if (time[0] == 0) {
873-
date.setDate(date.getDate() + 1);
874-
} else {
875-
date.setDate(date.getDate() + 7);
876-
}
877-
}
878-
if (tempDate) {
879-
if (date < tempDate) {
880-
tempDate = date;
881-
popupContent = "<font style='font-size: 13px'>" + json[key].station_name + "</font><br><br><b>Sondes launched:</b> " + sondesList + "<br><b>Next launch:</b> " + date.toString();
882-
}
883-
} else {
884-
tempDate = date;
885-
popupContent = "<font style='font-size: 13px'>" + json[key].station_name + "</font><br><br><b>Sondes launched:</b> " + sondesList + "<br><b>Next launch:</b> " + date.toString();
886-
}
887-
}
859+
popupContent = "<font style='font-size: 13px'>" + json[key].station_name + "</font><br><br><b>Sondes launched:</b> " + sondesList;
888860
var ascent_rate = 5;
889861
var descent_rate = 6;
890862
var burst_altitude = 26000;
@@ -925,6 +897,9 @@ function showLaunchSites() {
925897
}
926898
popupContent += json[key]['times'][x].split(":")[1] + ":" + json[key]['times'][x].split(":")[2] + " UTC";
927899
}
900+
if (json[key].hasOwnProperty('notes')) {
901+
popupContent += "<br><b>Notes:</b> " + json[key]["notes"];
902+
}
928903
popupContent += "<br><b>Know when this site launches?</b> Contribute <a href='https://github.com/projecthorus/sondehub-tracker/issues/114' target='_blank'>here</a>";
929904
popupContent += "<br><button onclick='launchSitePredictions(\"" + json[key]['times'].toString() + "\", \"" + latlon.toString() + "\", \"" + ascent_rate + ":" + descent_rate + ":" + burst_altitude + "\", \"" + launches.getLayerId(marker) + "\")' style='margin-bottom:0;'>Generate Predictions</button>";
930905
} else {

launchSites.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
{"station":"04360","rs_types":["77"],"lat":65.6111,"lon":-37.6367,"alt":50,"station_name":"Tasiilaq (Greenland)","times":["0:12:00","0:00:00"]},
2525
{"station":"04417","rs_types":["23"],"lat":72.5803,"lon":-38.4586,"alt":3255,"station_name":"Geosummit (Greenland)"},
2626
{"station":"06011","rs_types":["07"],"lat":62.0231,"lon":-6.7647,"alt":54,"station_name":"Thorshavn (Denmark)","times":["0:00:00","0:12:00"]},
27-
{"station":"06260","rs_types":["23"],"lat":52.0989,"lon":5.1797,"alt":2,"station_name":"De Bilt (Netherlands)","times":["3:00:00","4:00:00","4:12:00","7:00:00","1:00:00","2:00:00","6:00:00"]},
27+
{"station":"06260","rs_types":["23"],"lat":52.0989,"lon":5.1797,"alt":2,"station_name":"De Bilt (Netherlands)","times":["0:00:00","4:12:00"],"notes":"Ozone sonde launched Thursdays"},
2828
{"station":"06447","rs_types":["23"],"lat":50.7969,"lon":4.3581,"alt":100,"station_name":"Uccle (Belgium)","times":["1:12:00","3:12:00","5:12:00"]},
2929
{"station":"06458","rs_types":["34"],"lat":50.7456,"lon":4.7633,"alt":105,"station_name":"Beauvechain (Belgium)","times":["2:21:00","4:21:00","6:21:00","1:00:00","1:21:00","3:21:00"]},
3030
{"station":"06610","rs_types":["41","42"],"lat":46.8117,"lon":6.9425,"alt":490,"station_name":"Payerne (Switzerland)","times":["0:00:00","0:12:00"]},

0 commit comments

Comments
 (0)