From b38fcddad71724ea0fe49fa12de4567d3e897f4b Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Thu, 8 May 2014 11:36:20 +0000 Subject: [PATCH 1/6] Load event details together with the event table. --- www/events.js | 137 +++++++++++++++++++------------------------------- www/map.js | 2 +- 2 files changed, 54 insertions(+), 85 deletions(-) diff --git a/www/events.js b/www/events.js index 14b4501..069071a 100644 --- a/www/events.js +++ b/www/events.js @@ -72,6 +72,7 @@ function ajaxLoadEvents(stime, etime) { minlon: W-config['map']['latlngDelta'], maxlon: E+config['map']['latlngDelta'], minmag: config['event']['minMag']-config['event']['minMagDelta'], + includeArrivals: true, }; $.ajax({ type: "GET", @@ -80,16 +81,24 @@ function ajaxLoadEvents(stime, etime) { dataType: "xml", success: function (xml) { $(xml).find('event').each(function () { + var event = $(this); var id = $(this).attr('publicID').split('/')[2]; var mag = $(this).find('magnitude > mag > value').text(); var otime = $(this).find('origin > time > value').text(); var lng = $(this).find('origin > longitude > value').text(); + var lng_err = $(this).find('origin > longitude > uncertainty').text(); var lat = $(this).find('origin > latitude > value').text(); + var lat_err = $(this).find('origin > latitude > uncertainty').text(); + var depth = $(this).find('origin > depth > value').text(); + var depth_err = $(this).find('origin > depth > uncertainty').text(); + var rms = $(this).find('origin > quality > standardError').text(); + var gap = $(this).find('origin > quality > azimuthalGap').text(); + var phases_count = $(this).find('origin > quality > usedPhaseCount').text(); var evaluationMode = $(this).find('evaluationMode').text(); var evaluationStatus = $(this).find('evaluationStatus').text(); var type = $(this).find('type').last().text(); var location - // try use location with reverse geolocation lookup (nominatim), check cache first + // try to use location with reverse geolocation lookup (nominatim), check cache first // use getLocation if it fails or description -> text if it also fails if ( geolocationTable[id] ) { location = geolocationTable[id]; @@ -99,14 +108,50 @@ function ajaxLoadEvents(stime, etime) { }; // create table row: Date, Time, Mag, Location if ( !eventTable[id] && $.inArray(type, config['event']['typeWhitelist'] )+1 && $.inArray(evaluationStatus, config['event']['evaluationBlacklist'])<0 && Number(mag)+0.05 >= config['event']['minMag'] ) { + // general event info (1st line) var row = '' + ''+otime.split('.')[0]+'Z' + ''+otime.split('.')[0]+'Z' + sprintf('%.1f', Number(mag)) + ''+location+'Karte' + ''; - row += '' - + 'Daten werden geladen ...'; + // setting up event details (2nd line) + row += '' + + '' + + '
'
+						+ sprintf("ID %49s\n", id)
+						+ sprintf("Type %47s\n\n", type)
+						+ "Origin\n"
+						+ sprintf("Date %18s\n", otime.split('T')[0])
+						+ sprintf("Time %18s UTC\n", otime.split('T')[1].substring(0, 11))
+						+ sprintf("Latitude %14.4f °N +- %4.1f km\n",Number(lat), Number(lat_err))
+						+ sprintf("Longitude %13.4f °E +- %4.1f km\n", Number(lng), Number(lng_err))
+						+ sprintf("Depth %14.1f    km +- %4.1f km\n", Number(depth)/1000., Number(depth_err)/1000.)
+						+ sprintf("Magnitude %10.1f\n", Number(mag))
+						+ sprintf("Residual RMS %7.1f    sec\n", Number(rms))
+						+ sprintf("Azimuthal gap %6.1f    °\n\n", Number(gap))
+						+ sprintf("%d Phase arrivals:\n", Number(phases_count))
+						+ "sta  net  dist azi     phase time         res   wt\n";
+					// adding phase info (TODO sort by distance)
+					$(this).find('origin > arrival').each(function() {
+						var pickid = $(this).find('pickID').text();
+						var azi = $(this).find('azimuth').text();
+						var dist = $(this).find('distance').text();
+						var tres = $(this).find('timeResidual').text();
+						var phase = $(this).find('phase').text();
+						var tweight = $(this).find('timeWeight').text();
+						if ( Number(tweight) > 0.0 ) {
+							var waveformid = event.find('pick[publicID="'+pickid+'"] > waveformID');
+							var networkcode = waveformid.attr('networkCode');
+							var stationcode = waveformid.attr('stationCode');
+							var channel = waveformid.attr('channelCode').substring(2,2);
+							var phasemode = event.find('pick[publicID="'+pickid+'"] > evaluationMode').text().substring(0,1).toUpperCase();
+							var picktime = event.find('pick[publicID="'+pickid+'"] > time > value').text().split('T')[1].substring(0,11);
+							row += sprintf('%-4s %2s  %5.1f %5.1f %3s %1s %13s %5.1f %5.2f\n', stationcode, networkcode, Number(dist), Number(azi), phase, phasemode, picktime, Number(tres), Number(tweight));
+						};
+					});
+					row += '';
+					// add row to table
 					var added = $('#eventstable tbody').append(row);
 					added.find('.tablesorter-childRow td').hide();
 					$('#eventstable').find('td.utctime-date').each(function() {
@@ -123,6 +168,8 @@ function ajaxLoadEvents(stime, etime) {
 					var marker = addEventMarker(id, Number(lat), Number(lng), Number(mag));
 					var text = sprintf('

%s

', id, location) + sprintf('

Ereignis: %s
', id) + + sprintf('Type: %s
', type) + + sprintf('Magnitude: %3.1f
', Number(mag)) + sprintf('Ort: %.4f °N, %.4f °O
', Number(lat), Number(lng)) + sprintf('Zeit: %sZ

', otime.split('.')[0], otime.split('.')[0]); marker.bindPopup(text); @@ -144,81 +191,6 @@ function ajaxLoadEvents(stime, etime) { }); }; -/* ajaxLoadEventInfo */ -function ajaxLoadEventInfo(id) { - var request_data = { - eventid: id, - includeArrivals: true, - }; - $.ajax({ - type: "GET", - url: config['ajax']['eventURL'], - data: request_data, - dataType: "xml", - success: function (xml) { - eventDetails[id] = true; - $(xml).find('event').each(function () { - var event = $(this); - var mag = $(this).find('magnitude > mag > value').text(); - var otime = $(this).find('origin > time > value').text(); - var lng = $(this).find('origin > longitude > value').text(); - var lng_err = $(this).find('origin > longitude > uncertainty').text(); - var lat = $(this).find('origin > latitude > value').text(); - var lat_err = $(this).find('origin > latitude > uncertainty').text(); - var depth = $(this).find('origin > depth > value').text(); - var depth_err = $(this).find('origin > depth > uncertainty').text(); - var rms = $(this).find('origin > quality > standardError').text(); - var gap = $(this).find('origin > quality > azimuthalGap').text(); - var phases_count = $(this).find('origin > quality > usedPhaseCount').text(); - var type = $(this).find('type').last().text(); - // setting up general event info - var row = "
"
-					+ sprintf("ID %49s\n", id)
-					+ sprintf("Type %47s\n\n", type)
-					+ "Origin\n"
-					+ sprintf("Date %18s\n", otime.split('T')[0])
-					+ sprintf("Time %18s UTC\n", otime.split('T')[1].substring(0, 11))
-					+ sprintf("Latitude %14.4f °N +- %4.1f km\n",Number(lat), Number(lat_err))
-					+ sprintf("Longitude %13.4f °E +- %4.1f km\n", Number(lng), Number(lng_err))
-					+ sprintf("Depth %14.1f    km +- %4.1f km\n", Number(depth)/1000., Number(depth_err)/1000.)
-					+ sprintf("Magnitude %10.1f\n", Number(mag))
-					+ sprintf("Residual RMS %7.1f    sec\n", Number(rms))
-					+ sprintf("Azimuthal gap %6.1f    °\n\n", Number(gap))
-					+ sprintf("%d Phase arrivals:\n", Number(phases_count))
-					+ "sta  net  dist azi     phase time         res   wt\n";
-				// adding phase info (TODO sort by distance)
-				$(this).find('origin > arrival').each(function() {
-					var pickid = $(this).find('pickID').text();
-					var azi = $(this).find('azimuth').text();
-					var dist = $(this).find('distance').text();
-					var tres = $(this).find('timeResidual').text();
-					var phase = $(this).find('phase').text();
-					var tweight = $(this).find('timeWeight').text();
-					if ( Number(tweight) > 0.0 ) {
-						var waveformid = event.find('pick[publicID="'+pickid+'"] > waveformID');
-						var networkcode = waveformid.attr('networkCode');
-						var stationcode = waveformid.attr('stationCode');
-						var channel = waveformid.attr('channelCode').substring(2,2);
-						var phasemode = event.find('pick[publicID="'+pickid+'"] > evaluationMode').text().substring(0,1).toUpperCase();
-						var picktime = event.find('pick[publicID="'+pickid+'"] > time > value').text().split('T')[1].substring(0,11);
-						row = row
-							+ sprintf('%-4s %2s  %5.1f %5.1f %3s %1s %13s %5.1f %5.2f\n', stationcode, networkcode, Number(dist), Number(azi), phase, phasemode, picktime, Number(tres), Number(tweight));
-					};
-				});
-				row = row + '
'; - $('#eventstable > tbody > tr.tablesorter-childRow > td[eventid='+id+']').html(row); - }); - }, - complete: function () { - null; - }, - error: function( jqxhr, textStatus, error ) { - var err = textStatus + ", " + error; - console.log( "Request Failed: " + err ); - } - }); -}; - /* toggles visibility of filtered markers * only events in the event list are shown */ function toggleFilteredMarkers() { @@ -272,7 +244,7 @@ function highlightEvent( id ) { }; var normalStyle = { fillColor: config['event']['markerColor'], - color: config['event']['markerColorH'] + color: config['event']['markerColor'] }; $("#eventstable > tbody > tr:not(.filtered)").find("a.map-link").each( function() { if ( $(this).attr("eventid") ) { @@ -336,10 +308,6 @@ $(document).ready(function() { // show / hide event info $('#eventstable').delegate('.toggle', 'click' , function(){ - // load event details - var eventid = $(this).attr('eventid'); - ( eventDetails[eventid] ) ? null : ajaxLoadEventInfo(eventid); - // toggle visibility of selected row $(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').toggle('slow'); @@ -357,11 +325,12 @@ $(document).ready(function() { var selected = $(this).hasClass('selected'); if ( selected ) { $(this).removeClass('selected'); + highlightFirstEvent(); } else { $(this).addClass('selected'); + highlightEvent($(this).attr('eventid')); }; }); - return false; }); diff --git a/www/map.js b/www/map.js index b53ec36..c8ef474 100644 --- a/www/map.js +++ b/www/map.js @@ -104,7 +104,7 @@ function initMapLink() { $(document).ready(function() { // create a map in the "map" div, set the view to a given place and zoom - map = L.map('map', { zoomControl: false }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); + map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); new L.Control.Zoom({ position: 'topright' }).addTo(map); // add MapQuestOSM tile layer From b7ad42c462be94b2d97ae01fc0b7c4664575a43e Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Thu, 8 May 2014 20:24:27 +0000 Subject: [PATCH 2/6] Small fixes to comforme to standard in index.html.de --- www/index.html.de | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/www/index.html.de b/www/index.html.de index 71f8620..72277a4 100644 --- a/www/index.html.de +++ b/www/index.html.de @@ -7,42 +7,42 @@ - + - - - - + + + + - - - - - + + + + + - - - + + + - - - + + + - - - + + + - + @@ -72,7 +72,7 @@ - +
@@ -135,6 +135,7 @@
- +
+ From fa0ef11337cdac801986b420f9b0b147c94ab7ce Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Fri, 9 May 2014 07:00:03 +0000 Subject: [PATCH 3/6] Adding download links to event table. --- www/events.js | 34 +++++++++++++++++----------------- www/misc.js | 1 + 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/www/events.js b/www/events.js index 069071a..69c1243 100644 --- a/www/events.js +++ b/www/events.js @@ -51,11 +51,6 @@ function getGeolocation(id, lat, lng) { /* Load events using ajax */ function ajaxLoadEvents(stime, etime) { - var mapBounds = map.getBounds(); - var N = mapBounds.getNorth(); - var E = mapBounds.getEast(); - var S = mapBounds.getSouth(); - var W = mapBounds.getWest(); if ( !stime ) { var stime = new Date(); stime.setDate(stime.getDate()-config['map']['timespan']); @@ -64,15 +59,16 @@ function ajaxLoadEvents(stime, etime) { var etime = new Date(); etime.setDate(etime.getDate()+1); }; + var mapBounds = map.getBounds(); var request_data = { starttime: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()), endtime: sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate()), - minlat: S-config['map']['latlngDelta'], - maxlat: N+config['map']['latlngDelta'], - minlon: W-config['map']['latlngDelta'], - maxlon: E+config['map']['latlngDelta'], + minlat: mapBounds.getSouth()-config['map']['latlngDelta'], + maxlat: mapBounds.getNorth()+config['map']['latlngDelta'], + minlon: mapBounds.getWest()-config['map']['latlngDelta'], + maxlon: mapBounds.getEast()+config['map']['latlngDelta'], minmag: config['event']['minMag']-config['event']['minMagDelta'], - includeArrivals: true, + includearrivals: true, }; $.ajax({ type: "GET", @@ -151,6 +147,17 @@ function ajaxLoadEvents(stime, etime) { }; }); row += ''; + // setting up download links (3nd line) + var xmlurl = sprintf('%s?formatted=true&includearrivals=true&eventid=%s', config['ajax']['eventURL'], id); + var oTime = new Date(otime); + var stime = new Date(oTime.getTime()-10*1000.-oTime.getMilliseconds()); + var etime = new Date(oTime.getTime()+50*1000.-oTime.getMilliseconds()); + console.log(oTime, stime, etime); + var mseedurl = sprintf('%s?net=GE,GR,RN&cha=EH?,HH?&start=%04d-%02d-%02dT%02d:%02d:%02d&end=%04d-%02d-%02dT%02d:%02d:%02d', config['ajax']['mseedURL'], Number(stime.getUTCFullYear()), Number(stime.getUTCMonth())+1, Number(stime.getUTCDate()), Number(stime.getUTCHours()), Number(stime.getUTCMinutes()), Number(stime.getUTCSeconds()), Number(etime.getUTCFullYear()), Number(etime.getUTCMonth())+1, Number(etime.getUTCDate()), Number(etime.getUTCHours()), Number(etime.getUTCMinutes()), Number(etime.getUTCSeconds())); + row += '' + + ''; // add row to table var added = $('#eventstable tbody').append(row); added.find('.tablesorter-childRow td').hide(); @@ -200,7 +207,6 @@ function toggleFilteredMarkers() { eventTable[$(this).attr("eventid")].setStyle({opacity: 1, strokeOpacity: 1, fillOpacity: config['event']['markerOpacity']}); }; }); - // hide filtered events in map $("#eventstable > tbody > tr.filtered > td > a.map-link").each( function() { if ( $(this).attr("eventid") ) { @@ -292,25 +298,20 @@ $(document).ready(function() { showProcessing: true, } }); - // hide child rows $('#eventstable > tbody > tr.tablesorter-childRow td').hide(); - // update map after filtering $('#eventstable').bind('filterEnd', function(){ toggleFilteredMarkers(); }); - // highlight first event $('#eventstable').bind('sortEnd', function(){ highlightFirstEvent(); }); - // show / hide event info $('#eventstable').delegate('.toggle', 'click' , function(){ // toggle visibility of selected row $(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').toggle('slow'); - // mark currently selected row and remove class selected from all other rows // hide other rows $(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').addClass('selected-now'); @@ -333,5 +334,4 @@ $(document).ready(function() { }); return false; }); - }); diff --git a/www/misc.js b/www/misc.js index aca89d2..7da0a00 100644 --- a/www/misc.js +++ b/www/misc.js @@ -80,6 +80,7 @@ var config = { ajax: { timeout: 150000, // 15 seconds eventURL: 'https://ariadne.geophysik.ruhr-uni-bochum.de/fdsnws/event/1/query', + mseedURL: 'https://ariadne.geophysik.ruhr-uni-bochum.de/fdsnws/dataselect/1/query', stationURL: 'https://ariadne.geophysik.ruhr-uni-bochum.de/fdsnws/station/1/query', nominatimURL: '//open.mapquestapi.com/nominatim/v1/reverse.php', // nominatimURL: '//nominatim.openstreetmap.org/reverse', From ca182f594e905f1b4558c6971255791d31ad0069 Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Fri, 9 May 2014 09:21:33 +0000 Subject: [PATCH 4/6] Reverted r622. Detail will, as before, be loaded on request only. --- www/events.js | 126 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 81 insertions(+), 45 deletions(-) diff --git a/www/events.js b/www/events.js index 69c1243..f357576 100644 --- a/www/events.js +++ b/www/events.js @@ -59,7 +59,6 @@ function ajaxLoadEvents(stime, etime) { var etime = new Date(); etime.setDate(etime.getDate()+1); }; - var mapBounds = map.getBounds(); var request_data = { starttime: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()), endtime: sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate()), @@ -68,7 +67,6 @@ function ajaxLoadEvents(stime, etime) { minlon: mapBounds.getWest()-config['map']['latlngDelta'], maxlon: mapBounds.getEast()+config['map']['latlngDelta'], minmag: config['event']['minMag']-config['event']['minMagDelta'], - includearrivals: true, }; $.ajax({ type: "GET", @@ -77,19 +75,11 @@ function ajaxLoadEvents(stime, etime) { dataType: "xml", success: function (xml) { $(xml).find('event').each(function () { - var event = $(this); var id = $(this).attr('publicID').split('/')[2]; var mag = $(this).find('magnitude > mag > value').text(); var otime = $(this).find('origin > time > value').text(); var lng = $(this).find('origin > longitude > value').text(); - var lng_err = $(this).find('origin > longitude > uncertainty').text(); var lat = $(this).find('origin > latitude > value').text(); - var lat_err = $(this).find('origin > latitude > uncertainty').text(); - var depth = $(this).find('origin > depth > value').text(); - var depth_err = $(this).find('origin > depth > uncertainty').text(); - var rms = $(this).find('origin > quality > standardError').text(); - var gap = $(this).find('origin > quality > azimuthalGap').text(); - var phases_count = $(this).find('origin > quality > usedPhaseCount').text(); var evaluationMode = $(this).find('evaluationMode').text(); var evaluationStatus = $(this).find('evaluationStatus').text(); var type = $(this).find('type').last().text(); @@ -112,41 +102,8 @@ function ajaxLoadEvents(stime, etime) { + '' + ''; // setting up event details (2nd line) - row += '' - + ''; + row += '' + + ''; // setting up download links (3nd line) var xmlurl = sprintf('%s?formatted=true&includearrivals=true&eventid=%s', config['ajax']['eventURL'], id); var oTime = new Date(otime); @@ -198,6 +155,81 @@ function ajaxLoadEvents(stime, etime) { }); }; +/* ajaxLoadEventInfo */ +function ajaxLoadEventInfo(id) { + var request_data = { + eventid: id, + includeArrivals: true, + }; + $.ajax({ + type: "GET", + url: config['ajax']['eventURL'], + data: request_data, + dataType: "xml", + success: function (xml) { + eventDetails[id] = true; + $(xml).find('event').each(function () { + var event = $(this); + var mag = $(this).find('magnitude > mag > value').text(); + var otime = $(this).find('origin > time > value').text(); + var lng = $(this).find('origin > longitude > value').text(); + var lng_err = $(this).find('origin > longitude > uncertainty').text(); + var lat = $(this).find('origin > latitude > value').text(); + var lat_err = $(this).find('origin > latitude > uncertainty').text(); + var depth = $(this).find('origin > depth > value').text(); + var depth_err = $(this).find('origin > depth > uncertainty').text(); + var rms = $(this).find('origin > quality > standardError').text(); + var gap = $(this).find('origin > quality > azimuthalGap').text(); + var phases_count = $(this).find('origin > quality > usedPhaseCount').text(); + var type = $(this).find('type').last().text(); + // setting up general event info + var row = "
"
+					+ sprintf("ID %49s\n", id)
+					+ sprintf("Type %47s\n\n", type)
+					+ "Origin\n"
+					+ sprintf("Date %18s\n", otime.split('T')[0])
+					+ sprintf("Time %18s UTC\n", otime.split('T')[1].substring(0, 11))
+					+ sprintf("Latitude %14.4f °N +- %4.1f km\n",Number(lat), Number(lat_err))
+					+ sprintf("Longitude %13.4f °E +- %4.1f km\n", Number(lng), Number(lng_err))
+					+ sprintf("Depth %14.1f    km +- %4.1f km\n", Number(depth)/1000., Number(depth_err)/1000.)
+					+ sprintf("Magnitude %10.1f\n", Number(mag))
+					+ sprintf("Residual RMS %7.1f    sec\n", Number(rms))
+					+ sprintf("Azimuthal gap %6.1f    °\n\n", Number(gap))
+					+ sprintf("%d Phase arrivals:\n", Number(phases_count))
+					+ "sta  net  dist azi     phase time         res   wt\n";
+				// adding phase info (TODO sort by distance)
+				$(this).find('origin > arrival').each(function() {
+					var pickid = $(this).find('pickID').text();
+					var azi = $(this).find('azimuth').text();
+					var dist = $(this).find('distance').text();
+					var tres = $(this).find('timeResidual').text();
+					var phase = $(this).find('phase').text();
+					var tweight = $(this).find('timeWeight').text();
+					if ( Number(tweight) > 0.0 ) {
+						var waveformid = event.find('pick[publicID="'+pickid+'"] > waveformID');
+						var networkcode = waveformid.attr('networkCode');
+						var stationcode = waveformid.attr('stationCode');
+						var channel = waveformid.attr('channelCode').substring(2,2);
+						var phasemode = event.find('pick[publicID="'+pickid+'"] > evaluationMode').text().substring(0,1).toUpperCase();
+						var picktime = event.find('pick[publicID="'+pickid+'"] > time > value').text().split('T')[1].substring(0,11);
+						row = row
+							+ sprintf('%-4s %2s  %5.1f %5.1f %3s %1s %13s %5.1f %5.2f\n', stationcode, networkcode, Number(dist), Number(azi), phase, phasemode, picktime, Number(tres), Number(tweight));
+					};
+				});
+				row = row + '
'; + $('#eventstable > tbody > tr.tablesorter-childRow > td[eventid='+id+']').html(row); + }); + }, + complete: function () { + null; + }, + error: function( jqxhr, textStatus, error ) { + var err = textStatus + ", " + error; + console.log( "Request Failed: " + err ); + } + }); +}; + /* toggles visibility of filtered markers * only events in the event list are shown */ function toggleFilteredMarkers() { @@ -310,6 +342,10 @@ $(document).ready(function() { }); // show / hide event info $('#eventstable').delegate('.toggle', 'click' , function(){ + // load event details + var eventid = $(this).attr('eventid'); + ( eventDetails[eventid] ) ? null : ajaxLoadEventInfo(eventid); + // toggle visibility of selected row $(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').toggle('slow'); // mark currently selected row and remove class selected from all other rows From 2e27ccf17077f1be6848e4b30eb33927a8050321 Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Fri, 9 May 2014 09:28:11 +0000 Subject: [PATCH 5/6] Added skipped line of previous reversal. --- www/events.js | 1 + 1 file changed, 1 insertion(+) diff --git a/www/events.js b/www/events.js index f357576..00881c8 100644 --- a/www/events.js +++ b/www/events.js @@ -59,6 +59,7 @@ function ajaxLoadEvents(stime, etime) { var etime = new Date(); etime.setDate(etime.getDate()+1); }; + var mapBounds = map.getBounds(); var request_data = { starttime: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()), endtime: sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate()), From 33ed07b142f76d4510c335273ab4b0a061e993f6 Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Fri, 9 May 2014 09:37:28 +0000 Subject: [PATCH 6/6] Added class to detail and download row of event table to prevent substituting even tent details in both rows. --- www/events.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/www/events.js b/www/events.js index 00881c8..a632b48 100644 --- a/www/events.js +++ b/www/events.js @@ -103,7 +103,7 @@ function ajaxLoadEvents(stime, etime) { + '' + ''; // setting up event details (2nd line) - row += '' + row += '' + ''; // setting up download links (3nd line) var xmlurl = sprintf('%s?formatted=true&includearrivals=true&eventid=%s', config['ajax']['eventURL'], id); @@ -112,7 +112,7 @@ function ajaxLoadEvents(stime, etime) { var etime = new Date(oTime.getTime()+50*1000.-oTime.getMilliseconds()); console.log(oTime, stime, etime); var mseedurl = sprintf('%s?net=GE,GR,RN&cha=EH?,HH?&start=%04d-%02d-%02dT%02d:%02d:%02d&end=%04d-%02d-%02dT%02d:%02d:%02d', config['ajax']['mseedURL'], Number(stime.getUTCFullYear()), Number(stime.getUTCMonth())+1, Number(stime.getUTCDate()), Number(stime.getUTCHours()), Number(stime.getUTCMinutes()), Number(stime.getUTCSeconds()), Number(etime.getUTCFullYear()), Number(etime.getUTCMonth())+1, Number(etime.getUTCDate()), Number(etime.getUTCHours()), Number(etime.getUTCMinutes()), Number(etime.getUTCSeconds())); - row += '' + row += '' + ''; @@ -218,7 +218,7 @@ function ajaxLoadEventInfo(id) { }; }); row = row + ''; - $('#eventstable > tbody > tr.tablesorter-childRow > td[eventid='+id+']').html(row); + $('#eventstable > tbody > tr.event-details > td[eventid='+id+']').html(row); }); }, complete: function () {
' + + sprintf('Download QuakeML or miniSEED', xmlurl, mseedurl) + + '
'+location+'Karte
' - + '
'
-						+ sprintf("ID %49s\n", id)
-						+ sprintf("Type %47s\n\n", type)
-						+ "Origin\n"
-						+ sprintf("Date %18s\n", otime.split('T')[0])
-						+ sprintf("Time %18s UTC\n", otime.split('T')[1].substring(0, 11))
-						+ sprintf("Latitude %14.4f °N +- %4.1f km\n",Number(lat), Number(lat_err))
-						+ sprintf("Longitude %13.4f °E +- %4.1f km\n", Number(lng), Number(lng_err))
-						+ sprintf("Depth %14.1f    km +- %4.1f km\n", Number(depth)/1000., Number(depth_err)/1000.)
-						+ sprintf("Magnitude %10.1f\n", Number(mag))
-						+ sprintf("Residual RMS %7.1f    sec\n", Number(rms))
-						+ sprintf("Azimuthal gap %6.1f    °\n\n", Number(gap))
-						+ sprintf("%d Phase arrivals:\n", Number(phases_count))
-						+ "sta  net  dist azi     phase time         res   wt\n";
-					// adding phase info (TODO sort by distance)
-					$(this).find('origin > arrival').each(function() {
-						var pickid = $(this).find('pickID').text();
-						var azi = $(this).find('azimuth').text();
-						var dist = $(this).find('distance').text();
-						var tres = $(this).find('timeResidual').text();
-						var phase = $(this).find('phase').text();
-						var tweight = $(this).find('timeWeight').text();
-						if ( Number(tweight) > 0.0 ) {
-							var waveformid = event.find('pick[publicID="'+pickid+'"] > waveformID');
-							var networkcode = waveformid.attr('networkCode');
-							var stationcode = waveformid.attr('stationCode');
-							var channel = waveformid.attr('channelCode').substring(2,2);
-							var phasemode = event.find('pick[publicID="'+pickid+'"] > evaluationMode').text().substring(0,1).toUpperCase();
-							var picktime = event.find('pick[publicID="'+pickid+'"] > time > value').text().split('T')[1].substring(0,11);
-							row += sprintf('%-4s %2s  %5.1f %5.1f %3s %1s %13s %5.1f %5.2f\n', stationcode, networkcode, Number(dist), Number(azi), phase, phasemode, picktime, Number(tres), Number(tweight));
-						};
-					});
-					row += '
Daten werden geladen ...
'+location+'Karte
Daten werden geladen ...
' + sprintf('Download QuakeML or miniSEED', xmlurl, mseedurl) + '