From 2134402e937fdd3afad0e03d6e9a93e58deeb3d4 Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Fri, 4 Sep 2015 13:13:58 +0000 Subject: [PATCH 1/6] Fixed date bug which surfaced in Chromium Browser --- www/events.js | 19 ++++++++++++------- www/events.js.en | 19 ++++++++++++------- www/impressum.inc.de | 24 ++++++++++++------------ www/index.html.de | 2 +- www/index.html.en | 2 +- www/info.inc.de | 2 +- www/map.js | 2 +- www/map.js.en | 2 +- www/misc.js | 4 ++-- www/stations.js | 10 +++++----- www/stations.js.en | 10 +++++----- 11 files changed, 53 insertions(+), 43 deletions(-) diff --git a/www/events.js b/www/events.js index f958781..1d736c5 100644 --- a/www/events.js +++ b/www/events.js @@ -44,10 +44,12 @@ function getGeolocation(id, lat, lng) { $.getJSON( config['ajax']['nominatimURL'], { lat: lat, lon: lng, zoom: 10, format: "json" } ) .done(function( json ) { var city = json.address["city"]; + if ( ~city ) { city = json.address["town"]; }; + if ( ~city ) { city = json.address["village"]; }; var country = json.address["country"]; var countryCode = json.address["country_code"].toUpperCase(); geolocationTable[id] = city; - ( country != "Deutschland" ) ? geolocationTable[id] = geolocationTable[id] + " ("+countryCode+")" : null; + ( countryCode != "DE" ) ? geolocationTable[id] = geolocationTable[id] + " ("+countryCode+")" : null; if ( city ) { $("#eventstable a.toggle[eventid="+id+"]").text(geolocationTable[id]); var sort = [[0,1],[1,1],[2,1]]; @@ -55,7 +57,7 @@ function getGeolocation(id, lat, lng) { $("#eventstable").trigger("updateCache"); $("#eventstable").trigger("sorton", [sort]); } else { - console.log("Nominatim did not provide a city tag for "+lat+" / "+lng); + // console.log("Nominatim did not provide a city tag for "+lat+" / "+lng); }; }) .fail(function( jqxhr, textStatus, error ) { @@ -137,6 +139,9 @@ function ajaxLoadEvents(stime, etime, eventid, url, target) { // 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); + if ( ~oTime ) { + oTime = new Date(otime.split('.')[0]); + }; var sTime = new Date(oTime.getTime()-10*1000.-oTime.getMilliseconds()); var eTime = new Date(oTime.getTime()+50*1000.-oTime.getMilliseconds()); 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())); @@ -155,11 +160,11 @@ function ajaxLoadEvents(stime, etime, eventid, url, target) { if ((stime <= oTime && etime >= oTime ) || ( id == eventid )) { var marker = addEventMarker(id, Number(lat), Number(lng), Number(mag), type); 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('Tiefe: %.1f km
', Number(depth)/1000.) + + 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('Tiefe: %.1f km
', Number(depth)/1000.) + sprintf('Zeit: %sZ

', otime.split('.')[0], otime.split('.')[0]); marker.bindPopup(text); }; diff --git a/www/events.js.en b/www/events.js.en index b059173..0bf8c60 100644 --- a/www/events.js.en +++ b/www/events.js.en @@ -44,10 +44,12 @@ function getGeolocation(id, lat, lng) { $.getJSON( config['ajax']['nominatimURL'], { lat: lat, lon: lng, zoom: 10, format: "json" } ) .done(function( json ) { var city = json.address["city"]; + if ( ~city ) { city = json.address["town"]; }; + if ( ~city ) { city = json.address["village"]; }; var country = json.address["country"]; var countryCode = json.address["country_code"].toUpperCase(); geolocationTable[id] = city; - ( country != "Deutschland" ) ? geolocationTable[id] = geolocationTable[id] + " ("+countryCode+")" : null; + ( countryCode != "DE" ) ? geolocationTable[id] = geolocationTable[id] + " ("+countryCode+")" : null; if ( city ) { $("#eventstable a.toggle[eventid="+id+"]").text(geolocationTable[id]); var sort = [[0,1],[1,1],[2,1]]; @@ -55,7 +57,7 @@ function getGeolocation(id, lat, lng) { $("#eventstable").trigger("updateCache"); $("#eventstable").trigger("sorton", [sort]); } else { - console.log("Nominatim did not provide a city tag for "+lat+" / "+lng); + // console.log("Nominatim did not provide a city tag for "+lat+" / "+lng); }; }) .fail(function( jqxhr, textStatus, error ) { @@ -137,6 +139,9 @@ function ajaxLoadEvents(stime, etime, eventid, url, target) { // 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); + if ( ~oTime ) { + oTime = new Date(otime.split('.')[0]); + }; var sTime = new Date(oTime.getTime()-10*1000.-oTime.getMilliseconds()); var eTime = new Date(oTime.getTime()+50*1000.-oTime.getMilliseconds()); 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())); @@ -155,11 +160,11 @@ function ajaxLoadEvents(stime, etime, eventid, url, target) { if ((stime <= oTime && etime >= oTime ) || ( id == eventid )) { var marker = addEventMarker(id, Number(lat), Number(lng), Number(mag), type); 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('Tiefe: %.1f km
', Number(depth)/1000.) + + 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('Tiefe: %.1f km
', Number(depth)/1000.) + sprintf('Zeit: %sZ

', otime.split('.')[0], otime.split('.')[0]); marker.bindPopup(text); }; diff --git a/www/impressum.inc.de b/www/impressum.inc.de index 698ebde..c4c5a1e 100644 --- a/www/impressum.inc.de +++ b/www/impressum.inc.de @@ -1,23 +1,23 @@

Anschrift

- Seismologisches Observatorium der
- Ruhr-Universität Bochum
- NA 3/174
- 44780 Bochum
- Tel.: 0234 32-27574
- Fax: 0234 32-07574
+ Seismologisches Observatorium der
+ Ruhr-Universität Bochum
+ NA 3/174
+ 44780 Bochum
+ Tel.: 0234 32-27574
+ Fax: 0234 32-07574

Die Ruhr-Universität ist eine Körperschaft des Öffentlichen Rechts. Sie wird durch ihren Rektor Herrn Prof. Dr. Elmar W. Weiler gesetzlich vertreten.

Zuständige Aufsichtsbehörde ist das Ministerium für Innovation, Wissenschaft und Forschung des Landes Nordrhein-Westfalen, Völklinger Straße 49, 40221 Düsseldorf.

Umsatzsteuer-Identifikationsnummer: DE 127 056 261

Inhaltliche und technische Verantwortung für die Seiten des Seismologischen Observatoriums der Ruhr-Universität Bochum

- Herr Dr. Kasper D. Fischer
- Ruhr-Universität Bochum
- 44780 Bochum
- Tel.: 0234 32-27574
- Fax: 0234 32-07574
- E-Mail: kasper.fischer@ruhr-uni-bochum.de
+ Herr Dr. Kasper D. Fischer
+ Ruhr-Universität Bochum
+ 44780 Bochum
+ Tel.: 0234 32-27574
+ Fax: 0234 32-07574
+ E-Mail: kasper.fischer@ruhr-uni-bochum.de

Meldungen über missbräuchliche Nutzungen, die von Stationen aus dem IP-Namensbereich ruhr-uni-bochum.de ausgehen, senden Sie bitte an die Email-Adresse abuse@ruhr-uni-bochum.de. Gleichfalls bittet die Ruhr-Universität um Mitteilung an dieselbe Email-Adresse, wenn rechtswidrige Inhalte durch Links auf Seiten der Ruhr-Universität zu diff --git a/www/index.html.de b/www/index.html.de index 860674c..f51b766 100755 --- a/www/index.html.de +++ b/www/index.html.de @@ -178,6 +178,6 @@

- + diff --git a/www/index.html.en b/www/index.html.en index 6e6fca5..0474a92 100755 --- a/www/index.html.en +++ b/www/index.html.en @@ -179,6 +179,6 @@
- + diff --git a/www/info.inc.de b/www/info.inc.de index d0b0059..2b6c14b 100644 --- a/www/info.inc.de +++ b/www/info.inc.de @@ -1,7 +1,7 @@

Navigation zu den Internetseiten

    -
  • des Seismologisches Observatorium
    der Ruhr-Universität Bochum
  • +
  • des Seismologisches Observatorium
    der Ruhr-Universität Bochum
  • der Arbeitsgruppe Seismologie
  • des Instituts für Geologie, Mineralogie und Geophysik
  • der Ruhr-Universität Bochum
  • diff --git a/www/map.js b/www/map.js index abbc059..3a673b2 100644 --- a/www/map.js +++ b/www/map.js @@ -32,7 +32,7 @@ function addStationMarker(id, lat, lng, station) { color: config['station']['markerColor'], weight: 1, opacity: 1, - radius: config['station']['markerSize'][id] || config['station']['markerSize']['default'], + radius: config['station']['markerSize'][id] || config['station']['markerSize']['defaultSize'], className: id+' stationMarker', }); marker.bindLabel('Station '+station); diff --git a/www/map.js.en b/www/map.js.en index 3f9663c..44c6fde 100644 --- a/www/map.js.en +++ b/www/map.js.en @@ -32,7 +32,7 @@ function addStationMarker(id, lat, lng, station) { color: config['station']['markerColor'], weight: 1, opacity: 1, - radius: config['station']['markerSize'][id] || config['station']['markerSize']['default'], + radius: config['station']['markerSize'][id] || config['station']['markerSize']['defaultSize'], className: id+' stationMarker', }); marker.bindLabel('Station '+station); diff --git a/www/misc.js b/www/misc.js index d0a5970..33ca0fc 100644 --- a/www/misc.js +++ b/www/misc.js @@ -119,7 +119,7 @@ var config = { markerColor: 'darkgreen', markerOpacity: 1, markerSize: { - default: 8, + defaultSize: 8, GE_IBBN: 10, GR_BUG: 10, GR_KAST: 10, @@ -211,4 +211,4 @@ $(document).ready(function() { }).bind("ajaxStop", function() { $("#spinner").hide(); }); -}); \ No newline at end of file +}); diff --git a/www/stations.js b/www/stations.js index 4daea2f..fb41de5 100644 --- a/www/stations.js +++ b/www/stations.js @@ -66,7 +66,7 @@ function loadStations(stime, etime) { var row = sprintf('%s%s%7.4f%7.4f' , network, station, Number(lat), Number(lng)); // setting up network details (2nd line) row += sprintf('%s', networkText[network] || ''); - row += ( $.inArray(station, bochumStation)+1 ) ? '
    Betreiber: Ruhr-Universität Bochum' : '' ; + row += ( $.inArray(station, bochumStation)+1 ) ? '
    Betreiber: Ruhr-Universität Bochum' : '' ; if ( network == 'RN' || network == 'X5' || $.inArray(station, bochumStation)+1 ) { // setting up station details (3rd line) row += ''; @@ -81,7 +81,7 @@ function loadStations(stime, etime) { sc3mlRespURL = URL + '&level=response&format=sc3ml'; dlsvFile = sprintf('%s_%s.dlsv', network.toUpperCase(), station.toUpperCase()); row += '' - + sprintf('Download details: FDSNxml or SC3ml
    ', stationID, fdsnxmlURL, stationID, sc3mlURL) + + sprintf('Download details: FDSNxml or SC3ml
    ', stationID, fdsnxmlURL, stationID, sc3mlURL) + sprintf('Response files: FDSNxml, SC3ml ', stationID, fdsnxmlRespURL, stationID, sc3mlRespURL) + sprintf('or datalessSEED', config['ajax']['dlsvURL'] + '/' + dlsvFile, dlsvFile.toLowerCase()) + ''; @@ -124,13 +124,13 @@ function stationDetails(station, network, lat, lng, stationId, stationText, stat var elevation = stationObject.find('Elevation:first').text(); var name = stationObject.find('Site > Name').text(); output = '
    '
    -		+ name + '
    ' - + 'Position: ' + lat + '°N ' + lng + '°E, Höhe: ' + elevation + ' m NN
    '; + + name + '
    ' + + 'Position: ' + lat + '°N ' + lng + '°E, Höhe: ' + elevation + ' m NN
    '; stationObject.find('Channel').each(function() { var code = $(this).attr('code'); var sensor = $(this).find('Sensor > Type').text().split(',')[0]; var sampleRate = $(this).find('SampleRate').text(); - output += '
    Kanal ' + code + ', Abtastrate ' + sampleRate + ' Hz, Sensor ' + sensor; + output += '
    Kanal ' + code + ', Abtastrate ' + sampleRate + ' Hz, Sensor ' + sensor; }); output += '
    '; return output; diff --git a/www/stations.js.en b/www/stations.js.en index 5d6c1ba..255ec32 100644 --- a/www/stations.js.en +++ b/www/stations.js.en @@ -66,7 +66,7 @@ function loadStations(stime, etime) { var row = sprintf('%s%s%7.4f%7.4f' , network, station, Number(lat), Number(lng)); // setting up network details (2nd line) row += sprintf('%s', networkText[network] || ''); - row += ( $.inArray(station, bochumStation)+1 ) ? '
    Operator: Ruhr-University Bochum' : '' ; + row += ( $.inArray(station, bochumStation)+1 ) ? '
    Operator: Ruhr-University Bochum' : '' ; if ( network == 'RN' || network == 'X5' || $.inArray(station, bochumStation)+1 ) { // setting up station details (3rd line) row += ''; @@ -81,7 +81,7 @@ function loadStations(stime, etime) { sc3mlRespURL = URL + '&level=response&format=sc3ml'; dlsvFile = sprintf('%s_%s.dlsv', network.toUpperCase(), station.toUpperCase()); row += '' - + sprintf('Download details: FDSNxml or SC3ml
    ', stationID, fdsnxmlURL, stationID, sc3mlURL) + + sprintf('Download details: FDSNxml or SC3ml
    ', stationID, fdsnxmlURL, stationID, sc3mlURL) + sprintf('Response files: FDSNxml, SC3ml ', stationID, fdsnxmlRespURL, stationID, sc3mlRespURL) + sprintf('or datalessSEED', config['ajax']['dlsvURL'] + '/' + dlsvFile, dlsvFile.toLowerCase()) + ''; @@ -124,13 +124,13 @@ function stationDetails(station, network, lat, lng, stationId, stationText, stat var elevation = stationObject.find('Elevation:first').text(); var name = stationObject.find('Site > Name').text(); output = '
    '
    -		+ name + '
    ' - + 'Position: ' + lat + '°N ' + lng + '°E, height: ' + elevation + ' m a.s.l.
    '; + + name + '
    ' + + 'Position: ' + lat + '°N ' + lng + '°E, height: ' + elevation + ' m a.s.l.
    '; stationObject.find('Channel').each(function() { var code = $(this).attr('code'); var sensor = $(this).find('Sensor > Type').text().split(',')[0]; var sampleRate = $(this).find('SampleRate').text(); - output += '
    Chanel ' + code + ', Samplingrate ' + sampleRate + ' Hz, Sensor ' + sensor; + output += '
    Chanel ' + code + ', Samplingrate ' + sampleRate + ' Hz, Sensor ' + sensor; }); output += '
    '; return output; From 703834c9da37d16a25f4c669321adfd9e5a93ada Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Sun, 3 Dec 2017 11:18:55 +0000 Subject: [PATCH 2/6] Updated scripts to create events.xml and geolocation.js cache files. --- scripts/mkEvents.csh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/mkEvents.csh b/scripts/mkEvents.csh index 4b6d670..46f6cd4 100755 --- a/scripts/mkEvents.csh +++ b/scripts/mkEvents.csh @@ -1 +1,4 @@ -curl -o events.xml "https://ariadne.geophysik.ruhr-uni-bochum.de/fdsnws/event/1/query?starttime=2015-04-01&orderby=time&minlat=50.92&maxlat=52.76&minlon=4.26&maxlon=9.74&minmag=1.1" +#!/bin/bash + +STIME=$1 +curl -o events.xml "https://ariadne.geophysik.ruhr-uni-bochum.de/fdsnws/event/1/query?starttime=${STIME}&orderby=time&minlat=50.92&maxlat=52.76&minlon=4.26&maxlon=9.74&minmag=1.1" From aed22c756722a5774622009c5189b346c684f8cb Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Sun, 3 Dec 2017 11:22:37 +0000 Subject: [PATCH 3/6] Updated JavaScript files to use new mapquest api after the old one wasn't supported unexpectedly. --- www/index.html.de | 4 +++- www/map.js | 32 ++++++++++++++++++++++---------- www/misc.js | 2 +- 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/www/index.html.de b/www/index.html.de index 39542dd..0943ff0 100755 --- a/www/index.html.de +++ b/www/index.html.de @@ -39,7 +39,9 @@ - + + + diff --git a/www/map.js b/www/map.js index a73dd5e..d1e1dfd 100644 --- a/www/map.js +++ b/www/map.js @@ -133,19 +133,18 @@ 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, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); - new L.Control.Zoom({ position: 'topright' }).addTo(map); - new L.control.scale({position: 'bottomright', imperial: false}).addTo(map); - + // create baselayer switch ( config['map']['baselayer'] ) { case 'osmde': // add OpenStreetMap.DE tile layer + map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); L.tileLayer('http://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png', { attribution: '© OpenStreetMap contributors, CC-BY-SA', }).addTo(map); break; case 'esrigray': // add ESRI Grayscale World Map (neither city nor road names) + map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); L.tileLayer('//server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}', { attribution: 'Tiles © Esri — Esri, DeLorme, NAVTEQ', @@ -153,18 +152,21 @@ $(document).ready(function() { }).addTo(map); break; case 'aerial': // add ESRI WordImagery tile layer + map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); L.tileLayer('http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', { attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community' }).addTo(map); break; case 'komoot': // add OpenStreetMap.DE tile layer + map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); L.tileLayer('//www.komoot.de/tiles/{s}/{z}/{x}/{y}.png', { attribution: 'Map data © OpenStreetMap contributors, CC-BY-SA | Tiles Courtesy of Komoot', }).addTo(map); break; case 'mapquestgray': // add MapQuestOSM tile layer + map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); L.tileLayer.grayscale('http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg', { subdomains: '1234', @@ -175,14 +177,24 @@ $(document).ready(function() { case 'mapquest': // add MapQuestOSM tile layer null; default: - L.tileLayer('http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg', - { - subdomains: '1234', - detectRetina: true, - attribution: 'Map data © OpenStreetMap contributors, CC-BY-SA | Tiles Courtesy of MapQuest ', - }).addTo(map); + var mapLayer = MQ.mapLayer(); + map = L.map('map', { + zoomControl: false, + worldCopyJump: true, + layers: mapLayer, + }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); + //L.tileLayer('http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg', + //{ + //subdomains: '1234', + //detectRetina: true, + //attribution: 'Map data © OpenStreetMap contributors, CC-BY-SA | Tiles Courtesy of MapQuest ', + //}).addTo(map); }; + // add controls + new L.Control.Zoom({ position: 'topright' }).addTo(map); + new L.control.scale({position: 'bottomright', imperial: false}).addTo(map); + // create station and event layer // stationLayer = L.geoJson().addTo(map); stationLayer = new L.MarkerGroup().addTo(map); diff --git a/www/misc.js b/www/misc.js index bd68521..e249cc4 100644 --- a/www/misc.js +++ b/www/misc.js @@ -90,7 +90,7 @@ var eventDetails = {}; var stationTable = {}; var config = { ajax: { - timeout: 10000, // 10 seconds + timeout: 20000, // 20 seconds eventURL: '/fdsnws/event/1/query', dlsvURL: 'dlsv', mseedURL: '/fdsnws/dataselect/1/query', From 87af90f04705fa55cfa352d5481f65139474e43a Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Sun, 3 Dec 2017 11:23:41 +0000 Subject: [PATCH 4/6] Updated WSGI scripts. --- .gitattributes | 1 + wsgi/plotFDSN.py | 20 +++++++++++++------- wsgi/showEnv.py | 17 +++++++++++++++++ 3 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 wsgi/showEnv.py diff --git a/.gitattributes b/.gitattributes index 1c8be81..8bc052e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,6 @@ * text=auto !eol scripts/mkEvents.csh -text +wsgi/showEnv.py -text www/.htaccess -text www/copyright.inc.de -text www/external/TileLayer.Grayscale.js -text diff --git a/wsgi/plotFDSN.py b/wsgi/plotFDSN.py index 1145823..09ba15a 100755 --- a/wsgi/plotFDSN.py +++ b/wsgi/plotFDSN.py @@ -133,7 +133,7 @@ def fancy_plot(st, wsgi=False, img_format='png', color=True): def trace_dayplot(st, deltat = None, - ftype='bandpass', fmin=1.0, fmax=7.0, + ftype='none', fmin=1.0, fmax=7.0, col=('b', 'r', 'g'), interval=20, outpattern='', wsgi=False): """ @@ -260,18 +260,24 @@ def main(backend=None, args=None, wsgi=False): if args['stime']: otime = UTCDateTime(args['stime']) else: - otime = UTCDateTime() - 3600 - deltat + otime = UTCDateTime() - 3600. - deltat network = args['station'].split('.')[0] station = args['station'].split('.')[1] if args['type'] == 'dayplot': - channel = 'BHZ' + if network == 'Z3': + channel = 'HHZ' + else: + channel = 'BHZ' else: - if args['length'] < 3600: + if args['length'] < 3600.: channel = 'HH?' else: - channel = 'BH?' + if network == 'Z3': + channel = 'HH?' + else: + channel = 'BH?' else: - otime = UTCDateTime('2014-11-15T11:35:25Z') + otime = UTCDateTime() - 3600. deltat = 30 network = 'GR' station = 'BUG' @@ -398,4 +404,4 @@ if __name__ == "__main__": if os.getenv('DISPLAY'): main(args=cla) else: - main('Agg', cla) \ No newline at end of file + main('Agg', cla) diff --git a/wsgi/showEnv.py b/wsgi/showEnv.py new file mode 100644 index 0000000..fc28441 --- /dev/null +++ b/wsgi/showEnv.py @@ -0,0 +1,17 @@ +def application(environ, start_response): + """ + Function application - Wrapper to process wsgi request + :param environ: contains information on the wsgi environment + :type environ: dict + :param start_response: function to process response header by the wsgi server + :type start_response: function + :return: response to be sent to the client by the wsgi server + :rtype: list + """ + + from cgi import FieldStorage + + form = FieldStorage(fp=environ['wsgi.input'], environ=environ) + + start_response('200 OK', [('Content-Type', 'text/html')]) + return [form] \ No newline at end of file From 9bb73b9ab5bc60a45c4ef56e92a507cd94fc3c5c Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Sun, 3 Dec 2017 11:24:51 +0000 Subject: [PATCH 5/6] Updated svn:ignore property --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 2b35943..c84658a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +/events.xml +/geolocation.js wsgi/.idea www/dlsv www/event.xml From 2251f25fcb1c8438d105d6ac76d2b075b3d4fd37 Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Tue, 14 Jul 2020 19:31:46 +0200 Subject: [PATCH 6/6] Integrating changes made on web server --- www/.htaccess | 6 +++++ www/events.js | 45 ++++++++++++++++---------------- www/events.js.en | 45 ++++++++++++++++---------------- www/index.html.en | 5 +++- www/map.js | 38 ++++++++++++++++----------- www/map.js.en | 62 +++++++++++++++++++++++++++++--------------- www/misc.js | 25 +++++++++++++----- www/specialevents.js | 27 +++++++++++++++++-- www/stations.js | 56 ++++++++++++++++++++++++++++++--------- www/stations.js.en | 60 ++++++++++++++++++++++++++++++++---------- 10 files changed, 253 insertions(+), 116 deletions(-) diff --git a/www/.htaccess b/www/.htaccess index 605d2f4..93cdb28 100644 --- a/www/.htaccess +++ b/www/.htaccess @@ -1 +1,7 @@ Allow from all +Header always set Access-Control-Allow-Origin "https://fdsnws.geophysik.ruhr-uni-bochum.de" +Header always append Access-Control-Allow-Origin "https://photon.komoot.de" +Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT" +Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token" +Header always set Access-Control-Expose-Headers "Content-Security-Policy, Location" +Header always set Access-Control-Max-Age "600" diff --git a/www/events.js b/www/events.js index 3bc68e5..6cd209f 100644 --- a/www/events.js +++ b/www/events.js @@ -40,27 +40,23 @@ function addTableRow(row, table) { /* do reverse geolocation lookup */ function getGeolocation(id, lat, lng) { - if ( !geolocationTable[id] ) { + if ( $.inArray(id, geolocationTable) == -1 ) { $.getJSON( config['ajax']['nominatimURL'], { lat: lat, lon: lng } ) .done(function( json ) { - var city = json.address["city"]; - if ( ~city ) { city = json.address["town"]; }; - if ( ~city ) { city = json.address["village"]; }; - var country = json.address["country"]; - var countryCode = json.address["country_code"].toUpperCase(); - var city = json.features[0].properties.city; - var countryCode = json.features[0].properties.country; - geolocationTable[id] = city; - ( countryCode != "DE" ) ? geolocationTable[id] = geolocationTable[id] + " ("+countryCode+")" : null; - ( countryCode != "Germany" ) ? geolocationTable[id] = geolocationTable[id] + " ("+countryCode+")" : null; - if ( city ) { - $("#eventstable a.toggle[eventid="+id+"]").text(geolocationTable[id]); - var sort = [[0,1],[1,1],[2,1]]; - $("#eventstable").trigger("update", [true]); - $("#eventstable").trigger("updateCache"); - $("#eventstable").trigger("sorton", [sort]); - } else { - // console.log("Nominatim did not provide a city tag for "+lat+" / "+lng); + if ( json.features[0] ) { + var city = json.features[0].properties.city; + var countryCode = json.features[0].properties.country; + geolocationTable[id] = city; + ( countryCode != "Germany" ) ? geolocationTable[id] = geolocationTable[id] + " ("+countryCode+")" : null; + if ( city ) { + $("#eventstable a.toggle[eventid="+id+"]").text(geolocationTable[id]); + var sort = [[0,1],[1,1],[2,1]]; + $("#eventstable").trigger("update", [true]); + $("#eventstable").trigger("updateCache"); + $("#eventstable").trigger("sorton", [sort]); + } else { + // console.log("Nominatim did not provide a city tag for "+lat+" / "+lng); + }; }; }) .fail(function( jqxhr, textStatus, error ) { @@ -93,7 +89,7 @@ function ajaxLoadEvents(stime, etime, eventid, url, target) { } else { request_data = { starttime: sprintf("%d-%02d-%02d", rtime.getFullYear(), rtime.getMonth()+1, rtime.getDate()), - orderby: 'time', + orderby: 'time-asc', minlat: sprintf('%.2f', mapBounds.getSouth()-config['map']['latlngDelta']), maxlat: sprintf('%.2f', mapBounds.getNorth()+config['map']['latlngDelta']), minlon: sprintf('%.2f', mapBounds.getWest()-config['map']['latlngDelta']), @@ -124,7 +120,7 @@ function ajaxLoadEvents(stime, etime, eventid, url, target) { var type = $(this).find('type').last().text(); var location // 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'] ) { + if ( !eventTable[id] && $.inArray(type, config['event']['typeWhitelist'] ) >= 0 && $.inArray(evaluationStatus, config['event']['evaluationBlacklist'])<0 && Number(mag)+0.05 >= config['event']['minMag'] ) { geolocationTable[id] ? null : getGeolocation(id, lat, lng); // do AJAX lookup if not cached, location will be updated later location = ( geolocationTable[id] || getLocation(lat, lng)[0] || $(this).find('description > text').text() ); // general event info (1st line) @@ -432,7 +428,12 @@ $(document).ready(function() { typetext += '(bergbau-)induziertes Ereignis (Kreis)'; break; case 'quarry blast': - typetext += 'Steinbruchsprengung (Rad)'; + case 'controlled explosion': + case 'explosion': + typetext += 'Sprengung (Rad)'; + break; + case 'nuclear explosion': + typetext += 'Atomwaffentest (Viereck)'; break; }; $("#events-type").append(typetext); diff --git a/www/events.js.en b/www/events.js.en index 0c7c3c2..e06e2c9 100644 --- a/www/events.js.en +++ b/www/events.js.en @@ -40,27 +40,23 @@ function addTableRow(row, table) { /* do reverse geolocation lookup */ function getGeolocation(id, lat, lng) { - if ( !geolocationTable[id] ) { + if ( $.inArray(id, geolocationTable) == -1 ) { $.getJSON( config['ajax']['nominatimURL'], { lat: lat, lon: lng } ) .done(function( json ) { - var city = json.address["city"]; - if ( ~city ) { city = json.address["town"]; }; - if ( ~city ) { city = json.address["village"]; }; - var country = json.address["country"]; - var countryCode = json.address["country_code"].toUpperCase(); - var city = json.features[0].properties.city; - var countryCode = json.features[0].properties.country; - geolocationTable[id] = city; - ( countryCode != "DE" ) ? geolocationTable[id] = geolocationTable[id] + " ("+countryCode+")" : null; - ( countryCode != "Germany" ) ? geolocationTable[id] = geolocationTable[id] + " ("+countryCode+")" : null; - if ( city ) { - $("#eventstable a.toggle[eventid="+id+"]").text(geolocationTable[id]); - var sort = [[0,1],[1,1],[2,1]]; - $("#eventstable").trigger("update", [true]); - $("#eventstable").trigger("updateCache"); - $("#eventstable").trigger("sorton", [sort]); - } else { - // console.log("Nominatim did not provide a city tag for "+lat+" / "+lng); + if ( json.features[0] ) { + var city = json.features[0].properties.city; + var countryCode = json.features[0].properties.country; + geolocationTable[id] = city; + ( countryCode != "Germany" ) ? geolocationTable[id] = geolocationTable[id] + " ("+countryCode+")" : null; + if ( city ) { + $("#eventstable a.toggle[eventid="+id+"]").text(geolocationTable[id]); + var sort = [[0,1],[1,1],[2,1]]; + $("#eventstable").trigger("update", [true]); + $("#eventstable").trigger("updateCache"); + $("#eventstable").trigger("sorton", [sort]); + } else { + // console.log("Nominatim did not provide a city tag for "+lat+" / "+lng); + }; }; }) .fail(function( jqxhr, textStatus, error ) { @@ -93,7 +89,7 @@ function ajaxLoadEvents(stime, etime, eventid, url, target) { } else { request_data = { starttime: sprintf("%d-%02d-%02d", rtime.getFullYear(), rtime.getMonth()+1, rtime.getDate()), - orderby: 'time', + orderby: 'time-asc', minlat: sprintf('%.2f', mapBounds.getSouth()-config['map']['latlngDelta']), maxlat: sprintf('%.2f', mapBounds.getNorth()+config['map']['latlngDelta']), minlon: sprintf('%.2f', mapBounds.getWest()-config['map']['latlngDelta']), @@ -123,8 +119,8 @@ function ajaxLoadEvents(stime, etime, eventid, url, target) { var evaluationStatus = $(this).find('origin > evaluationStatus').text(); var type = $(this).find('type').last().text(); var location - // get location, try this in order: - if ( !eventTable[id] && $.inArray(type, config['event']['typeWhitelist'] )+1 && $.inArray(evaluationStatus, config['event']['evaluationBlacklist'])<0 && Number(mag)+0.05 >= config['event']['minMag'] ) { + // create table row: Date, Time, Mag, Location + if ( !eventTable[id] && $.inArray(type, config['event']['typeWhitelist'] ) >= 0 && $.inArray(evaluationStatus, config['event']['evaluationBlacklist'])<0 && Number(mag)+0.05 >= config['event']['minMag'] ) { geolocationTable[id] ? null : getGeolocation(id, lat, lng); // do AJAX lookup if not cached, location will be updated later location = ( geolocationTable[id] || getLocation(lat, lng)[0] || $(this).find('description > text').text() ); // general event info (1st line) @@ -432,8 +428,13 @@ $(document).ready(function() { typetext += '(mining-)induced event (circle)'; break; case 'quarry blast': + case 'controlled explosion': + case 'explosion': typetext += 'quarry blast (wheel)'; break; + case 'nuclear explosion': + typetext += 'nuclear weapon test (square)'; + break; }; $("#events-type").append(typetext); }); diff --git a/www/index.html.en b/www/index.html.en index 47b3175..7d1e4e2 100755 --- a/www/index.html.en +++ b/www/index.html.en @@ -40,6 +40,9 @@ + + + @@ -115,7 +118,7 @@ Symbols:

    - Nominatim Search Courtesy of MapQuest Mapquest Logo + Reverse Geolocation courtesy of Photon by Komoot

diff --git a/www/map.js b/www/map.js index d1e1dfd..5d7fd21 100644 --- a/www/map.js +++ b/www/map.js @@ -17,7 +17,7 @@ for more details. You should have received a copy of the GNU General Public License along - with this program. If not, see http://www.gnu.org/licenses/. + with this program. If not, see https://www.gnu.org/licenses/. $Id$ */ @@ -61,6 +61,12 @@ function addEventMarker(id, lat, lng, mag, type) { case 'earthquake': marker = L.starMarker(L.latLng(lat, lng), markerOptions); break; + case 'nuclear explosion': + markerOptions['numberOfSides'] = 4; + markerOptions['radius'] = 2.0*markerOptions['radius']; + markerOptions['innerRadius'] = 0.3*markerOptions['radius']; + marker = L.regularPolygonMarker(L.latLng(lat, lng), markerOptions); + break; case 'explosion': markerOptions['numberOfSides'] = 6; markerOptions['radius'] = 2.0*markerOptions['radius']; @@ -68,6 +74,7 @@ function addEventMarker(id, lat, lng, mag, type) { marker = L.regularPolygonMarker(L.latLng(lat, lng), markerOptions); break; case 'quarry blast': + case 'controlled explosion': markerOptions['numberOfPoints'] = 7; markerOptions['innerRadius'] = 0.3*markerOptions['radius']; marker = L.starMarker(L.latLng(lat, lng), markerOptions); @@ -138,9 +145,9 @@ $(document).ready(function() { switch ( config['map']['baselayer'] ) { case 'osmde': // add OpenStreetMap.DE tile layer map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); - L.tileLayer('http://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png', + L.tileLayer('https://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png', { - attribution: '© OpenStreetMap contributors, CC-BY-SA', + attribution: '© OpenStreetMap contributors, CC-BY-SA', }).addTo(map); break; case 'esrigray': // add ESRI Grayscale World Map (neither city nor road names) @@ -153,7 +160,7 @@ $(document).ready(function() { break; case 'aerial': // add ESRI WordImagery tile layer map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); - L.tileLayer('http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', + L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', { attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community' }).addTo(map); @@ -162,18 +169,19 @@ $(document).ready(function() { map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); L.tileLayer('//www.komoot.de/tiles/{s}/{z}/{x}/{y}.png', { - attribution: 'Map data © OpenStreetMap contributors, CC-BY-SA | Tiles Courtesy of Komoot', + attribution: 'Map data © OpenStreetMap contributors, CC-BY-SA | Tiles Courtesy of Komoot', }).addTo(map); break; case 'mapquestgray': // add MapQuestOSM tile layer - map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); - L.tileLayer.grayscale('http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg', - { - subdomains: '1234', - detectRetina: true, - attribution: 'Map data © OpenStreetMap contributors, CC-BY-SA | Tiles Courtesy of MapQuest ', - }).addTo(map); - break; + null; + // map = L.map('map', { zoomControl: false, worldCopyJump: true, layers: mapLayer }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); + // L.tileLayer.grayscale('https://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg', + // { + // subdomains: '1234', + // detectRetina: true, + // attribution: 'Map data © OpenStreetMap contributors, CC-BY-SA | Tiles Courtesy of MapQuest ', + //}).addTo(map); + //break; case 'mapquest': // add MapQuestOSM tile layer null; default: @@ -183,11 +191,11 @@ $(document).ready(function() { worldCopyJump: true, layers: mapLayer, }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); - //L.tileLayer('http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg', + //L.tileLayer('https://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg', //{ //subdomains: '1234', //detectRetina: true, - //attribution: 'Map data © OpenStreetMap contributors, CC-BY-SA | Tiles Courtesy of MapQuest ', + //attribution: 'Map data © OpenStreetMap contributors, CC-BY-SA | Tiles Courtesy of MapQuest ', //}).addTo(map); }; diff --git a/www/map.js.en b/www/map.js.en index 6281eb5..7a46b22 100644 --- a/www/map.js.en +++ b/www/map.js.en @@ -17,7 +17,7 @@ for more details. You should have received a copy of the GNU General Public License along - with this program. If not, see http://www.gnu.org/licenses/. + with this program. If not, see https://www.gnu.org/licenses/. $Id$ */ @@ -61,6 +61,12 @@ function addEventMarker(id, lat, lng, mag, type) { case 'earthquake': marker = L.starMarker(L.latLng(lat, lng), markerOptions); break; + case 'nuclear explosion': + markerOptions['numberOfSides'] = 4; + markerOptions['radius'] = 2.0*markerOptions['radius']; + markerOptions['innerRadius'] = 0.3*markerOptions['radius']; + marker = L.regularPolygonMarker(L.latLng(lat, lng), markerOptions); + break; case 'explosion': markerOptions['numberOfSides'] = 6; markerOptions['radius'] = 2.0*markerOptions['radius']; @@ -68,6 +74,7 @@ function addEventMarker(id, lat, lng, mag, type) { marker = L.regularPolygonMarker(L.latLng(lat, lng), markerOptions); break; case 'quarry blast': + case 'controlled explosion': markerOptions['numberOfPoints'] = 7; markerOptions['innerRadius'] = 0.3*markerOptions['radius']; marker = L.starMarker(L.latLng(lat, lng), markerOptions); @@ -133,19 +140,19 @@ 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, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); - new L.Control.Zoom({ position: 'topright' }).addTo(map); - new L.control.scale({position: 'bottomright', imperial: false}).addTo(map); + // create baselayer switch ( config['map']['baselayer'] ) { case 'osmde': // add OpenStreetMap.DE tile layer - L.tileLayer('http://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png', + map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); + L.tileLayer('https://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png', { - attribution: '© OpenStreetMap contributors, CC-BY-SA', + attribution: '© OpenStreetMap contributors, CC-BY-SA', }).addTo(map); break; case 'esrigray': // add ESRI Grayscale World Map (neither city nor road names) + map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); L.tileLayer('//server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}', { attribution: 'Tiles © Esri — Esri, DeLorme, NAVTEQ', @@ -153,35 +160,48 @@ $(document).ready(function() { }).addTo(map); break; case 'aerial': // add ESRI WordImagery tile layer - L.tileLayer('http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', + map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); + L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', { attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community' }).addTo(map); break; case 'komoot': // add OpenStreetMap.DE tile layer + map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); L.tileLayer('//www.komoot.de/tiles/{s}/{z}/{x}/{y}.png', { - attribution: 'Map data © OpenStreetMap contributors, CC-BY-SA | Tiles Courtesy of Komoot', + attribution: 'Map data © OpenStreetMap contributors, CC-BY-SA | Tiles Courtesy of Komoot', }).addTo(map); break; case 'mapquestgray': // add MapQuestOSM tile layer - L.tileLayer.grayscale('http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg', - { - subdomains: '1234', - detectRetina: true, - attribution: 'Map data © OpenStreetMap contributors, CC-BY-SA | Tiles Courtesy of MapQuest ', - }).addTo(map); - break; + null; + // map = L.map('map', { zoomControl: false, worldCopyJump: true, layers: mapLayer }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); + // L.tileLayer.grayscale('https://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg', + // { + // subdomains: '1234', + // detectRetina: true, + // attribution: 'Map data © OpenStreetMap contributors, CC-BY-SA | Tiles Courtesy of MapQuest ', + //}).addTo(map); + //break; case 'mapquest': // add MapQuestOSM tile layer null; default: - L.tileLayer('http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg', - { - subdomains: '1234', - detectRetina: true, - attribution: 'Map data © OpenStreetMap contributors, CC-BY-SA | Tiles Courtesy of MapQuest ', - }).addTo(map); + var mapLayer = MQ.mapLayer(); + map = L.map('map', { + zoomControl: false, + worldCopyJump: true, + layers: mapLayer, + }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); + //L.tileLayer('https://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg', + //{ + //subdomains: '1234', + //detectRetina: true, + //attribution: 'Map data © OpenStreetMap contributors, CC-BY-SA | Tiles Courtesy of MapQuest ', + //}).addTo(map); }; + // add controls + new L.Control.Zoom({ position: 'topright' }).addTo(map); + new L.control.scale({position: 'bottomright', imperial: false}).addTo(map); // create station and event layer // stationLayer = L.geoJson().addTo(map); diff --git a/www/misc.js b/www/misc.js index e249cc4..d0a8c31 100644 --- a/www/misc.js +++ b/www/misc.js @@ -91,10 +91,10 @@ var stationTable = {}; var config = { ajax: { timeout: 20000, // 20 seconds - eventURL: '/fdsnws/event/1/query', + eventURL: 'https://fdsnws.geophysik.ruhr-uni-bochum.de/fdsnws/event/1/query', dlsvURL: 'dlsv', - mseedURL: '/fdsnws/dataselect/1/query', - stationURL: '/fdsnws/station/1/query', + mseedURL: 'https://fdsnws.geophysik.ruhr-uni-bochum.de/fdsnws/dataselect/1/query', + stationURL: 'https://fdsnws.geophysik.ruhr-uni-bochum.de/fdsnws/station/1/query', nominatimURL: 'https://photon.komoot.de/reverse', timespan: 180, }, @@ -105,7 +105,9 @@ var config = { markerColorH: 'red', minMag: 1.2, minMagDelta: 0.1, - typeWhitelist: ['earthquake', 'induced or triggered event', 'quarry blast', 'explosion'], + typeWhitelist: ['earthquake', 'induced or triggered event', 'controlled explosion'], + // typeWhitelist: ['earthquake', 'induced or triggered event', 'controlled explosion', 'nuclear explosion'], + // typeWhitelist: ['earthquake', 'induced or triggered event'], }, map: { zoomDefault: 9, @@ -128,7 +130,11 @@ var config = { NL_WIT: 3, NL_WTSB: 3, }, - networkBlacklist: ['NL', 'X5'], + networkBlacklist: ['NL', 'X5', '1A', 'AM'], + stationBlacklist: ['RN_WEA2', 'RN_ACN', 'RN_BHE', 'RN_ENT', 'RN_GSH', 'RN_HES', 'RN_JCKS', 'RN_LOH', + 'RN_OLF', 'RN_PLH', 'RN_RWB', 'RN_SOR', 'RN_TDN', 'RN_WBS', + 'RN_HAM1', 'RN_HAM2', 'RN_HAM3', 'RN_HAM4', 'RN_HAM5', 'RN_HAM6', 'RN_HAM7', 'RN_HAM8', 'RN_HAM9', + 'RN_HAM10', 'RN_HAM11', 'RN_HAM12', 'RN_HAM13', 'RN_HAM14', 'RN_HAM15', 'RN_HAM16', 'RN_HAM17'], }, tab: { active: 0, @@ -139,13 +145,18 @@ var config = { var networkURL = { GE: 'http://dx.doi.org/10.14470/TR560404', GR: 'http://www.bgr.bund.de/DE/Themen/Erdbeben-Gefaehrdungsanalysen/Seismologie/Seismologie/Seismometer_Stationen/Stationsnetze/d_stationsnetz_node.html', + NH: 'http://www.gd.nrw.de/gg_le.htm', NL: 'http://www.knmi.nl/seismologie/seismisch_network_knmi3.html', + RN: 'https://doi.org/10.7914/SN/RN', + YD: 'https://doi.org/10.7914/SN/YD_2020', }; var networkText = { - GE: 'GEOFON Program, GFZ Potsdam', + GE: 'GEOFON Seismic Network - Deutsches GeoForschungsZentrum GFZ', GR: 'German Regional Seismic Network, BGR Hannover', + NH: 'Geologischer Dienst NRW, Krefeld', NL: 'Netherlands Seismic Network, The Netherlands', - RN: 'RuhrNet - Ruhr-University Bochum, Germany', + RN: 'RuhrNet - Ruhr-University Bochum, Germany', + YD: 'FloodRisk Seismic Network', }; var bochumStation = ['BUG', 'IBBN', 'KERA', 'KARP']; diff --git a/www/specialevents.js b/www/specialevents.js index 5ecfd56..057017a 100644 --- a/www/specialevents.js +++ b/www/specialevents.js @@ -9,6 +9,29 @@ var specialEvents = [ //'bug2014ilxd', // Bassum //'bug2014gfzw', // Darmstadt //'bug2014datb', // Groningen - 'bug2013yvko', // Haltern 3.4 - 'bug2015fdpy', // Darmstadt 3.0 + // 'bug2013yvko', // Haltern 3.4 + // 'bug2015fdpy', // Darmstadt 3.0 + // 'bug2016ajgm', // CTBT violation North Korea + // 'bug2016cqkd', // Taunusstein 2.5 + // 'bug2016hdae', // Aldenhoven 2.6 + // 'bug2016hdaj', // Aldenhoven 2.4 + // 'bug2016kkrq', // Bottrop 3.3 + // 'bug2016qphy', // Central Italy 6.1 + // 'bug2016rslt', // CTBT violation North Korea + // 'bug2016ueqo', // Darmstadt 2.4 + // 'bug2016ufpi', // Darmstadt 3.0 + // 'bug2016vico', // Central Italy 6.5 + // 'bug2016vrnc', // Nörvenich 3.2 + // 'bug2016zawb', // St Goar 3.2 + // 'bug2017iyhl', // Hürtgenwald 2.1 + // 'bug2017omwg', // Brühl 2.3 + // 'bug2017rfxe', // CTBT violation North Korea 6.1 + // 'bug2017rjvq', // Dreieich / Hessen 2.6 + // 'bug2017vxmm', // Brühl / Hürth 3.1 + // 'bug2018nyax' // Ochtendung 2.7 + // 'bug2019cxga', // Ochtendung 3.0 + // 'bug2019czbt', // Ochtendung 2.9 + // 'bug2019fura', // Sprengung Duisburg-Hochheide (Weißer Riese) 2.0 + // 'bug2019yeij', // Tektonisch, Hambach 2.2 + 'bug2020fqxf' // Meckenheim, 2.5 ]; diff --git a/www/stations.js b/www/stations.js index fb41de5..00982ea 100644 --- a/www/stations.js +++ b/www/stations.js @@ -23,7 +23,7 @@ */ /* Load the stations using ajax */ -function loadStations(stime, etime) { +function loadStations(station, stime, etime) { var mapBounds = map.getBounds(); var N = mapBounds.getNorth(); var E = mapBounds.getEast(); @@ -37,14 +37,23 @@ function loadStations(stime, etime) { var etime = new Date(); etime.setDate(etime.getDate()+1); }; - var request_data = { - endafter: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()), - startbefore: sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate()), - level: 'channel', - minlat: S-config['map']['latlngDelta'], - maxlat: N+config['map']['latlngDelta'], - minlon: W-config['map']['latlngDelta'], - maxlon: E+config['map']['latlngDelta'], + if ( !station ) { + var request_data = { + endafter: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()), + startbefore: sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate()), + level: 'station', + minlat: S-config['map']['latlngDelta'], + maxlat: N+config['map']['latlngDelta'], + minlon: W-config['map']['latlngDelta'], + maxlon: E+config['map']['latlngDelta'], + }; + } else { + var request_data = { + endafter: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()), + startbefore: sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate()), + level: 'channel', + station: station, + }; }; $.ajax({ type: "GET", @@ -61,13 +70,13 @@ function loadStations(stime, etime) { lng = $(this).find('Longitude:first').text(), stationID = network+'_'+station, stationText = network+'.'+station; - if ( !stationTable[stationID] ) { + if ( !stationTable[stationID] && $.inArray(stationID, config['station']['stationBlacklist']) <0 ) { // general station info (1st line) var row = sprintf('%s%s%7.4f%7.4f' , network, station, Number(lat), Number(lng)); // setting up network details (2nd line) row += sprintf('%s', networkText[network] || ''); row += ( $.inArray(station, bochumStation)+1 ) ? '
Betreiber: Ruhr-Universität Bochum' : '' ; - if ( network == 'RN' || network == 'X5' || $.inArray(station, bochumStation)+1 ) { + if ( network == 'RN' || network == 'Z3' || network == '1A' || network == 'YD' || $.inArray(station, bochumStation)+1 ) { // setting up station details (3rd line) row += ''; row += stationDetails(station, network, lat, lng, stationID, stationText, $(this)); @@ -114,7 +123,16 @@ function loadStations(stime, etime) { } }); // create stations csv download link - request_data['format'] = 'text'; + var request_data = { + endafter: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()), + startbefore: sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate()), + level: 'station', + minlat: S-config['map']['latlngDelta'], + maxlat: N+config['map']['latlngDelta'], + minlon: W-config['map']['latlngDelta'], + maxlon: E+config['map']['latlngDelta'], + format: 'text', + }; $('#stations-csv-link').attr('href', config['ajax']['stationURL']+'?'+$.param(request_data)); }; @@ -205,6 +223,20 @@ function initStationTable() { **********************************************************************/ $(document).ready(function() { loadStations(); + loadStations('A100A'); + loadStations('A101B'); + loadStations('A102A'); + loadStations('A103A'); + loadStations('A103B'); + loadStations('A104A'); + loadStations('A104B'); + loadStations('A105A'); + loadStations('A106B'); + loadStations('A107C'); + loadStations('A108A'); + loadStations('A109A'); + // loadStations('KERA'); + // loadStations('KARP'); // show / hide station info $('#stationstable').delegate('.toggle', 'click' , function(){ // toggle visibility of selected row diff --git a/www/stations.js.en b/www/stations.js.en index 255ec32..c20f615 100644 --- a/www/stations.js.en +++ b/www/stations.js.en @@ -23,7 +23,7 @@ */ /* Load the stations using ajax */ -function loadStations(stime, etime) { +function loadStations(station, stime, etime) { var mapBounds = map.getBounds(); var N = mapBounds.getNorth(); var E = mapBounds.getEast(); @@ -37,14 +37,23 @@ function loadStations(stime, etime) { var etime = new Date(); etime.setDate(etime.getDate()+1); }; - var request_data = { - endafter: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()), - startbefore: sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate()), - level: 'channel', - minlat: S-config['map']['latlngDelta'], - maxlat: N+config['map']['latlngDelta'], - minlon: W-config['map']['latlngDelta'], - maxlon: E+config['map']['latlngDelta'], + if ( !station ) { + var request_data = { + endafter: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()), + startbefore: sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate()), + level: 'station', + minlat: S-config['map']['latlngDelta'], + maxlat: N+config['map']['latlngDelta'], + minlon: W-config['map']['latlngDelta'], + maxlon: E+config['map']['latlngDelta'], + }; + } else { + var request_data = { + endafter: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()), + startbefore: sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate()), + level: 'channel', + station: station, + }; }; $.ajax({ type: "GET", @@ -61,13 +70,13 @@ function loadStations(stime, etime) { lng = $(this).find('Longitude:first').text(), stationID = network+'_'+station, stationText = network+'.'+station; - if ( !stationTable[stationID] ) { + if ( !stationTable[stationID] && $.inArray(stationID, config['station']['stationBlacklist']) <0 ) { // general station info (1st line) var row = sprintf('%s%s%7.4f%7.4f' , network, station, Number(lat), Number(lng)); // setting up network details (2nd line) row += sprintf('%s', networkText[network] || ''); - row += ( $.inArray(station, bochumStation)+1 ) ? '
Operator: Ruhr-University Bochum' : '' ; - if ( network == 'RN' || network == 'X5' || $.inArray(station, bochumStation)+1 ) { + row += ( $.inArray(station, bochumStation)+1 ) ? '
Operator: Ruhr-University Bochum, Germany' : '' ; + if ( network == 'RN' || network == 'Z3' || network == '1A' || network == 'YD' || $.inArray(station, bochumStation)+1 ) { // setting up station details (3rd line) row += ''; row += stationDetails(station, network, lat, lng, stationID, stationText, $(this)); @@ -114,7 +123,16 @@ function loadStations(stime, etime) { } }); // create stations csv download link - request_data['format'] = 'text'; + var request_data = { + endafter: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()), + startbefore: sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate()), + level: 'station', + minlat: S-config['map']['latlngDelta'], + maxlat: N+config['map']['latlngDelta'], + minlon: W-config['map']['latlngDelta'], + maxlon: E+config['map']['latlngDelta'], + format: 'text', + }; $('#stations-csv-link').attr('href', config['ajax']['stationURL']+'?'+$.param(request_data)); }; @@ -130,7 +148,7 @@ function stationDetails(station, network, lat, lng, stationId, stationText, stat var code = $(this).attr('code'); var sensor = $(this).find('Sensor > Type').text().split(',')[0]; var sampleRate = $(this).find('SampleRate').text(); - output += '
Chanel ' + code + ', Samplingrate ' + sampleRate + ' Hz, Sensor ' + sensor; + output += '
Channel ' + code + ', Samplingrate ' + sampleRate + ' Hz, Sensor ' + sensor; }); output += ''; return output; @@ -205,6 +223,20 @@ function initStationTable() { **********************************************************************/ $(document).ready(function() { loadStations(); + loadStations('A100A'); + loadStations('A101B'); + loadStations('A102A'); + loadStations('A103A'); + loadStations('A103B'); + loadStations('A104A'); + loadStations('A104B'); + loadStations('A105A'); + loadStations('A106B'); + loadStations('A107C'); + loadStations('A108A'); + loadStations('A109A'); + // loadStations('KERA'); + // loadStations('KARP'); // show / hide station info $('#stationstable').delegate('.toggle', 'click' , function(){ // toggle visibility of selected row