Author SHA1 Message Date
kasper 43d809cc18 Merge branch 'release/v20200714' into main 2020-07-14 21:13:41 +02:00
kasper e3f27aac7e update copyright information 2020-07-14 21:13:15 +02:00
kasper b7a09e98e3 Merge branch 'develop' into main 2020-07-14 19:35:31 +02:00
kasper 2251f25fcb Integrating changes made on web server 2020-07-14 19:31:46 +02:00
kasper 9bb73b9ab5 Updated svn:ignore property 2017-12-03 11:24:51 +00:00
kasper 87af90f047 Updated WSGI scripts. 2017-12-03 11:23:41 +00:00
kasper aed22c7567 Updated JavaScript files to use new mapquest api after the old one wasn't supported unexpectedly. 2017-12-03 11:22:37 +00:00
kasper 703834c9da Updated scripts to create events.xml and geolocation.js cache files. 2017-12-03 11:18:55 +00:00
kasper 26d6b0f252 Updated scripts to create events.xml and geolocation.js cache files. 2017-12-03 11:18:07 +00:00
kasper 3b5b07968e Merging changes from life branch. 2015-10-01 15:44:23 +00:00
kasper 23ccbb8d9b Switched Komoot Geolocation url to https 2015-10-01 15:13:56 +00:00
kasper dff6994a2b Switched to Komoot/Photon reverse geolocation service. 2015-10-01 14:37:41 +00:00
kasper 31fb40a220 Changed Nominatim (Reverse Geocoding) service to Komoot Photon. 2015-10-01 11:53:10 +00:00
kasper 1d286c3f50 Adding Komoot tile service. 2015-10-01 11:43:37 +00:00
kasper 70f933d8e2 Merging branches/life with trunk 2015-09-04 13:25:27 +00:00
kasper 2134402e93 Fixed date bug which surfaced in Chromium Browser 2015-09-04 13:13:58 +00:00
kasper 331b529834 Reintegrated changes from branches/life. 2015-04-10 08:56:21 +00:00
kasper b074f0e695 Updating plotting app. 2015-04-10 08:51:58 +00:00
kasper f8a4a0abf2 Updating files of life branch. 2015-04-10 08:47:58 +00:00
kasper 52b55705b8 Adding first English translation. 2015-04-09 11:41:17 +00:00
kasper 5433cb606a Changing time ordering of request after FDSNWS bug fix. 2015-04-07 12:38:27 +00:00
kasper 23ab30907f Branching utils/trunk/python scripts to www/trunk/wsgi to start plotting webapp. 2015-03-10 13:25:41 +00:00
kasper 08ce986f24 Adding wsgi directory for seismogram plotting and other wepapps. 2015-03-10 13:20:23 +00:00
kasper 124efe8f2c Adding more.inc.de for additonal info in the "mehr" tab. 2015-03-10 13:19:15 +00:00
kasper 9669bd5ec8 Updated list of special events. 2015-01-19 10:07:48 +00:00
kasper 3c35af9493 Merge with changes (r790) in trunk. 2014-12-19 08:18:09 +00:00
kasper 22f656a5fe Added Haltern 3.6 (2014-11-15) and Vechta 3.0 (2014-12-19) events. 2014-12-19 08:14:05 +00:00
kasper 8885f666af Get the right city name if town is provided instead of city. 2014-11-25 09:53:29 +00:00
kasper 2892708399 SVN merge with latest changes in trunk. 2014-09-24 09:05:59 +00:00
kasper 61d272ec72 Use relative instead of absolute links. 2014-09-24 09:04:27 +00:00
kasper 87da50a1f4 Removed outdated special events. 2014-09-24 09:04:05 +00:00
kasper a7f19281ff SVN merge r763. 2014-09-23 16:00:18 +00:00
kasper 2843c584a9 Added query string parameter 'tab' to select active tab on loading. 2014-09-23 15:53:05 +00:00
kasper 1a8d59d9cf Merging copyright / licensing information. 2014-09-16 14:55:36 +00:00
kasper c30e7ad781 Updated copyright / licensing information for event / station map. 2014-09-16 14:50:33 +00:00
kasper 20de44f50d Merging revisions 738-739 (Adding Spinner image) and 743 (Workaround fo rmissing console.log). 2014-09-16 12:24:19 +00:00
kasper fdc8b9f65b Removed some debuging output. Added workaround for missing console.log function on some browsers (e. g. Firefox). 2014-09-16 12:16:01 +00:00
kasper c9786126b8 Added print button to web map. 2014-09-16 11:38:06 +00:00
kasper db8703ab7a Added print button to web map. 2014-09-16 11:23:01 +00:00
kasper 3b41bc4dfc Added spinner image while loading data. 2014-09-16 11:16:14 +00:00
kasper fd632f2af6 Added spinner image while loading data. 2014-09-16 11:15:13 +00:00
kasper 1ac4702a75 Added support for event type explosion. 2014-09-16 11:11:51 +00:00
kasper 80045a3f54 Update of permissions, added .htaccess to allow free access to life website. 2014-09-16 09:53:47 +00:00
kasper deea103fdf Merge from trunk. 2014-08-28 15:26:00 +00:00
kasper e24ed63022 Changed start date for event list cache. 2014-08-28 15:19:40 +00:00
kasper 170ee33d07 Comitting changes in info tab. 2014-08-28 15:18:52 +00:00
kasper b82a6d2bff Use cachec events list. 2014-06-25 15:40:14 +00:00
kasper 81204d76c7 Use cachec events list. 2014-06-25 15:35:39 +00:00
kasper 91b1f6f28c Merge. 2014-06-13 15:04:44 +00:00
kasper ad920ee0fc Loading events from chached xml file and performing FDSNWS request for a shorter time only to boost performance. 2014-06-13 15:03:02 +00:00
kasper 9a5c2650e4 Loading events from chached xml file and performing FDSNWS request for a shorter time only to boost performance. 2014-06-13 15:02:38 +00:00
kasper 4c4429f000 Merge. 2014-06-13 13:57:38 +00:00
kasper f83b3aed22 Updated specialevents.js 2014-06-13 13:31:00 +00:00
kasper f07c55d3bf Updated include files for index.html.de 2014-06-06 14:53:08 +00:00
kasper 1aaecbb879 Renamed info.html to info.html.de 2014-06-05 11:56:43 +00:00
kasper 9e9862b3d0 Added impressum to info.html. Cleaned up links and noscript section. 2014-06-04 16:56:19 +00:00
kasper 142ac10dd0 Added info.html for the contents of the info tab. Added SSI directives in index.html.de. Using XBitHack in server config. 2014-06-04 15:40:47 +00:00
kasper c858c586cd Added download attributes to download links. 2014-06-04 15:38:41 +00:00
kasper d1f9b64ab0 Merge 2014-06-03 13:59:42 +00:00
kasper ce43a0a07d Set event tab as default. 2014-06-03 13:56:20 +00:00
kasper 84479f45e1 Added special event for 2014-05-31 Vogtland (Nový Kostel) event. 2014-06-03 13:55:53 +00:00
kasper 80fab7459c Removed link border around RUB logo. This was visible e. g. in Firefox. 2014-06-03 13:54:16 +00:00
kasper 2eca635f6d Added option to read in old lookups. 2014-06-01 13:56:56 +00:00
kasper 25d397fb0e merge. 2014-05-27 11:38:23 +00:00
kasper 9617cc5fa3 Fixed bug: locations where shown as 'undefined' if nominatim lookup times out. 2014-05-27 11:37:07 +00:00
kasper f467b77f48 Added detailed station info. 2014-05-23 16:27:59 +00:00
kasper 6501b3fff7 merge. 2014-05-20 16:21:52 +00:00
kasper 85eb830ef1 Changed svn:ignore property. 2014-05-20 16:16:35 +00:00
kasper 210ea26747 Added some more special events. Which should be included? When should they be removed from the list? 2014-05-20 16:16:11 +00:00
kasper b42911ada5 Updated table caption text. 2014-05-20 16:11:30 +00:00
kasper 264036fe53 Added error handler to AJAX request in stations.js. 2014-05-20 16:10:26 +00:00
kasper 2238086066 Bug fix: really don't show preliminary or automatic results. 2014-05-20 16:09:36 +00:00
kasper 021046ec29 Added eventstable caption with symbol information and download link. Removed type column from table. 2014-05-20 13:46:00 +00:00
kasper 63f9d9d43a Added noscript information. 2014-05-20 12:35:55 +00:00
kasper 78ea7b0397 Added column for type information in eventstable. 2014-05-20 12:27:07 +00:00
kasper 8d8e0c5ff7 Added support for special events. use different markers for EQ, quarry blast or induced events. 2014-05-20 11:08:59 +00:00
kasper 02624a53c8 Merge. 2014-05-20 09:13:14 +00:00
kasper 5bfa403288 Merge. 2014-05-19 20:12:14 +00:00
kasper 873a21f539 Added new funcionality: special events can now be loaded to the table and map, eg. Seeheim-Jugenheim event of May 17th, 2014. 2014-05-19 20:08:38 +00:00
kasper fd135405db Changed svn:ignore property. 2014-05-16 16:33:26 +00:00
kasper 9ea976c762 Added support for detailed station information and download links. Download links and some information are now visible. TODO: add detailed station info. 2014-05-16 16:32:24 +00:00
kasper 5a1b780eaf Added support for detailed station information and download links. Funcionality is still missing. 2014-05-15 15:57:52 +00:00
kasper f374ee0a1c Added parametes to set map centre. Added station size config for all NL stations. 2014-05-15 12:50:56 +00:00
kasper 6b3c421ba8 Merge. 2014-05-15 10:17:06 +00:00
kasper 855826d2bb Added station labels. Resorted index.html.de 2014-05-15 10:15:52 +00:00
kasper a89a1af22c Merge. 2014-05-14 16:13:38 +00:00
kasper fdbade688a Added pagerComplete event to highlight first event of visible table. 2014-05-14 16:13:05 +00:00
kasper fc8133a954 Merge. 2014-05-14 16:04:59 +00:00
kasper ddba2012bb Added link for the SeisObs homepage to the RUB logo. 2014-05-14 16:04:35 +00:00
kasper 1814e81cdb Merge. 2014-05-14 15:44:55 +00:00
kasper 76f269d297 Added plugin "Data Visualisation Framework" for nicer markers. 2014-05-14 15:42:36 +00:00
kasper 8321e19a4a Merge. 2014-05-14 15:35:26 +00:00
kasper e50c816f05 Added plugin "Data Visualisation Framework" for nicer markers. 2014-05-14 15:33:43 +00:00
kasper 11fcdbb305 Merge. 2014-05-14 09:52:23 +00:00
kasper 49b9e492ac Added config for station color. Changed colors of events to blue. 2014-05-14 09:48:04 +00:00
kasper 1c947c98d2 Removed console.log. 2014-05-14 09:40:19 +00:00
kasper 338d54ade4 Merge changes from trunk, except parsing URL get parameters. 2014-05-14 05:30:09 +00:00
kasper 8770857bd7 Changed request_parameters. Endtime will only be used when necessary. Truncated numerical values to 1 or 2 digits after the decimal point. Added orderby parameter.
Shortend construct to determine event location.
2014-05-14 05:24:41 +00:00
kasper acb023cd20 small changes only. 2014-05-14 05:22:21 +00:00
kasper a73450ac92 Added function to parse the URL query string to set config parameters. 2014-05-14 05:21:19 +00:00
kasper 271caf6f20 Fixed HTML code. Should validate now. 2014-05-14 05:20:06 +00:00
kasper c15e401da5 Updating svn:keywords to test setting of permissions. 2014-05-12 16:47:48 +00:00
kasper ad14cf44b3 Updating svn:keywords to test setting of permissions. 2014-05-12 16:43:13 +00:00
kasper 14d988b0b4 Merge. 2014-05-12 16:16:01 +00:00
kasper 3161f1542e Show event details when selecting a marker. Hide when popup closes. TODO: do this without a global variable. 2014-05-12 16:10:29 +00:00
kasper 4ed2af95c0 Adding scale control to map. 2014-05-12 15:54:07 +00:00
kasper 55a6c166b6 Added missing call of getLocation if getGeolocation fails. 2014-05-12 15:46:37 +00:00
kasper 3de24436a0 Updated svn properties. 2014-05-11 19:06:23 +00:00
kasper 43178d916e Merge of branches/life with trunk. 2014-05-11 18:55:45 +00:00
kasper 33ed07b142 Added class to detail and download row of event table to prevent substituting even tent details in both rows. 2014-05-09 09:37:28 +00:00
kasper 2e27ccf170 Added skipped line of previous reversal. 2014-05-09 09:28:11 +00:00
kasper ca182f594e Reverted r622. Detail will, as before, be loaded on request only. 2014-05-09 09:21:33 +00:00
kasper fa0ef11337 Adding download links to event table. 2014-05-09 07:00:03 +00:00
kasper b7ad42c462 Small fixes to comforme to standard in index.html.de 2014-05-08 20:24:27 +00:00
kasper b38fcddad7 Load event details together with the event table. 2014-05-08 11:36:20 +00:00
kasper c1fbfcd2c4 Merge. 2014-05-08 09:12:32 +00:00
kasper 882bd9aa14 Added config value for event marker colors. Added 'quarry blast' to event whitelist. 2014-05-08 09:08:48 +00:00
kasper 2d55865ed3 Mergeing from trunk. 2014-05-07 12:35:55 +00:00
kasper 02de112405 Blacklist rejected events. 2014-05-07 12:30:27 +00:00
kasper 7f3d188f9e Add phase information for event details. TODO: sorting by P-arrival
removed obsolete function addEventRow.
2014-05-07 12:15:52 +00:00
kasper 6f2bfad0e5 New functionality: loading event details. TODO: add phase information 2014-05-06 16:55:31 +00:00
kasper 3f3754a5e4 Creating more config paramters. Removing unused function sleep. 2014-05-06 14:40:32 +00:00
kasper f6f9003908 Merging changes from trunk. 2014-05-06 14:20:10 +00:00
kasper 8886ea4abb Moving configuration parameters to new array config. 2014-05-06 14:18:20 +00:00
kasper 4b6fb951b2 Adding copyright / license information to javascript files.
Reoorganizing code blocks.
2014-05-06 13:14:30 +00:00
kasper d23b9f2a7c Changing some more html tags... 2014-05-06 12:51:27 +00:00
kasper 1736a73973 Forgot 3 files ... 2014-05-06 12:50:02 +00:00
kasper 32d89b91f8 Creating new directory 'external' for external stuff. 2014-05-06 12:45:39 +00:00
kasper 02679c30b0 Merging trunk with branches/life. 2014-05-06 12:34:05 +00:00
kasper 19dc9b75c5 Adding Licensing information, using warnings for warnings, using county if city is not available. 2014-05-06 12:32:24 +00:00
kasper 1285d68eb4 Copy trunk to branches/life for live website. 2014-05-06 11:31:30 +00:00
kasper a38905569c Moving map2014 to trunk. 2014-05-06 11:26:47 +00:00
47 changed files with 3453 additions and 359 deletions

No files matched your search

+31 -15
View File
@@ -1,17 +1,33 @@
* text=auto !eol
www/TileLayer.Grayscale.js -text
www/first.png -text
www/jquery.localtime-0.9.1.min.js -text
www/jquery.tablesorter.min.js -text
www/jquery.tablesorter.pager.css -text
www/jquery.tablesorter.pager.min.js -text
www/jquery.tablesorter.widgets.min.js -text
www/last.png -text
www/leaflet.css -text
www/leaflet.js -text
scripts/mkEvents.csh -text
wsgi/showEnv.py -text
www/.htaccess -text
www/copyright.inc.de -text
www/external/TileLayer.Grayscale.js -text
www/external/css/dvf.css -text
www/external/css/leaflet.label.css -text
www/external/easyPrint.css -text
www/external/first.png -text
www/external/jQuery.print.js -text
www/external/jquery.localtime-0.9.1.min.js -text
www/external/jquery.tablesorter.min.js -text
www/external/jquery.tablesorter.pager.css -text
www/external/jquery.tablesorter.pager.min.js -text
www/external/jquery.tablesorter.widgets.min.js -text
www/external/last.png -text
www/external/leaflet-dvf.markers.min.js -text
www/external/leaflet.css -text
www/external/leaflet.easyPrint.js -text
www/external/leaflet.js -text
www/external/leaflet.label.js -text
www/external/next.png -text
www/external/prev.png -text
www/external/print.png -text
www/external/sprintf.min.js -text
www/external/theme.blue.css -text
www/external/widget-pager.js -text
www/impressum.inc.de -text
www/info.inc.de -text
www/logo_RUB_155x30.png -text
www/next.png -text
www/prev.png -text
www/sprintf.min.js -text
www/theme.blue.css -text
www/widget-pager.js -text
www/more.inc.de -text
www/spinner.gif -text
+9
View File
@@ -1,2 +1,11 @@
scripts/events.xml
scripts/geolocation.js
wsgi/.idea
www/dlsv
www/event.xml
www/events.xml
www/geolocation.js
www/geolocationTable.js
www/stations.xml
.vscode/settings.json
+4
View File
@@ -0,0 +1,4 @@
#!/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"
+127
View File
@@ -0,0 +1,127 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
'''
Script to lookup city names of events with Nominatim service
The input should be an valid quakeML file passed to stdin.
The output will will be a javascript structure to be included in the
SeisObs map service.
The script should be updated regulary keep the total number of all
AJAX calls to the Nominatim service small, e. g. :
curl -s "https://ariadne.geophysik.ruhr-uni-bochum.de/fdsnws/event/1/query?minlat=50&maxlat=54&minlon=3&maxlon=10&minmag=1" | mkGeolocationTable.py > geolocationTable.js
License
Copyright 2020 Kasper D. Fischer <kasper.fischer@rub.de>
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
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/.
$Id$
'''
def mkGeolocationTable(file=''):
# imports
try:
import xml.etree.cElementTree as ET
except ImportError:
import xml.etree.ElementTree as ET
from sys import stdin
import warnings
from time import sleep
from geopy.geocoders import Photon
import urllib2 as URL
import json as JSON
# constants
namespaces = {'sc3': 'http://geofon.gfz-potsdam.de/ns/seiscomp3-schema/0.7',
'qml': 'http://quakeml.org/xmlns/bed/1.2'}
def simple_warning(message, category, filename, lineno, file=None, line=None):
return 'Warning: %s\n' % (message)
warnings.formatwarning = simple_warning
# try loading the file
geolocationTable = {}
if file :
try:
jsonfile = open(file)
jsonfileContent = jsonfile.read().split('=')[1].replace(';', '')
geolocationTable = JSON.loads(jsonfileContent)
except:
geolocationTable = {}
warnings.warn('Could not parse file %s' %file)
# parse event.xml
DOM = ET.parse(stdin).getroot()
geolocator = Photon()
# iterate over all events
for event in DOM.iterfind('qml:eventParameters/qml:event', namespaces):
publicID = event.attrib['publicID'].split('/')[2]
lat = event.find('./qml:origin/qml:latitude/qml:value', namespaces).text
lng = event.find('./qml:origin/qml:longitude/qml:value', namespaces).text
evaluationMode = event.find('./qml:origin/qml:evaluationMode', namespaces).text
if publicID in geolocationTable:
warnings.warn('Skipping cached event %s' %(publicID))
elif evaluationMode == 'automatic':
warnings.warn('Skipping automatic event %s' %(publicID))
else:
try:
location = geolocator.reverse("{lat}, {lng}".format(lat=lat, lng=lng))
except:
warnings.warn('Reverse Geolocation failed. Skipping event.')
sleep(1.1)
continue
place = []
try:
place = location.raw['properties']['city']
except KeyError:
try:
place = location.raw['properties']['town']
except KeyError:
try:
place = location.raw['properties']['village']
except KeyError:
try:
place = location.raw['properties']['county']
except KeyError:
warnings.warn('Could not extract city for event {0} at {1} N / {2} E (URL: {3})'.format(publicID, lat, lng, url))
warnings.warn('Sucessfully looked up location for event {0}.'.format(publicID))
geolocationTable[publicID] = place
sleep(1.1)
# dump json
print 'var geolocationTable = '+JSON.dumps(geolocationTable, sort_keys=True)+';'
# __main__
if __name__ == "__main__":
def printline(line):
print line
# parse arguments
import argparse
versionText = '$Revision$ ($Date$, $Author$)'.replace('$', '').replace(':','')
parser = argparse.ArgumentParser(
description='Reverese geocoding lookup of events in xml format (stdin).',
epilog=versionText)
parser.add_argument('-v', '-V', '--version', action='version',
version=versionText)
parser.add_argument('-f', '--file', action='store', dest='file',
help='read in JSON file containing old output.')
cla = parser.parse_args()
# call mkGeolocationTable(...)
mkGeolocationTable(file=cla.file)
+407
View File
@@ -0,0 +1,407 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Get waveform data from FDSN web service and create a fancy plot
This programme runs as a script or as a WSGI application.
Subversion information:
$Id$
:license
Copyright 2020 Kasper Fischer <kasper.fischer@ruhr-uni-bochum.de>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
"""
def utc2local(utctime, timezone='Europe/Berlin'):
"""
utc2local(utctime, timezone='Europe/Berlin')
converts the UTCDateTime object utctime into a
datetime object of the given timezone
"""
import pytz
utc = pytz.utc
local = pytz.timezone(timezone)
utctime = utc.localize(utctime.datetime)
return local.normalize(utctime.astimezone(local))
def fancy_plot(st, wsgi=False, img_format='png', color=True):
"""
creating fancy plot from ObsPy stream st
returns cStringIO object if wsgi == True
:type st: ObsPy Stream object
:type wsgi: bool
:type img_format: str
:type color: bool
"""
import matplotlib as mpl
from matplotlib.dates import date2num, AutoDateLocator, AutoDateFormatter
if wsgi:
try:
import cStringIO as StringIO
except ImportError:
import StringIO as StringIO
import matplotlib.pyplot as plt
from numpy import arange
# setup figure parameters
if wsgi:
mpl.rcParams['figure.figsize'] = [12.0, 6.75] # 16:9 aspect ratio
else:
mpl.rcParams['figure.figsize'] = [16.0, 9.0] # 16:9 aspect ratio
# get starttime, endtime, localtime and timezone
tr = st[0]
stime = tr.stats.starttime
etime = tr.stats.endtime
localtime = utc2local(stime)
if localtime.tzname() == u'CET':
tzname = u'MEZ'
else:
tzname = u'MESZ'
tz = localtime.timetz().tzinfo
# create proper time vector
d = arange(date2num(stime), date2num(etime), (date2num(etime) - date2num(stime)) / tr.stats.npts)
# setup time axis decorator
locator = AutoDateLocator(interval_multiples=True, minticks=5, maxticks=8, tz=tz)
minor_locator = AutoDateLocator(interval_multiples=True, minticks=9, maxticks=70, tz=tz)
formatter = AutoDateFormatter(locator, tz=tz)
formatter.scaled[1. / (24. * 60.)] = '%H:%M:%S'
formatter.scaled[1. / (24. * 60. * 60. * 10.)] = '%H:%M:%S.%f'
# draw figure
if color:
trace_color = {'Z': 'r', 'N': 'b', 'E': 'g'}
else:
trace_color = {'Z': 'k', 'N': 'k', 'E': 'k'}
fig = plt.figure()
ax1 = fig.add_subplot(311)
ax1.xaxis.set_major_locator(locator)
ax1.xaxis.set_major_formatter(formatter)
ax1.plot_date(d, st.select(component='Z')[0].data * 1000., trace_color['Z'], label=u'Z', tz=tz)
plt.title(u'Station %s' % st[0].stats.station, fontsize=24)
plt.legend(loc='upper right')
ax1.grid(b=True)
ax2 = fig.add_subplot(312, sharex=ax1, sharey=ax1)
ax2.plot_date(d, st.select(component='N')[0].data * 1000., trace_color['N'], label=u'N', tz=tz)
ax2.grid(b=True)
plt.ylabel(u'Geschwindigkeit [mm/s]', fontsize=16)
plt.legend(loc='upper right')
ax3 = fig.add_subplot(313, sharex=ax1, sharey=ax1)
ax3.plot_date(d, st.select(component='E')[0].data * 1000., trace_color['E'], label=u'E', tz=tz)
ax3.grid(b=True)
plt.legend(loc='upper right')
plt.xlabel(u'%s (%s)' % (localtime.strftime('%d.%m.%Y'), tzname), fontsize=16)
ax1.minorticks_on()
ax1.xaxis.set_minor_locator(minor_locator)
if wsgi:
buf = StringIO.StringIO()
plt.savefig(buf, format=img_format, facecolor="lightgray")
return buf
else:
if cla['filename']:
plt.savefig(cla['filename'], dpi=300, transparent=True)
else:
plt.show()
def trace_dayplot(st, deltat = None,
ftype='none', fmin=1.0, fmax=7.0,
col=('b', 'r', 'g'), interval=20, outpattern='',
wsgi=False):
"""
:type st: object
:type ftype: str
:type fmin: float
:type fmax: float
:type col: tuple
:type interval: float
:type outpattern: str
:type wsgi: bool
"""
if wsgi:
try:
import cStringIO as StringIO
except ImportError:
import StringIO as StringIO
# filter
if (ftype == 'bandpass') or (ftype == 'bandstop'):
st.filter(ftype, freqmin=fmin, freqmax=fmax)
elif (ftype == 'lowpass') or (ftype == 'highpass'):
st.filter(ftype, freq=fmin)
st.merge()
stime = st[0].stats.starttime
if deltat:
etime = stime + deltat
else:
etime = st[0].stats.endtime
# plot
for i in range(0, len(st)):
if wsgi:
buf = StringIO.StringIO()
st[i].plot(outfile=buf, format=outpattern, type='dayplot', color=col, interval=interval,
starttime=stime, endtime=etime)
return buf
else:
if outpattern != '':
imagefile = outpattern.format(st[i].stats.network,
st[i].stats.station,
st[i].stats.channel,
st[i].stats.starttime.year,
st[i].stats.starttime.julday)
st[i].plot(type='dayplot', color=col, interval=interval,
outfile=imagefile)
else:
st[i].plot(type='dayplot', color=col, interval=interval)
def get_fdsn(bulk_request, output='VEL', base_url='https://ariadne.geophysik.ruhr-uni-bochum.de'):
"""
Fetches waveform data from FDSN web service and returns
instrument corrected seismogram of type given in parameter output.
Acceptable values for output are "VEL", "DISP" and "ACC" (see ObsPy documentation)
:rtype : object
:param bulk_request: list
:param output: str
:param base_url: str
:return: ObsPy Stream() object
"""
import warnings
from obspy.fdsn import Client
from obspy.fdsn.header import FDSNException
try:
with warnings.catch_warnings():
warnings.simplefilter("ignore")
client = Client(base_url=base_url, debug=False)
st = client.get_waveforms_bulk(bulk_request, attach_response=True)
st.merge()
stime = st[0].stats.starttime
etime = st[0].stats.endtime
for trace in st.traces:
stime = max(stime, trace.stats.starttime)
etime = min(etime, trace.stats.endtime)
st.trim(starttime=stime, endtime=etime)
# choose 1 s taper
taper_fraction = 1 / (etime - stime)
for trace in st.traces:
# filter, remove response
trace.filter('bandpass', freqmin=0.01, freqmax=25, corners=3, zerophase=False). \
remove_response(output=output, zero_mean=True, taper=True, taper_fraction=taper_fraction)
return st
except FDSNException:
return None
def main(backend=None, args=None, wsgi=False):
"""
Main function to create a waveform plot.
This functions calls get_fdsn and fancy_plot to create the figure.
If wsgi == True it returns an ioString object containing the figure.
:type backend: str
:type args: dict
:type wsgi: bool
:rtype : object
:param backend:
:param args:
:param wsgi:
:return: ioString object with created image
"""
import warnings
import matplotlib as mpl
if wsgi:
backend = 'Agg'
if backend:
with warnings.catch_warnings():
warnings.simplefilter("ignore")
mpl.use(backend)
from obspy import UTCDateTime
if args:
deltat = args['length']
if args['stime']:
otime = UTCDateTime(args['stime'])
else:
otime = UTCDateTime() - 3600. - deltat
network = args['station'].split('.')[0]
station = args['station'].split('.')[1]
if args['type'] == 'dayplot':
if network == 'Z3':
channel = 'HHZ'
else:
channel = 'BHZ'
else:
if args['length'] < 3600.:
channel = 'HH?'
else:
if network == 'Z3':
channel = 'HH?'
else:
channel = 'BH?'
else:
otime = UTCDateTime() - 3600.
deltat = 30
network = 'GR'
station = 'BUG'
channel = 'HH?'
st = get_fdsn([(network, station, '*', channel, otime, otime + deltat)], base_url=args['server'])
if st is not None:
stime = max(st[0].stats.starttime, otime)
etime = min(st[0].stats.endtime, otime + deltat)
st.trim(starttime=stime, endtime=etime)
if wsgi:
if args['type'] == 'dayplot':
with warnings.catch_warnings():
warnings.simplefilter("ignore")
return trace_dayplot(st, outpattern=args['format'], wsgi=wsgi, deltat=deltat)
else:
return fancy_plot(st, wsgi=wsgi, img_format=args['format'], color=args['color'])
else:
if args['type'] == 'dayplot':
with warnings.catch_warnings():
warnings.simplefilter("ignore")
trace_dayplot(st, wsgi=wsgi)
else:
fancy_plot(st, color=args['color'])
elif not wsgi:
warnings.warn('No data available!')
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
"""
import os
from cgi import FieldStorage
# set HOME environment variable to a directory the httpd server can write to
# otherwise matplotlib won't work
os.environ['HOME'] = '/tmp/wsgi-kasper'
try:
os.mkdir('/tmp/wsgi-kasper')
except OSError:
pass
# fake command line arguments
# setting needed default values
wsgi_args = {'server': 'http://localhost/'}
# fill wsgi_args with environment variables
form = FieldStorage(fp=environ['wsgi.input'], environ=environ)
wsgi_args['station'] = form.getfirst('station', 'GR.BUG').upper()
wsgi_args['stime'] = form.getfirst('start_time', [])
wsgi_args['length'] = form.getfirst('length', '30')
wsgi_args['length'] = abs(int(wsgi_args['length']))
wsgi_args['format'] = form.getfirst('format', 'png').lower()
if wsgi_args['format'] != 'png' and wsgi_args['format'] != 'svg':
wsgi_args['format'] = 'png'
wsgi_args['color'] = form.getfirst('color', 'TRUE').upper()
if wsgi_args['color'] == 'FALSE':
wsgi_args['color'] = False
else:
wsgi_args['color'] = True
wsgi_args['type'] = form.getfirst('type', '').lower()
if (wsgi_args['type'] != 'dayplot' and wsgi_args['type'] != 'normal') or wsgi_args['type'] == '':
if wsgi_args['length'] < 43200:
wsgi_args['type'] = 'normal'
else:
wsgi_args['type'] = 'dayplot'
# process the request
buf = main(args=wsgi_args, backend='Agg', wsgi=True)
if buf is not None:
data = buf.getvalue()
buf.close()
data_length = len(data)
if wsgi_args['format'] == 'svg':
wsgi_args['format'] = 'svg+xml'
start_response('200 OK', [('Content-Type', 'image/%s' % wsgi_args['format']), ('Content-Length', '%d' % data_length)])
return [data]
else:
start_response('400 Bad Request', [])
return []
# __main__
if __name__ == "__main__":
import os
import argparse
parser = argparse.ArgumentParser(
description=u'Get event waveform data of all RuhrNet stations.',
epilog=u'$Revision$ ($Date$, $Author$)'.replace(
"$", ""))
parser.add_argument(u'-v', u'-V', u'--version', action='version',
version=u'$Revision$ ($Date$, \
$Author$)'.replace('$', ''))
parser.add_argument(u'-u', u'--url', action='store', dest='server',
default=u'https://ariadne.geophysik.ruhr-uni-bochum.de',
help=u'Base URL of the FDSN web service (https://ariadne.geophysik.ruhr-uni-bochum.de).')
parser.add_argument(u'-t', u'--type', action='store', dest='type', metavar='TYPE',
help=u'Type of plot: normal or dayplot.')
parser.add_argument(u'-f', u'--file', action='store', dest='filename', metavar='FILENAME',
help=u'Save plot to file FILENAME')
parser.add_argument(u'-c', u'--color', action='store_true', help=u'Create color plot.')
parser.add_argument(u'-l', u'--length', action='store', type=int, default=30,
help=u'Length of waveform window in seconds (30 s).')
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument(u'-s', u'--start_time', dest='stime', action='store', metavar='START',
help=u'Start time of waveform window.')
group.add_argument(u'-e', u'--event', action='store', metavar='EVENTID',
help=u'Get starttime from event P-phase onset at station.')
parser.add_argument(u'station', action='store', metavar='NET.STATION',
help=u'Station to plot.')
cla = vars(parser.parse_args())
if os.getenv('DISPLAY'):
main(args=cla)
else:
main('Agg', cla)
+17
View File
@@ -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]
+117
View File
@@ -0,0 +1,117 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Produce a dayplot from seismogram recordings
Subversion information:
$Id$
license: gpl3
Copyright 2012-2020 Seismological Observatory, Ruhr-University Bochum
http://www.gmg.ruhr-uni-bochum.de/geophysik/seisobs
Contributors:
Martina Rische <martina.rische@rub.de>
Kasper D. Fischer <kasper.fischer@rub.de>
Sebastian Wehling-Benatelli <sebastian.wehling@rub.de>
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
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/.
"""
def trace_dayplot(st, ftype='bandpass', fmin=1.0, fmax=7.0,
col=('b', 'r', 'g'), interval=20.0, outpattern=''):
"""
:type st: object
:type ftype: str
:type fmin: float
:type fmax: float
:type col: tuple
:type interval: float
:type outpattern: str
"""
# filter
if (ftype == 'bandpass') or (ftype == 'bandstop'):
st.filter(ftype, freqmin=fmin, freqmax=fmax)
elif (ftype == 'lowpass') or (ftype == 'highpass'):
st.filter(ftype, freq=fmin)
st.merge()
# plot
for i in range(0, len(st)):
if outpattern != '':
imagefile = outpattern.format(st[i].stats.network,
st[i].stats.station,
st[i].stats.channel,
st[i].stats.starttime.year,
st[i].stats.starttime.julday)
st[i].plot(type='dayplot', color=col, interval=interval,
outfile=imagefile)
else:
st[i].plot(type='dayplot', color=col, interval=interval)
# __main__
if __name__ == "__main__":
# parse arguments
import argparse
from obspy.core import read
parser = argparse.ArgumentParser(
description='Produce filtered 24h-plot (dayplot).',
epilog='$Rev: 403 $ ($Date: 2012-04-13 12:16:22 +0200 (Fri, 13 Apr 2012) $, $Author: kasper $)')
parser.add_argument('-v', '-V', '--version', action='version',
version='$Rev: 403 $ ($Date: 2012-04-13 12:16:22 +0200 (Fri, 13 Apr 2012) $, $Author: kasper $)')
parser.add_argument('file', action='store', metavar='FILE', nargs='+',
help='File(s) to use for the dayplot. One dayplot will be used for every file. \
Use wildcards to use multiple file for one plot')
parser.add_argument('-f', '--filter', action='store', dest='ftype',
default='bandpass',
choices=['none', 'bandpass', 'bandstop', 'lowpass', 'highpass'],
help='Select filtertype to filter the data (default: bandpass)\
Note: For low- and highpass only fmin is used.')
parser.add_argument('--fmin', action='store', type=float, dest='fmin',
default=1.0,
help='Lower frequency of the filter in Hz (default: 1.0)')
parser.add_argument('--fmax', action='store', type=float, dest='fmax',
default=7.0,
help='Upper frequency of the filter in Hz (default: 7.0)')
parser.add_argument('-c', '--color', '--colour', action='store', dest='color',
default=('b', 'r', 'g'),
help='Color selection to use in the dayplot (default: brg)')
parser.add_argument('-i', '--interval', action='store', type=int, dest='interval',
default=20,
help='Interval length to show in each line of the dayplot in minutes (default: 20)')
parser.add_argument('-o', '--output', action='store', dest='outpattern',
default='',
help="Output filename pattern for the plot. (default: unset, show plot on screen only), \
Use {0} to substitute network code, \
{1} to substitute station code, \
{2} to substitute station channel, \
{3} to substitute year, \
{4} to substitute doy number \
.format (supported formats: emf, eps, pdf, png, ps, raw, rgba, svg, svgz)")
cla = parser.parse_args()
if cla.fmin < 0:
cla.fmin = -cla.fmin
if cla.fmax < 0:
cla.fmax = -cla.fmax
# call trace_dayplot(...) for each file
for datafile in cla.file:
trace_dayplot(read(datafile), cla.ftype, cla.fmin, cla.fmax, cla.color,
cla.interval, cla.outpattern)
+7
View File
@@ -0,0 +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"
+54
View File
@@ -0,0 +1,54 @@
<div class="accordioncontent">
<p >Das Urheberrecht der verwendeten Daten, Kartengrundlagen und
JavaScript Dateien liegt bei dem jeweiligen Urheber. Die
Benutzung unterliegt verschiedenen Lizenzen. Eine normale
Nutzung zur Darstellung im Internet ist dabei bei den benutzten
Quellen frei mögliche. Eine darüber hinaus gehende Nutzung (z.
B. drucken, speichern, Weiterverwendung in anderen Publikationen
etc.) ist nur unter <b>Beachtung der verschiedenen Lizenzen</b>
möglich. Diese sind im folgenden zusammengefasst.</p>
<h4>Kartengrundlage und Nominatim Dienst</h4>
<p>Die Kartengrundlagen und der Nominatim Dienst (reverse
Geocodierung) basieren auf Daten des <a
href="//www.openstreetmap.org" target="_blank">OpenStreetMap</a>
Projektes und wurden durch <a href="//www.mapquest.com/"
target="_blank">MapQuest</a> <img alt="Mapquest Logo"
src="//developer.mapquest.com/content/osm/mq_logo.png" /> zur
Verfügung gestellt. Hierfür gelten die „<a
href="//developer.mapquest.com/web/info/terms-of-use"
target="_blank">Terms of use</a>“ des Anbieters. Diese gestatten
eine nicht-kommerzielle, öffentlich zugängliche Nutzung.</p>
<h4>Ereignisdaten und Stationsdaten</h4>
<p>Die dargestellten Daten der seismischen Ereignisse und der
seismischen Stationen unterliegen der „<a
href="http://opendatacommons.org/licenses/odbl/summary"
target="_blank">Open Data Commons Open Database Lizenz</a>“
(ODbL). Die Daten dürfen frei kopieren, weitergegeben,
übermittel sowie angepasst werden, sofern das <a
href="http://www.gmg.ruhr-uni-bochum.de"
target="_blamk">Seismologische Observatorium der
Ruhr-Universität</a> als Quelle genannt wird. Werden diese Daten
wiederverwendet, so unterliegen sie weiterhin dieser Lizenz. Der
vollständige <a
href="http://opendatacommons.org/licenses/odbl/1.0/"
target="_blank">Lizenztext</a> erläutert die Rechte und
Pflichten dieser Lizenz.</p>
<h4>JavaScript Dateien</h4>
<p>Diese Webseite benutzt verschiedene JavaScript Bibliotheken,
die unterschiedlichen Lizenzen unterliegen. Die jeweiligen
Lizenzen werden in der Regel im Quellcode der benutzten
Bibliotheken aufgeführt.</p>
<h4>Sonstiger Inhalt</h4>
<p>Sonstiger Inhalt dieser Webseite unterliegt der
„Creative-Commons''-Lizenz „<a
href="https://creativecommons.org/licenses/by-sa/4.0/deed.de"
target="_blank">Namensnennung – Weitergabe unter gleichen
Bedingungen</a>“ 4.0 (CC BY-SA). Der vollständige <a
href="https://creativecommons.org/licenses/by-sa/4.0/legalcode"
target="_blank">Lizenztext</a> erläutert die Rechte und
Pflichten dieser Lizenz.</p>
</div>
+323 -121
View File
@@ -1,22 +1,62 @@
/**********************************************************************
* events.js *
* script for event specific functions and setup *
**********************************************************************/
/* License
Copyright 2020 Kasper D. Fischer <kasper.fischer@rub.de>
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
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/.
$Id$
*/
/* adding row(s) to a table and format date strings afterwards */
function addTableRow(row, table) {
var added = $('#'+table+' tbody').append(row);
added.find('.tablesorter-childRow td').hide();
$('#'+table).find('td.utctime-date').each(function() {
$.localtime.formatObject($(this), "dd.MM.yyyy");
$(this).removeClass('utctime-date');
$(this).addClass('localtime-date');
});
$('#'+table).find('td.utctime-time').each(function() {
$.localtime.formatObject($(this), "HH:mm");
$(this).removeClass('utctime-time');
$(this).addClass('localtime-time');
});
};
/* do reverse geolocation lookup */
function getGeolocation(id, lat, lng) {
if ( !geolocationTable[id] ) {
// $.getJSON( "//nominatim.openstreetmap.org/reverse", { lat: lat, lon: lng, zoom: 10, format: "json" } )
$.getJSON( "//open.mapquestapi.com/nominatim/v1/reverse.php", { lat: lat, lon: lng, zoom: 10, format: "json" } )
if ( $.inArray(id, geolocationTable) == -1 ) {
$.getJSON( config['ajax']['nominatimURL'], { lat: lat, lon: lng } )
.done(function( json ) {
var city = json.address["city"];
var country = json.address["country"];
var countryCode = json.address["country_code"].toUpperCase();
geolocationTable[id] = city;
( country != "Deutschland" ) ? 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 ) {
@@ -27,34 +67,44 @@ function getGeolocation(id, lat, lng) {
};
/* Load events using ajax */
function ajaxLoadEvents(stime, etime) {
function ajaxLoadEvents(stime, etime, eventid, url, target) {
var mapBounds = map.getBounds();
var N = mapBounds.getNorth();
var E = mapBounds.getEast();
var S = mapBounds.getSouth();
var W = mapBounds.getWest();
var d = 0.1;
if ( !stime ) {
var stime = new Date();
stime.setDate(stime.getDate()-180);
var request_data = {};
var rtime;
var ajax_url = config['ajax']['eventURL'];
if ( stime == '' || !stime ) {
stime = new Date();
stime.setDate(stime.getDate()-config['map']['timespan']);
rtime = new Date();
rtime.setDate(rtime.getDate()-Math.min(config['ajax']['timespan'], config['map']['timespan']));
} else {
rtime = stime;
};
if ( !etime ) {
var etime = new Date();
etime.setDate(etime.getDate()+1);
};
var url = "https://ariadne.geophysik.ruhr-uni-bochum.de/fdsnws/event/1/query"
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-d,
maxlat: N+d,
minlon: W-d,
maxlon: E+d,
minmag: minMag-0.1,
if ( url ) {
var ajax_url = url;
request_data = {};
} else {
if ( eventid ) {
request_data = { eventid: eventid };
} else {
request_data = {
starttime: sprintf("%d-%02d-%02d", rtime.getFullYear(), rtime.getMonth()+1, rtime.getDate()),
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']),
maxlon: sprintf('%.2f', mapBounds.getEast()+config['map']['latlngDelta']),
minmag: sprintf('%.1f', config['event']['minMag']-config['event']['minMagDelta']),
};
if ( etime ) {
request_data['endtime'] = sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate());
};
};
};
if ( etime == '' || !etime ) { etime = new Date(); };
$.ajax({
type: "GET",
url: url,
url: ajax_url,
data: request_data,
dataType: "xml",
success: function (xml) {
@@ -64,53 +114,146 @@ function ajaxLoadEvents(stime, etime) {
var otime = $(this).find('origin > time > value').text();
var lng = $(this).find('origin > longitude > value').text();
var lat = $(this).find('origin > latitude > value').text();
var mag = $(this).find('magnitude > mag > value').text();
var evaluationMode = $(this).find('evaluationMode').text();
var evaluationStatus = $(this).find('evaluationStatus').text();
var depth = $(this).find('origin > depth > value').text();
var evaluationMode = $(this).find('origin > evaluationMode').text();
var evaluationStatus = $(this).find('origin > evaluationStatus').text();
var type = $(this).find('type').last().text();
var location = getLocation(Number(lat), Number(lng))[0];
( location ) ? null : location = $(this).find('description > text').text();
var location
// create table row: Date, Time, Mag, Location
if ( !eventTable[id] && ( type == 'earthquake' || type == 'induced or triggered event' || type == 'outside of network interest') && evaluationMode != 'automatic' && evaluationStatus != 'preliminary' && Number(mag)+0.05 >= 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)
var row = '<tr class="tablesorter-hasChildRow">'
+ '<td class="utctime-date">'+otime.split('.')[0]+'Z</td>'
+ '<td class="utctime-time">'+otime.split('.')[0]+'Z</td>'
+ sprintf('<td class="ar">%.1f</td>', Number(mag))
+ '<td><a href="#" class="toggle" eventid="'+id+'">'+location+'</a><a class="map-link" href="#" eventid="'+id+'">Karte</a></td>'
+ '<td><a href="#" class="toggle" eventid="'+id+'">'+location+'</a> <a class="map-link" href="#" eventid="'+id+'">Karte</a></td>'
+ '</tr>';
row += '<tr class="tablesorter-childRow">'
+ '<td colspan="4" eventid="'+id+'">not implemented</td></tr>';
var added = $('#eventstable tbody').append(row);
added.find('.tablesorter-childRow td').hide();
$('#eventstable').find('td.utctime-date').each(function() {
$.localtime.formatObject($(this), "dd.MM.yyyy");
$(this).removeClass('utctime-date');
$(this).addClass('localtime-date');
});
$('#eventstable').find('td.utctime-time').each(function() {
$.localtime.formatObject($(this), "HH:mm");
$(this).removeClass('utctime-time');
$(this).addClass('localtime-time');
});
// setting up event details (2nd line)
row += '<tr class="tablesorter-childRow event-details">'
+ '<td colspan="4" eventid="'+id+'">Daten werden geladen ...</td></tr>';
// 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()));
row += '<tr class="tablesorter-childRow event-download">'
+ '<td colspan="4" eventid="'+id+'">'
+ sprintf('Download <a class="xml-link" target="_blank" download="%s.xml" href="%s">QuakeML</a> or <a class="mseed-link" target="_blank" download="%s.mseed" href="%s">miniSEED</a>', id, xmlurl, id, mseedurl)
+ '</td></tr>';
// add row to table
if ( stime <= oTime && etime >= oTime ) {
addTableRow(row, 'eventstable');
};
if ( target ) {
addTableRow(row, target);
}
// create marker
var marker = addEventMarker(id, Number(lat), Number(lng), Number(mag));
var text = sprintf('<h3 eventid="%s">%s</h3>', id, location)
+ sprintf('<p>Ereignis: %s</br>', id)
+ sprintf('Ort: %.4f °N, %.4f °O </br>', Number(lat), Number(lng))
+ sprintf('Zeit: <span class="utctime">%sZ</span></p>', otime.split('.')[0], otime.split('.')[0]);
marker.bindPopup(text);
// try to get better location with reverse geolocation lookup (nominatim)
getGeolocation(id, lat, lng);
if ((stime <= oTime && etime >= oTime ) || ( id == eventid )) {
var marker = addEventMarker(id, Number(lat), Number(lng), Number(mag), type);
var text = sprintf('<h3 eventid="%s">%s</h3>', id, location)
+ sprintf('<p>Ereignis: %s<br />', id)
+ sprintf('Type: %s<br />', type)
+ sprintf('Magnitude: %3.1f<br />', Number(mag))
+ sprintf('Ort: %.4f °N, %.4f °O <br />', Number(lat), Number(lng))
+ sprintf('Tiefe: %.1f km<br />', Number(depth)/1000.)
+ sprintf('Zeit: <span class="utctime">%sZ</span></p>', otime.split('.')[0], otime.split('.')[0]);
marker.bindPopup(text);
};
};
});
},
complete: function () {
initStationTable();
var sort = [[0,1],[1,1],[2,1]];
$("#eventstable").trigger("update", [true]);
$("#eventstable").trigger("updateCache");
$("#eventstable").trigger("sorton", [sort]);
initMapLink();
eventLayer.bringToBack();
highlightFirstEvent();
},
error: function( jqxhr, textStatus, error ) {
var err = textStatus + ", " + error;
console.log( "Request Failed: " + err );
}
});
// create events csv download link
request_data['format'] = 'text';
if ( eventid == '' || !eventid ) { $('#events-csv-link').attr('href', config['ajax']['eventURL']+'?'+$.param(request_data)) };
};
/* 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 = "<pre>"
+ 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 + '</pre>';
$('#eventstable > tbody > tr.event-details > td[eventid='+id+']').html(row);
});
},
complete: function () {
null;
},
error: function( jqxhr, textStatus, error ) {
var err = textStatus + ", " + error;
@@ -119,54 +262,84 @@ function ajaxLoadEvents(stime, etime) {
});
};
// add row to table
function addEventRow(id, props) {
$('#eventstable').tablesorter({
sortList: "[[0,0], [1,1]], [2,1]",
resort: true,
showProcessing: true,
pager_size: 35
/* toggles visibility of filtered markers
* only events in the event list are shown */
function toggleFilteredMarkers() {
// show all shown events in map
$("#eventstable > tbody > tr:not(.filtered) > td > a.map-link").each( function() {
if ( $(this).attr("eventid") ) {
map.addLayer(eventTable[$(this).attr("eventid")]);
};
});
var html = '<tr class="tablesorter-hasChildRow">'
+ '<td class="utctime-date">'+props.date+'T'+props.time.split('.')[0]+'Z</td>'
+ '<td class="utctime-time">'+props.date+'T'+props.time.split('.')[0]+'Z</td>'
+ '<td class="ar">'+props.mag+'</td>'
+ '<td><a href="#" class="toggle">'+props.location+'</a><a class="map-link" href="#" eventid="'+id+'">Karte</a></td>'
+ '</tr>'
+ '<tr class="tablesorter-childRow">'
+ '<td colspan="4" eventid="'+id+'">'
+ "<pre>ID "+id+"\n\n"
+ "Origin\n"
+ "Date "+props.date+"\n"
+ "Time "+props.time+"\n"
+ "Latitude "+props.lat+" deg +/- "+props.lat_err+" km\n"
+ "Longitude "+props.lon+" deg +/- "+props.lon_err+" km\n"
+ "Depth "+props.depth+" km +/- "+props.depth_err+" km\n"
+ "Residual RMS "+props.rms+" s\n"
+ "Azimuthal gap "+props.gap+" deg\n\n"
+ props.no_phases + " Phase arrivals:\n"
+ "sta net dist azi phase time res wt sta\n";
for ( i = 0 ; i < props.no_phases ; i++ ) {
html += props.phases[i];
( i < props.no_phases -1 ) ? html += "\n" : null ;
};
html += "</pre></td></tr>\n";
var added = $('#eventstable tbody').append(html);
added.find('.tablesorter-childRow td').hide();
$('#eventstable').find('td.utctime-date').each(function() {
$.localtime.formatObject($(this), "dd. MM. yyyy");
$(this).removeClass('utctime-date');
$(this).addClass('localtime-date');
// hide filtered events in map
$("#eventstable > tbody > tr.filtered > td > a.map-link").each( function() {
if ( $(this).attr("eventid") ) {
map.removeLayer(eventTable[$(this).attr("eventid")]);
};
});
$('#eventstable').find('td.utctime-time').each(function() {
$.localtime.formatObject($(this), "HH:mm");
$(this).removeClass('utctime-time');
$(this).addClass('localtime-time');
});
// force resorting
$("#eventstable").trigger("update", [true]);
highlightFirstEvent();
};
/* Highlight the first event of the event list on the map if no
* other event is selected */
function highlightFirstEvent() {
var highlightStyle = {
color: config['event']['markerColorH'],
fillColor: config['event']['markerColorH'],
fillOpacity: 1,
};
var normalStyle = {
fillColor: config['event']['markerColor'],
color: config['event']['markerColor'],
fillOpacity: config['event']['markerOpacity'],
};
$("#eventstable a.map-link").each( function() {
if ( $(this).attr("eventid") ) {
eventTable[$(this).attr("eventid")].setStyle(normalStyle);
$(this).removeClass('first');
$(this).text('Karte');
};
});
$("#eventstable > tbody > tr:not(.filtered):visible").first().find("a.map-link").each(function() {
if ( $(this).attr("eventid") ) {
eventTable[$(this).attr("eventid")].setStyle(highlightStyle);
eventTable[$(this).attr("eventid")].bringToFront();
$(this).addClass('first');
$(this).text('Karte (rot)');
};
});
};
function highlightEvent( id ) {
var highlightStyle = {
color: config['event']['markerColorH'],
fillColor: config['event']['markerColorH'],
fillOpacity: 1,
};
var normalStyle = {
fillColor: config['event']['markerColor'],
color: config['event']['markerColor'],
fillOpacity: config['event']['markerOpacity'],
};
$("#eventstable > tbody > tr:not(.filtered)").find("a.map-link").each( function() {
if ( $(this).attr("eventid") ) {
if ( $(this).attr("eventid") == id ) {
eventTable[$(this).attr("eventid")].setStyle(highlightStyle);
eventTable[$(this).attr("eventid")].bringToFront();
$(this).addClass('first');
$(this).text('Karte (rot)');
} else {
eventTable[$(this).attr("eventid")].setStyle(normalStyle);
$(this).removeClass('first');
$(this).text('Karte');
}
};
});
};
/**********************************************************************
* document ready *
**********************************************************************/
$(document).ready(function() {
// tablesorter for event list
$("#eventstable").tablesorter(
@@ -195,31 +368,33 @@ $(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();
});
$('#eventstable').bind('pagerComplete', function(){
highlightFirstEvent();
});
// 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
// hide other rows
$(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').addClass('selected-now');
$(this).closest('tbody').find('td.selected').each(function(){
if ( ! $(this).hasClass('selected-now') ) {
$(this).hide('slow');
$(this).hide();
$(this).removeClass('selected');
};
});
@@ -228,12 +403,39 @@ $(document).ready(function() {
var selected = $(this).hasClass('selected');
if ( selected ) {
$(this).removeClass('selected');
highlightFirstEvent();
} else {
$(this).addClass('selected');
highlightEvent($(this).attr('eventid'));
};
});
return false;
});
// update selection / type info
$("#events-timespan").text(config['map']['timespan']);
$("#events-minmag").text(sprintf('%.1f', config['event']['minMag']));
config['event']['typeWhitelist'].map(function(type) {
var typetext;
( $("#events-type").text() == "Symbole:" ) ? typetext = ' ' : typetext = ', ';
switch ( type ) {
case 'earthquake':
typetext += 'tektonisches Erdbeben&nbsp;(Stern)';
break;
case 'explosion':
typetext += 'Explosion&nbsp;(Sechseck)';
break;
case 'induced or triggered event':
typetext += '(bergbau-)induziertes Ereignis&nbsp;(Kreis)';
break;
case 'quarry blast':
case 'controlled explosion':
case 'explosion':
typetext += 'Sprengung&nbsp;(Rad)';
break;
case 'nuclear explosion':
typetext += 'Atomwaffentest&nbsp;(Viereck)';
break;
};
$("#events-type").append(typetext);
});
});
+441
View File
@@ -0,0 +1,441 @@
/**********************************************************************
* events.js *
* script for event specific functions and setup *
**********************************************************************/
/* License
Copyright 2020 Kasper D. Fischer <kasper.fischer@rub.de>
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
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/.
$Id$
*/
/* adding row(s) to a table and format date strings afterwards */
function addTableRow(row, table) {
var added = $('#'+table+' tbody').append(row);
added.find('.tablesorter-childRow td').hide();
$('#'+table).find('td.utctime-date').each(function() {
$.localtime.formatObject($(this), "dd.MM.yyyy");
$(this).removeClass('utctime-date');
$(this).addClass('localtime-date');
});
$('#'+table).find('td.utctime-time').each(function() {
$.localtime.formatObject($(this), "HH:mm");
$(this).removeClass('utctime-time');
$(this).addClass('localtime-time');
});
};
/* do reverse geolocation lookup */
function getGeolocation(id, lat, lng) {
if ( $.inArray(id, geolocationTable) == -1 ) {
$.getJSON( config['ajax']['nominatimURL'], { lat: lat, lon: lng } )
.done(function( json ) {
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 ) {
var err = textStatus + ", " + error;
console.log( "Request Failed: " + err );
});
};
};
/* Load events using ajax */
function ajaxLoadEvents(stime, etime, eventid, url, target) {
var mapBounds = map.getBounds();
var request_data = {};
var rtime;
var ajax_url = config['ajax']['eventURL'];
if ( stime == '' || !stime ) {
stime = new Date();
stime.setDate(stime.getDate()-config['map']['timespan']);
rtime = new Date();
rtime.setDate(rtime.getDate()-Math.min(config['ajax']['timespan'], config['map']['timespan']));
} else {
rtime = stime;
};
if ( url ) {
var ajax_url = url;
request_data = {};
} else {
if ( eventid ) {
request_data = { eventid: eventid };
} else {
request_data = {
starttime: sprintf("%d-%02d-%02d", rtime.getFullYear(), rtime.getMonth()+1, rtime.getDate()),
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']),
maxlon: sprintf('%.2f', mapBounds.getEast()+config['map']['latlngDelta']),
minmag: sprintf('%.1f', config['event']['minMag']-config['event']['minMagDelta']),
};
if ( etime ) {
request_data['endtime'] = sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate());
};
};
};
if ( etime == '' || !etime ) { etime = new Date(); };
$.ajax({
type: "GET",
url: ajax_url,
data: request_data,
dataType: "xml",
success: function (xml) {
$(xml).find('event').each(function () {
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 lat = $(this).find('origin > latitude > value').text();
var depth = $(this).find('origin > depth > value').text();
var evaluationMode = $(this).find('origin > evaluationMode').text();
var evaluationStatus = $(this).find('origin > evaluationStatus').text();
var type = $(this).find('type').last().text();
var location
// 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)
var row = '<tr class="tablesorter-hasChildRow">'
+ '<td class="utctime-date">'+otime.split('.')[0]+'Z</td>'
+ '<td class="utctime-time">'+otime.split('.')[0]+'Z</td>'
+ sprintf('<td class="ar">%.1f</td>', Number(mag))
+ '<td><a href="#" class="toggle" eventid="'+id+'">'+location+'</a> <a class="map-link" href="#" eventid="'+id+'">map</a></td>'
+ '</tr>';
// setting up event details (2nd line)
row += '<tr class="tablesorter-childRow event-details">'
+ '<td colspan="4" eventid="'+id+'">Daten werden geladen ...</td></tr>';
// 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()));
row += '<tr class="tablesorter-childRow event-download">'
+ '<td colspan="4" eventid="'+id+'">'
+ sprintf('Download <a class="xml-link" target="_blank" download="%s.xml" href="%s">QuakeML</a> or <a class="mseed-link" target="_blank" download="%s.mseed" href="%s">miniSEED</a>', id, xmlurl, id, mseedurl)
+ '</td></tr>';
// add row to table
if ( stime <= oTime && etime >= oTime ) {
addTableRow(row, 'eventstable');
};
if ( target ) {
addTableRow(row, target);
}
// create marker
if ((stime <= oTime && etime >= oTime ) || ( id == eventid )) {
var marker = addEventMarker(id, Number(lat), Number(lng), Number(mag), type);
var text = sprintf('<h3 eventid="%s">%s</h3>', id, location)
+ sprintf('<p>Ereignis: %s<br />', id)
+ sprintf('Type: %s<br />', type)
+ sprintf('Magnitude: %3.1f<br />', Number(mag))
+ sprintf('Ort: %.4f °N, %.4f °O <br />', Number(lat), Number(lng))
+ sprintf('Tiefe: %.1f km<br />', Number(depth)/1000.)
+ sprintf('Zeit: <span class="utctime">%sZ</span></p>', otime.split('.')[0], otime.split('.')[0]);
marker.bindPopup(text);
};
};
});
},
complete: function () {
var sort = [[0,1],[1,1],[2,1]];
$("#eventstable").trigger("update", [true]);
$("#eventstable").trigger("updateCache");
$("#eventstable").trigger("sorton", [sort]);
initMapLink();
eventLayer.bringToBack();
highlightFirstEvent();
},
error: function( jqxhr, textStatus, error ) {
var err = textStatus + ", " + error;
console.log( "Request Failed: " + err );
}
});
// create events csv download link
request_data['format'] = 'text';
if ( eventid == '' || !eventid ) { $('#events-csv-link').attr('href', config['ajax']['eventURL']+'?'+$.param(request_data)) };
};
/* 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 = "<pre>"
+ 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 + '</pre>';
$('#eventstable > tbody > tr.event-details > 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() {
// show all shown events in map
$("#eventstable > tbody > tr:not(.filtered) > td > a.map-link").each( function() {
if ( $(this).attr("eventid") ) {
map.addLayer(eventTable[$(this).attr("eventid")]);
};
});
// hide filtered events in map
$("#eventstable > tbody > tr.filtered > td > a.map-link").each( function() {
if ( $(this).attr("eventid") ) {
map.removeLayer(eventTable[$(this).attr("eventid")]);
};
});
highlightFirstEvent();
};
/* Highlight the first event of the event list on the map if no
* other event is selected */
function highlightFirstEvent() {
var highlightStyle = {
color: config['event']['markerColorH'],
fillColor: config['event']['markerColorH'],
fillOpacity: 1,
};
var normalStyle = {
fillColor: config['event']['markerColor'],
color: config['event']['markerColor'],
fillOpacity: config['event']['markerOpacity'],
};
$("#eventstable a.map-link").each( function() {
if ( $(this).attr("eventid") ) {
eventTable[$(this).attr("eventid")].setStyle(normalStyle);
$(this).removeClass('first');
$(this).text('map');
};
});
$("#eventstable > tbody > tr:not(.filtered):visible").first().find("a.map-link").each(function() {
if ( $(this).attr("eventid") ) {
eventTable[$(this).attr("eventid")].setStyle(highlightStyle);
eventTable[$(this).attr("eventid")].bringToFront();
$(this).addClass('first');
$(this).text('map (red)');
};
});
};
function highlightEvent( id ) {
var highlightStyle = {
color: config['event']['markerColorH'],
fillColor: config['event']['markerColorH'],
fillOpacity: 1,
};
var normalStyle = {
fillColor: config['event']['markerColor'],
color: config['event']['markerColor'],
fillOpacity: config['event']['markerOpacity'],
};
$("#eventstable > tbody > tr:not(.filtered)").find("a.map-link").each( function() {
if ( $(this).attr("eventid") ) {
if ( $(this).attr("eventid") == id ) {
eventTable[$(this).attr("eventid")].setStyle(highlightStyle);
eventTable[$(this).attr("eventid")].bringToFront();
$(this).addClass('first');
$(this).text('map (red)');
} else {
eventTable[$(this).attr("eventid")].setStyle(normalStyle);
$(this).removeClass('first');
$(this).text('map');
}
};
});
};
/**********************************************************************
* document ready *
**********************************************************************/
$(document).ready(function() {
// tablesorter for event list
$("#eventstable").tablesorter(
{
theme : 'blue',
dateFormat : "ddmmyyyy",
headers: {
0: { sorter: "shortDate" }
},
cssChildRow: "tablesorter-childRow", // this is the default setting
widgets: ["uitheme", "zebra", "filter", "pager"], // initialize zebra and filter widgets, "scroller"
widgetOptions: {
// possible variables: {page}, {totalPages}, {filteredPages}, {startRow}, {endRow}, {filteredRows} and {totalRows}
pager_output: '# {startRow} - {endRow} ({totalRows}) | page {page} ({totalPages})',
pager_removeRows: false,
pager_size: 35,
filter_childRows : true,
filter_cssFilter : 'tablesorter-filter',
filter_startsWith : false,
filter_ignoreCase : true,
scroller_height: $('div.map').height() - 250,
scroller_barWidth: 10,
scroller_jumpToHeader: false,
sortList: "[[0,1], [1,1], [2,1]]",
resort: true,
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();
});
$('#eventstable').bind('pagerComplete', function(){
highlightFirstEvent();
});
// 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
// hide other rows
$(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').addClass('selected-now');
$(this).closest('tbody').find('td.selected').each(function(){
if ( ! $(this).hasClass('selected-now') ) {
$(this).hide();
$(this).removeClass('selected');
};
});
$(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').each(function(){
$(this).removeClass('selected-now');
var selected = $(this).hasClass('selected');
if ( selected ) {
$(this).removeClass('selected');
highlightFirstEvent();
} else {
$(this).addClass('selected');
highlightEvent($(this).attr('eventid'));
};
});
return false;
});
// update selection / type info
$("#events-timespan").text(config['map']['timespan']);
$("#events-minmag").text(sprintf('%.1f', config['event']['minMag']));
config['event']['typeWhitelist'].map(function(type) {
var typetext;
( $("#events-type").text() == "Symbols:" ) ? typetext = ' ' : typetext = ', ';
switch ( type ) {
case 'earthquake':
typetext += 'tectonic earthquake&nbsp;(star)';
break;
case 'explosion':
typetext += 'explosion&nbsp;(hexagon)';
break;
case 'induced or triggered event':
typetext += '(mining-)induced event&nbsp;(circle)';
break;
case 'quarry blast':
case 'controlled explosion':
case 'explosion':
typetext += 'quarry blast&nbsp;(wheel)';
break;
case 'nuclear explosion':
typetext += 'nuclear weapon test&nbsp;(square)';
break;
};
$("#events-type").append(typetext);
});
});
File renamed without changes.
+207
View File
@@ -0,0 +1,207 @@
div.leaflet-div-icon {
text-align: center;
vertical-align: middle;
border-radius: 4px;
padding: 2px 2px 0px 2px;
font-size: small;
margin: 0px auto;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
width: auto;
background: '#fff';
background-color: #f5f5f5;
background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
background-image: linear-gradient(top, #ffffff, #e6e6e6);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0);
border-color: #e6e6e6 #e6e6e6 #bfbfbf;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
filter: progid:dximagetransform.microsoft.gradient(enabled=false);
border: 1px solid #cccccc;
border-bottom-color: #b3b3b3;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
}
div.leaflet-div-icon div {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
margin: 0px;
padding: 0px;
line-height: 12px;
}
div.leaflet-div-icon div div {
display: block;
font-size: xx-small;
}
div.legend-content {
margin: 0px;
padding: 0px;
}
div.legend-box {
width: 10px;
height: 10px;
display: inline-block;
margin-right: 8px;
border: solid 1px #000;
margin-bottom: 0px;
}
div.leaflet-div-icon div div.legend-box {
width: 5px;
height: 5px;
display: inline-block;
margin-right: 4px;
margin-bottom: 0px;
}
div.leaflet-div-icon div div.key {
margin: 2px 4px 0px 0px;
font-weight: bold;
line-height: 10px;
display: inline-block;
}
.data-layer-legend div {
display: inline-block;
font-size: small;
}
.data-layer-legend .legend-box, .data-layer-legend .key {
vertical-align: middle;
}
.choropleth-text {
font-size: x-small;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
vertical-align: middle;
text-align: center;
}
.scale-bars i {
vertical-align: bottom;
display: inline-block;
background-color: silver;
height: 14px;
}
.min-value, .max-value {
vertical-align: middle;
width: 50px;
}
.min-value {
text-align: right;
margin-right: 6px;
}
.max-value {
text-align: left;
margin-left: 6px;
}
.scale-value {
text-align: center;
position: relative;
}
.data-layer-legend {
padding: 8px 0px 0px 0px;
}
.scale-bars {
vertical-align: middle;
line-height: 10px;
}
.legend-title {
font-weight: bold;
}
.leaflet-popup-content {
overflow: auto;
max-height: 300px;
}
.palette-element {
display: inline-block;
width: 12px;
height: 14px;
}
.leaflet-control-legend {
background-color: rgba(255, 255, 255, 0.7);
padding: 0px;
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
max-height: 70px;
width: 268px;
box-shadow: 0 1px 7px #999;
overflow: hidden;
}
.leaflet-control-legend.larger {
max-height: 50%;
overflow: auto;
}
.leaflet-control-legend .legend {
padding: 10px;
}
.leaflet-control-legend i {
background-image: none;
vertical-align: text-bottom;
}
.photo {
width: 100%;
height: 100%;
padding: 2px;
background-color: white;
box-shadow: 2px 2px 3px rgba(100, 100, 100, 0.5);
opacity: 0;
-moz-transition: opacity 1s; /* Firefox 4 */
-webkit-transition: opacity 1s; /* Safari and Chrome */
-o-transition: opacity 1s;
transition: opacity 1s;
}
.photo-info {
background-color: rgba(0, 0, 0, 0.6);
padding: 10px;
position: absolute;
top: 0px;
color: white;
margin: 2px;
}
.photo-link {
float: right;
height: 14px;
}
.author-link {
margin-left: 2px;
width: 400px;
display: block;
font-style: italic;
font-weight: bold;
}
text.leaflet-svg-text {
alignment-baseline: central;
dominant-baseline: central;
text-anchor: middle;
}
+54
View File
@@ -0,0 +1,54 @@
.leaflet-label {
background: rgb(235, 235, 235);
background: rgba(235, 235, 235, 0.81);
background-clip: padding-box;
border-color: #777;
border-color: rgba(0,0,0,0.25);
border-radius: 4px;
border-style: solid;
border-width: 4px;
color: #111;
display: block;
font: 12px/20px "Helvetica Neue", Arial, Helvetica, sans-serif;
font-weight: bold;
padding: 1px 6px;
position: absolute;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
pointer-events: none;
white-space: nowrap;
z-index: 6;
}
.leaflet-label.leaflet-clickable {
cursor: pointer;
pointer-events: auto;
}
.leaflet-label:before,
.leaflet-label:after {
border-top: 6px solid transparent;
border-bottom: 6px solid transparent;
content: none;
position: absolute;
top: 5px;
}
.leaflet-label:before {
border-right: 6px solid black;
border-right-color: inherit;
left: -10px;
}
.leaflet-label:after {
border-left: 6px solid black;
border-left-color: inherit;
right: -10px;
}
.leaflet-label-right:before,
.leaflet-label-left:after {
content: "";
}
+20
View File
@@ -0,0 +1,20 @@
.leaflet-control-easyPrint a {
background:#fff url(print.png) no-repeat 5px;
background-size:16px 16px;
display: block;
}
@media print {
html {padding: 0px!important;}
.leaflet-control-easyPrint-button{display: none!important;}
}
#map {
width: 1200;
height: 800;
}
View File
File renamed without changes.

Before

Width:  |  Height:  |  Size: 720 B

After

Width:  |  Height:  |  Size: 720 B

+161
View File
@@ -0,0 +1,161 @@
/* jQuery.print, version 1.0.3
* (c) Sathvik Ponangi, Doers' Guild
* Licence: CC-By (http://creativecommons.org/licenses/by/3.0/)
*--------------------------------------------------------------------------*/
(function($) {"use strict";
// A nice closure for our definitions
function getjQueryObject(string) {
// Make string a vaild jQuery thing
var jqObj = $("");
try {
jqObj = $(string).clone();
} catch(e) {
jqObj = $("<span />").html(string);
}
return jqObj;
}
function isNode(o) {
/* http://stackoverflow.com/a/384380/937891 */
return !!( typeof Node === "object" ? o instanceof Node : o && typeof o === "object" && typeof o.nodeType === "number" && typeof o.nodeName === "string");
}
$.print = $.fn.print = function() {
// Print a given set of elements
var options, $this, self = this;
// console.log("Printing", this, arguments);
if ( self instanceof $) {
// Get the node if it is a jQuery object
self = self.get(0);
}
if (isNode(self)) {
// If `this` is a HTML element, i.e. for
// $(selector).print()
$this = $(self);
if (arguments.length > 0) {
options = arguments[0];
}
} else {
if (arguments.length > 0) {
// $.print(selector,options)
$this = $(arguments[0]);
if (isNode($this[0])) {
if (arguments.length > 1) {
options = arguments[1];
}
} else {
// $.print(options)
options = arguments[0];
$this = $("html");
}
} else {
// $.print()
$this = $("html");
}
}
// Default options
var defaults = {
globalStyles : true,
mediaPrint : false,
stylesheet : null,
noPrintSelector : ".no-print",
iframe : true,
append : null,
prepend : null
};
// Merge with user-options
options = $.extend({}, defaults, (options || {}));
var $styles = $("");
if (options.globalStyles) {
// Apply the stlyes from the current sheet to the printed page
$styles = $("style, link, meta, title");
} else if (options.mediaPrint) {
// Apply the media-print stylesheet
$styles = $("link[media=print]");
}
if (options.stylesheet) {
// Add a custom stylesheet if given
$styles = $.merge($styles, $('<link rel="stylesheet" href="' + options.stylesheet + '">'));
}
// Create a copy of the element to print
var copy = $this.clone();
// Wrap it in a span to get the HTML markup string
copy = $("<span/>").append(copy);
// Remove unwanted elements
copy.find(options.noPrintSelector).remove();
// Add in the styles
copy.append($styles.clone());
// Appedned content
copy.append(getjQueryObject(options.append));
// Prepended content
copy.prepend(getjQueryObject(options.prepend));
// Get the HTML markup string
var content = copy.html();
// Destroy the copy
copy.remove();
var w, wdoc;
if (options.iframe) {
// Use an iframe for printing
try {
var $iframe = $(options.iframe + "");
var iframeCount = $iframe.length;
if (iframeCount === 0) {
// Create a new iFrame if none is given
$iframe = $('<iframe height="0" width="0" border="0" wmode="Opaque"/>').prependTo('body').css({
"position" : "absolute",
"top" : -999,
"left" : -999
});
}
w = $iframe.get(0);
w = w.contentWindow || w.contentDocument || w;
wdoc = w.document || w.contentDocument || w;
wdoc.open();
wdoc.write(content);
wdoc.close();
setTimeout(function() {
// Fix for IE : Allow it to render the iframe
w.focus();
w.print();
setTimeout(function() {
// Fix for IE
if (iframeCount === 0) {
// Destroy the iframe if created here
$iframe.remove();
}
}, 100);
}, 250);
} catch (e) {
// Use the pop-up method if iframe fails for some reason
console.error("Failed to print from iframe", e.stack, e.message);
w = window.open();
w.document.write(content);
w.document.close();
w.focus();
w.print();
w.close();
}
} else {
// Use a new window for printing
w = window.open();
w.document.write(content);
w.document.close();
w.focus();
w.print();
w.close();
}
return this;
};
})(jQuery);
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View File
File renamed without changes.

Before

Width:  |  Height:  |  Size: 737 B

After

Width:  |  Height:  |  Size: 737 B

+7
View File
@@ -0,0 +1,7 @@
/*
@preserve Leaflet Data Visualization Framework, a JavaScript library for creating thematic maps using Leaflet
(c) 2013, Scott Fairgrieve, HumanGeo
*/
L.LinearFunction=L.Class.extend({initialize:function(t,e,i){this.setOptions(i),this.setRange(t,e)},_calculateParameters:function(t,e){0===this._xRange?(this._slope=0,this._b=t.y):(this._slope=(e.y-t.y)/this._xRange,this._b=t.y-this._slope*t.x)},_arrayToPoint:function(t){return{x:t[0],y:t[1]}},setOptions:function(t){L.Util.setOptions(this,t),this._preProcess=this.options.preProcess,this._postProcess=this.options.postProcess},getBounds:function(){var t=Math.min(this._minPoint.x,this._maxPoint.x),e=Math.max(this._minPoint.x,this._maxPoint.x),i=Math.min(this._minPoint.y,this._maxPoint.y),n=Math.max(this._minPoint.y,this._maxPoint.y);return[new L.Point(t,i),new L.Point(e,n)]},setRange:function(t,e){return t=t instanceof Array?this._arrayToPoint(t):t,e=e instanceof Array?this._arrayToPoint(e):e,this._minPoint=t,this._maxPoint=e,this._xRange=e.x-t.x,this._calculateParameters(t,e),this},setMin:function(t){return this.setRange(t,this._maxPoint),this},setMax:function(t){return this.setRange(this._minPoint,t),this},setPreProcess:function(t){return this._preProcess=t,this},setPostProcess:function(t){return this._postProcess=t,this},evaluate:function(t){var e;return this._preProcess&&(t=this._preProcess(t)),e=Number((this._slope*t).toFixed(6))+Number(this._b.toFixed(6)),this._postProcess&&(e=this._postProcess(e)),e},random:function(){var t=Math.random()*this._xRange+this._minPoint.x;return this.evaluate(t)},sample:function(t){t=Math.max(t,2);for(var e=t-1,i=this._xRange/e,n=this._minPoint.x,a=[];this._maxPoint.x>=n;)a.push(this.evaluate(n)),n+=i;return a},samplePoints:function(t){t=Math.max(t,2);for(var e=t-1,i=this._xRange/e,n=this._minPoint.x,a=[];this._maxPoint.x>=n;)a.push(new L.Point(n,this.evaluate(n))),n+=i;return a},getIntersectionPoint:function(t){var e=null;if(this._slope!==t._slope){var i=(this._b-t._b)/(t._slope-this._slope),n=this.evaluate(i);e=new L.Point(i,n)}return e}}),L.ColorFunction=L.LinearFunction.extend({options:{alpha:1,includeAlpha:!1},initialize:function(t,e,i){L.Util.setOptions(this,i),this._parts=[],this._dynamicPart=null,this._outputPrecision=0,this._prefix=null,this._formatOutput=function(t){return t.toFixed(this._outputPrecision)},this._mapOutput=function(t){for(var e=[],i=0;this._parts.length>i;++i){var n=this._parts[i];e.push(t[n])}return this.options.includeAlpha&&e.push(this.options.alpha),e},this._getColorString=function(t){t=this._formatOutput(t),this.options[this._dynamicPart]=t;var e=this._mapOutput(this.options);return this._writeColor(this._prefix,e)},this._writeColor=function(t,e){return this.options.includeAlpha&&(t+="a"),t+"("+e.join(",")+")"};var n=function(t){i&&i.postProcess&&(t=i.postProcess.call(this,t));var e=this._getColorString(t);return L.Browser.ie&&e.indexOf("hsl")>-1&&(e=L.hslColor(e).toRGBString()),e};L.LinearFunction.prototype.initialize.call(this,t,e,{preProcess:this.options.preProcess,postProcess:n})}}),L.HSLColorFunction=L.ColorFunction.extend({initialize:function(t,e,i){L.ColorFunction.prototype.initialize.call(this,t,e,i),this._parts=["outputHue","outputSaturation","outputLuminosity"],this._prefix="hsl",this._outputPrecision=2}}),L.RGBColorFunction=L.ColorFunction.extend({initialize:function(t,e,i){L.ColorFunction.prototype.initialize.call(this,t,e,i),this._parts=["outputRed","outputBlue","outputGreen"],this._prefix="rgb",this._outputPrecision=0}}),L.RGBRedFunction=L.LinearFunction.extend({options:{outputGreen:0,outputBlue:0},initialize:function(t,e,i){L.RGBColorFunction.prototype.initialize.call(this,t,e,i),this._dynamicPart="outputRed"}}),L.RGBBlueFunction=L.LinearFunction.extend({options:{outputRed:0,outputGreen:0},initialize:function(t,e,i){L.RGBColorFunction.prototype.initialize.call(this,t,e,i),this._dynamicPart="outputBlue"}}),L.RGBGreenFunction=L.LinearFunction.extend({options:{outputRed:0,outputBlue:0},initialize:function(t,e,i){L.RGBColorFunction.prototype.initialize.call(this,t,e,i),this._dynamicPart="outputGreen"}}),L.RGBColorBlendFunction=L.LinearFunction.extend({initialize:function(t,e,i,n){i=new L.RGBColor(i),n=new L.RGBColor(n);var a=i.r(),o=n.r(),r=i.g(),s=n.g(),f=i.b(),d=n.b();this._minX=t,this._maxX=e,this._redFunction=new L.LinearFunction(new L.Point(t,a),new L.Point(e,o)),this._greenFunction=new L.LinearFunction(new L.Point(t,r),new L.Point(e,s)),this._blueFunction=new L.LinearFunction(new L.Point(t,f),new L.Point(e,d))},getBounds:function(){var t=this._redFunction.getBounds(),e=this._greenFunction.getBounds(),i=this._blueFunction.getBounds(),n=Math.min(t[0].y,e[0].y,i[0].y),a=Math.max(t[0].y,e[0].y,i[0].y);return[new L.Point(t[0].x,n),new L.Point(t[1].x,a)]},evaluate:function(t){return new L.RGBColor([this._redFunction.evaluate(t),this._greenFunction.evaluate(t),this._blueFunction.evaluate(t)]).toRGBString()}}),L.HSLHueFunction=L.HSLColorFunction.extend({options:{outputSaturation:"100%",outputLuminosity:"50%"},initialize:function(t,e,i){L.HSLColorFunction.prototype.initialize.call(this,t,e,i),this._dynamicPart="outputHue"}}),L.HSLSaturaLine truncated
},luminosityPalette:function(t,e,i,n,a){return new L.HSLLuminosityFunction(new L.Point(t,i),new L.Point(e,n),a)},saturationPalette:function(t,e,i,n,a){return new L.HSLSaturationFunction(new L.Point(t,i),new L.Point(e,n),a)},rgbBlendPalette:function(t,e,i,n,a){return new L.RGBColorBlendFunction(t,e,i,n,a)},hslBlendPalette:function(t,e,i,n,a){return new L.HSLColorBlendFunction(t,e,i,n,a)},customColorPalette:function(t,e,i,n){return new L.CustomColorFunction(t,e,i,n)}},L.DynamicColorPalettes={rainbow:{text:"Rainbow",getPalette:function(t,e){return L.Palettes.huePalette(t,e,0,300)}},greentored:{text:"Green - Red",getPalette:function(t,e){return L.Palettes.huePalette(t,e,120,0)}},yellowtored:{text:"Yellow - Red",getPalette:function(t,e){return L.Palettes.huePalette(t,e,60,0)}},orangetored:{text:"Orange - Red",getPalette:function(t,e){return L.Palettes.huePalette(t,e,30,0)}},redtopurple:{text:"Red - Purple",getPalette:function(t,e){return L.Palettes.huePalette(t,e,360,270)}},bluetored:{text:"Blue - Red",getPalette:function(t,e){return L.Palettes.huePalette(t,e,210,360)}},bluetored2:{text:"Blue - Red 2",getPalette:function(t,e){return L.Palettes.huePalette(t,e,180,0)}},whitetored:{text:"White - Red",getPalette:function(t,e){return L.Palettes.luminosityPalette(t,e,1,.5,{outputHue:0})}},whitetoorange:{text:"White - Orange",getPalette:function(t,e){return L.Palettes.luminosityPalette(t,e,1,.5,{outputHue:30})}},whitetoyellow:{text:"White - Yellow",getPalette:function(t,e){return L.Palettes.luminosityPalette(t,e,1,.5,{outputHue:60})}},whitetogreen:{text:"White - Green",getPalette:function(t,e){return L.Palettes.luminosityPalette(t,e,1,.5,{outputHue:120})}},whitetoltblue:{text:"White - Lt. Blue",getPalette:function(t,e){return L.Palettes.luminosityPalette(t,e,1,.5,{outputHue:180})}},whitetoblue:{text:"White - Blue",getPalette:function(t,e){return L.Palettes.luminosityPalette(t,e,1,.5,{outputHue:240})}},whitetopurple:{text:"White - Purple",getPalette:function(t,e){return L.Palettes.luminosityPalette(t,e,1,.5,{outputHue:270})}},graytored:{text:"Gray - Red",getPalette:function(t,e){return L.Palettes.saturationPalette(t,e,0,1,{outputHue:0})}},graytoorange:{text:"Gray - Orange",getPalette:function(t,e){return L.Palettes.saturationPalette(t,e,0,1,{outputHue:30})}},graytoyellow:{text:"Gray - Yellow",getPalette:function(t,e){return L.Palettes.saturationPalette(t,e,0,1,{outputHue:60})}},graytogreen:{text:"Gray - Green",getPalette:function(t,e){return L.Palettes.saturationPalette(t,e,0,1,{outputHue:120})}},graytoltblue:{text:"Gray - Lt. Blue",getPalette:function(t,e){return L.Palettes.saturationPalette(t,e,0,1,{outputHue:180})}},graytoblue:{text:"Gray - Blue",getPalette:function(t,e){return L.Palettes.saturationPalette(t,e,0,1,{outputHue:240})}},graytopurple:{text:"Gray - Purple",getPalette:function(t,e){return L.Palettes.saturationPalette(t,e,0,1,{outputHue:270})}}},L.DynamicPaletteElement=L.Class.extend({initialize:function(t,e){this._key=t,this._dynamicPalette=e},generate:function(t){var e=L.DomUtil.create("div","palette"),i=t.count,n=this._dynamicPalette.getPalette(0,i-1),a=t.width,o=!0;void 0!=t.showText&&(o=t.showText),e.setAttribute("data-palette-key",this._key),this._dynamicPalette.text&&o&&(L.DomUtil.create("div","palette-text",e).innerHTML='<i class="icon-ok hidden"></i>'+this._dynamicPalette.text);var r=a/i;t.className&&L.DomUtil.addClass(e,t.className);for(var s=0;i>s;++s){var s=L.DomUtil.create("i","palette-element");for(var f in n){var d=n[f],c=d.evaluate?d.evaluate(s):d;L.StyleConverter.setCSSProperty(s,f,c)}s.style.width=r+"px",e.appendChild(s)}return e}}),L.Path.XLINK_NS="http://www.w3.org/1999/xlink";var TextFunctions=TextFunctions||{__updatePath:L.Path.prototype._updatePath,_updatePath:function(){this.__updatePath.call(this),this.options.text&&this._createText(this.options.text)},_initText:function(){this.options.text&&this._createText(this.options.text)},getTextAnchor:function(){return this._point?this._point:void 0},setTextAnchor:function(t){this._text&&(this._text.setAttribute("x",t.x),this._text.setAttribute("y",t.y))},_createText:function(t){this._text&&this._container.removeChild(this._text),this._pathDef&&this._defs.removeChild(this._pathDef);var e=function(t,e){var i="";for(var n in e)i+=n+": "+e[n]+";";return t.setAttribute("style",i),t},i=function(t,e){for(var i in e)t.setAttribute(i,e[i]);return t};this._text=this._createElement("text");var n=document.createTextNode(t.text);if(t.path){var a=t.path,o=L.Util.guid(),r=this._createElement("path");r.setAttribute("d",this._path.getAttribute("d")),r.setAttribute("id",o),this._defs||(this._defs=this._createElement("defs"),this._container.appendChild(this._defs)),this._defs.appendChild(r),this._pathDef=r;var s=this._createElement("textPath");a.startOffset&&s.setAttribute("startOffset",a.startOffset),a.attr&&i(s,a.attr),a.style&&e(s,a.style),s.setAttributeNS(L.Path.XLINK_NS,"xlink:href","#"+o),s.appendChild(n),this._text.appendChild(s)}else{this._text.appendCLine truncated
n=new L.RadialBarMarker(this._latlng,f),this.addLayer(n)}}}});
View File
File renamed without changes.
+28
View File
@@ -0,0 +1,28 @@
L.Control.EasyPrint = L.Control.extend({
options: {
position: 'topright',
title: 'Print map',
},
onAdd: function () {
var container = L.DomUtil.create('div', 'leaflet-control-easyPrint leaflet-bar leaflet-control');
this.link = L.DomUtil.create('a', 'leaflet-control-easyPrint-button leaflet-bar-part', container);
this.link.href = 'javascript:void($("#map").print({stylesheet:"external/easyPrint.css"}))';
return container;
},
_click: function (e) {
L.DomEvent.stopPropagation(e);
L.DomEvent.preventDefault(e);
},
});
L.easyPrint = function() {
return new L.Control.EasyPrint();
};
View File
File renamed without changes.
+9
View File
@@ -0,0 +1,9 @@
/*
Leaflet.label, a plugin that adds labels to markers and vectors for Leaflet powered maps.
(c) 2012-2013, Jacob Toye, Smartrak
https://github.com/Leaflet/Leaflet.label
http://leafletjs.com
https://github.com/jacobtoye
*/
(function(){L.labelVersion="0.2.2-dev",L.Label=L.Class.extend({includes:L.Mixin.Events,options:{className:"",clickable:!1,direction:"right",noHide:!1,offset:[12,-15],opacity:1,zoomAnimation:!0},initialize:function(t,e){L.setOptions(this,t),this._source=e,this._animated=L.Browser.any3d&&this.options.zoomAnimation,this._isOpen=!1},onAdd:function(t){this._map=t,this._pane=this._source instanceof L.Marker?t._panes.markerPane:t._panes.popupPane,this._container||this._initLayout(),this._pane.appendChild(this._container),this._initInteraction(),this._update(),this.setOpacity(this.options.opacity),t.on("moveend",this._onMoveEnd,this).on("viewreset",this._onViewReset,this),this._animated&&t.on("zoomanim",this._zoomAnimation,this),L.Browser.touch&&!this.options.noHide&&L.DomEvent.on(this._container,"click",this.close,this)},onRemove:function(t){this._pane.removeChild(this._container),t.off({zoomanim:this._zoomAnimation,moveend:this._onMoveEnd,viewreset:this._onViewReset},this),this._removeInteraction(),this._map=null},setLatLng:function(t){return this._latlng=L.latLng(t),this._map&&this._updatePosition(),this},setContent:function(t){return this._previousContent=this._content,this._content=t,this._updateContent(),this},close:function(){var t=this._map;t&&(L.Browser.touch&&!this.options.noHide&&L.DomEvent.off(this._container,"click",this.close),t.removeLayer(this))},updateZIndex:function(t){this._zIndex=t,this._container&&this._zIndex&&(this._container.style.zIndex=t)},setOpacity:function(t){this.options.opacity=t,this._container&&L.DomUtil.setOpacity(this._container,t)},_initLayout:function(){this._container=L.DomUtil.create("div","leaflet-label "+this.options.className+" leaflet-zoom-animated"),this.updateZIndex(this._zIndex)},_update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updatePosition(),this._container.style.visibility="")},_updateContent:function(){this._content&&this._map&&this._prevContent!==this._content&&"string"==typeof this._content&&(this._container.innerHTML=this._content,this._prevContent=this._content,this._labelWidth=this._container.offsetWidth)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},_setPosition:function(t){var e=this._map,i=this._container,n=e.latLngToContainerPoint(e.getCenter()),o=e.layerPointToContainerPoint(t),s=this.options.direction,a=this._labelWidth,l=L.point(this.options.offset);"right"===s||"auto"===s&&o.x<n.x?(L.DomUtil.addClass(i,"leaflet-label-right"),L.DomUtil.removeClass(i,"leaflet-label-left"),t=t.add(l)):(L.DomUtil.addClass(i,"leaflet-label-left"),L.DomUtil.removeClass(i,"leaflet-label-right"),t=t.add(L.point(-l.x-a,l.y))),L.DomUtil.setPosition(i,t)},_zoomAnimation:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPosition(e)},_onMoveEnd:function(){this._animated&&"auto"!==this.options.direction||this._updatePosition()},_onViewReset:function(t){t&&t.hard&&this._update()},_initInteraction:function(){if(this.options.clickable){var t=this._container,e=["dblclick","mousedown","mouseover","mouseout","contextmenu"];L.DomUtil.addClass(t,"leaflet-clickable"),L.DomEvent.on(t,"click",this._onMouseClick,this);for(var i=0;e.length>i;i++)L.DomEvent.on(t,e[i],this._fireMouseEvent,this)}},_removeInteraction:function(){if(this.options.clickable){var t=this._container,e=["dblclick","mousedown","mouseover","mouseout","contextmenu"];L.DomUtil.removeClass(t,"leaflet-clickable"),L.DomEvent.off(t,"click",this._onMouseClick,this);for(var i=0;e.length>i;i++)L.DomEvent.off(t,e[i],this._fireMouseEvent,this)}},_onMouseClick:function(t){this.hasEventListeners(t.type)&&L.DomEvent.stopPropagation(t),this.fire(t.type,{originalEvent:t})},_fireMouseEvent:function(t){this.fire(t.type,{originalEvent:t}),"contextmenu"===t.type&&this.hasEventListeners(t.type)&&L.DomEvent.preventDefault(t),"mousedown"!==t.type?L.DomEvent.stopPropagation(t):L.DomEvent.preventDefault(t)}}),L.BaseMarkerMethods={showLabel:function(){return this.label&&this._map&&(this.label.setLatLng(this._latlng),this._map.showLabel(this.label)),this},hideLabel:function(){return this.label&&this.label.close(),this},setLabelNoHide:function(t){this._labelNoHide!==t&&(this._labelNoHide=t,t?(this._removeLabelRevealHandlers(),this.showLabel()):(this._addLabelRevealHandlers(),this.hideLabel()))},bindLabel:function(t,e){var i=this.options.icon?this.options.icon.options.labelAnchor:this.options.labelAnchor,n=L.point(i)||L.point(0,0);return n=n.add(L.Label.prototype.options.offset),e&&e.offset&&(n=n.add(e.offset)),e=L.Util.extend({offset:n},e),this._labelNoHide=e.noHide,this.label||(this._labelNoHide||this._addLabelRevealHandlers(),this.on("remove",this.hideLabel,this).on("move",this._moveLabel,this).on("add",this._onMarkerAdd,this),this._hasLabelHandlers=!0),this.label=new L.Label(e,this).setContent(t),this},unbindLabel:function(){return this.label&&(this.hideLabel(),this.label=null,this._hasLabelHandlersLine truncated
View File
File renamed without changes.

Before

Width:  |  Height:  |  Size: 736 B

After

Width:  |  Height:  |  Size: 736 B

View File
File renamed without changes.

Before

Width:  |  Height:  |  Size: 745 B

After

Width:  |  Height:  |  Size: 745 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 219 B

File renamed without changes.
File renamed without changes.
File renamed without changes.
+29
View File
@@ -0,0 +1,29 @@
<div class="accordioncontent">
<h4>Anschrift</h4>
Seismologisches Observatorium der<br />
Ruhr-Universität Bochum<br />
NA 3/174<br />
44780 Bochum<br />
Tel.: 0234 32-27574<br />
Fax: 0234 32-07574<br />
<p>Die Ruhr-Universität ist eine Körperschaft des Öffentlichen Rechts. Sie wird durch ihren Rektor Herrn Prof. Dr. Elmar W. Weiler gesetzlich vertreten.</p>
<p>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.</p>
<p>Umsatzsteuer-Identifikationsnummer: DE 127 056 261</p>
<h4>Inhaltliche und technische Verantwortung für die Seiten des Seismologischen Observatoriums der Ruhr-Universität Bochum</h4>
Herr Dr. Kasper D. Fischer<br />
Ruhr-Universität Bochum<br />
44780 Bochum<br />
Tel.: 0234 32-27574<br />
Fax: 0234 32-07574<br />
E-Mail: kasper.fischer@ruhr-uni-bochum.de<br />
<p>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
erreichen sind.</p>
<h4>Rechtliche Hinweise</h4>
<p>Die Ruhr-Universität Bochum übernimmt keine Gewähr für die Richtigkeit und Vollständigkeit der auf ihren Internetseiten befindlichen Informationen. Das gleiche gilt für die
Inhalte verlinkter Seiten.</p>
</div>
Regular → Executable
+88 -42
View File
@@ -7,44 +7,65 @@
<!-- Style definitions -->
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="main.css" />
<!-- link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css" / -->
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/cupertino/jquery-ui.css" />
<link rel="stylesheet" href="external/theme.blue.css"/>
<link rel="stylesheet" href="external/jquery.tablesorter.pager.css" />
<link rel="stylesheet" href="external/leaflet.css" />
<!-- link rel="stylesheet" href="external/css/dvf.css" type="text/css" media="screen" / -->
<link rel="stylesheet" href="external/css/leaflet.label.css" type="text/css" media="screen" />
<link rel="stylesheet" href="external/easyPrint.css"/>
<!-- jQuery & jQueryUI -->
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.4/themes/cupertino/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<!-- Localtime -->
<script type="text/javascript" src="jquery.localtime-0.9.1.min.js"></script>
<!-- Localtime & sprintf -->
<script type="text/javascript" src="external/jquery.localtime-0.9.1.min.js"></script>
<script type="text/javascript" src="external/sprintf.min.js"></script>
<!-- Tablesorter: required -->
<link rel="stylesheet" href="theme.blue.css">
<script src="jquery.tablesorter.min.js"></script>
<!-- script src="widget-scroller.js"></script -->
<script src="jquery.tablesorter.widgets.min.js"></script>
<script src="jquery.tablesorter.pager.min.js"></script>
<!-- misc functions -->
<script src="misc.js"></script>
<script src="sprintf.min.js"></script>
<!-- Tablesorter: pager -->
<link rel="stylesheet" href="jquery.tablesorter.pager.css">
<script src="widget-pager.js"></script>
<script src="events.js"></script>
<script type="text/javascript" src="external/jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="external/jquery.tablesorter.widgets.min.js"></script>
<script type="text/javascript" src="external/widget-pager.js"></script>
<!-- script type="text/javascript" src="external/jquery.tablesorter.pager.min.js"></script -->
<!-- script type="text/javascript" src="external/widget-scroller.js"></script -->
<!-- Leaflet -->
<link rel="stylesheet" href="leaflet.css" />
<script src="leaflet.js"></script>
<!-- script src="TileLayer.Grayscale.js"></script -->
<script src="map.js"></script>
<script type="text/javascript" src="external/leaflet.js"></script>
<script type="text/javascript" src="external/TileLayer.Grayscale.js"></script>
<script type="text/javascript" src="external/leaflet-dvf.markers.min.js"></script>
<script type="text/javascript" src="external/leaflet.label.js"></script>
<script src="external/jQuery.print.js"></script>
<script src="external/leaflet.easyPrint.js"></script>
<script src="https://open.mapquestapi.com/sdk/leaflet/v2.2/mq-map.js?key=RPOPuz3lA2GGBtVpEU0ugxtVoGba53Dt"></script>
<!-- <script src="https://www.mapquestapi.com/sdk/leaflet/v2.2/mq-map.js?key=RPOPuz3lA2GGBtVpEU0ugxtVoGba53Dt"></script> -->
<!-- Stations -->
<script src="stations.js"></script>
<!-- Map, Events & Stations -->
<script type="text/javascript" src="misc.js"></script>
<script type="text/javascript" src="geolocation.js"></script>
<script type="text/javascript" src="specialevents.js"></script>
<script type="text/javascript" src="map.js"></script>
<script type="text/javascript" src="events.js"></script>
<script type="text/javascript" src="stations.js"></script>
</head>
<body>
<!-- noscript -->
<noscript>
<div class="noscript">
<div class="noscriptcontent">
<h2>Kein JavaScript verfügbar!</h2>
<p>Diese Seite benötigt JavaScript. Bitte schalten Sie JavaScript ein.</p>
<h2>JavaScript disabled!</h2>
<p>This page requires JavaScript to work. Please enable JavaScript.</p>
<h2>Impressum</h2>
<!--#include virtual="impressum.inc.de" -->
</div>
</div>
</noscript>
<!-- Tabs -->
<div class="info" id="tabs">
<ul>
<li><a href="#eventstab"><span>Ereignisse</span></a></li>
@@ -55,11 +76,11 @@
<!-- Ereignisse -->
<div class="tab" id="eventstab">
<div class="pager events" id="eventspager">
<img src="first.png" class="first" alt="First" />
<img src="prev.png" class="prev" alt="Prev" />
<img src="external/first.png" class="first" alt="First" />
<img src="external/prev.png" class="prev" alt="Prev" />
<span class="pagedisplay"></span>
<img src="next.png" class="next" alt="Next" />
<img src="last.png" class="last" alt="Last" />
<img src="external/next.png" class="next" alt="Next" />
<img src="external/last.png" class="last" alt="Last" />
<select class="pagesize" title="Select page size">
<option value="5">5</option>
<option value="10">10</option>
@@ -71,7 +92,7 @@
</select>
<select class="gotoPage" title="Select page number"></select>
</div>
<table class="tablesorter" id="eventstable" data-sortlist="[[0,0],[1,1],[2,1]]">
<table class="tablesorter" id="eventstable">
<colgroup>
<col width="85" />
<col width="50" />
@@ -89,16 +110,24 @@
<tbody>
</tbody>
</table>
<p>Nominatim Search Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img src="http://developer.mapquest.com/content/osm/mq_logo.png"></p>
<p class="table-caption">
Ereignisse der letzten <span id="events-timespan">180</span> Tage ab Magnitude <span id="events-minmag">1.2</span> im Bereich der Karte und besondere Ereignisse in angrenzenden Bereichen. Download als <a id="events-csv-link" href="link" download="events.csv">CSV-Datei</a>.
</p>
<p class="table-caption">
<span id="events-type">Symbole:</span>
</p>
<p class="table-caption">
Reverse Geolocation courtesy of <a href="http://photon.komoot.de/" target="_blank">Photon by Komoot</a>
</p>
</div>
<!-- Stations -->
<div class="tab" id="stationstab">
<div class="pager stationspager" id="stationspager">
<img src="first.png" class="stationsfirst" alt="First" />
<img src="prev.png" class="stationsprev" alt="Prev" />
<img src="external/first.png" class="stationsfirst" alt="First" />
<img src="external/prev.png" class="stationsprev" alt="Prev" />
<span class="stationspagedisplay"></span>
<img src="next.png" class="stationsnext" alt="Next" />
<img src="last.png" class="stationslast" alt="Last" />
<img src="external/next.png" class="stationsnext" alt="Next" />
<img src="external/last.png" class="stationslast" alt="Last" />
<select class="stationspagesize" title="Select page size">
<option value="5">5</option>
<option value="10">10</option>
@@ -114,8 +143,8 @@
<colgroup>
<col width="77" />
<col/>
<col width="77" />
<col width="77" />
<col width="77" align="char" char="." />
<col width="77" align="char" char="." />
</colgroup>
<thead>
<tr>
@@ -128,12 +157,29 @@
<tbody>
</tbody>
</table>
<p class="table-caption">Download als <a id="stations-csv-link" href="link" download="stations.csv">CSV-Datei</a>.</p>
</div>
<!-- More -->
<div class="tab" id="moretab"></div>
<div class="tab" id="moretab"><!--include virtual="more.html.de" --></div>
<!-- Info -->
<div class="tab" id="infotab"></div>
<div class="tab" id="infotab">
<div id="infoaccordion">
<h3 class="aheader">Navigation / Links</h3>
<!--#include virtual="info.inc.de" -->
<h3 class="aheader">Copyright / Lizenz</h3>
<!--#include virtual="copyright.inc.de" -->
<h3 class="aheader">Impressum</h3>
<!--#include virtual="impressum.inc.de" -->
<div>
</div>
</div>
</div>
</div>
<div class="rublogo"><img class="rublogo" src="logo_RUB_155x30.png" alt="Ruhr-Universität Bochum" title="Ruhr-Universität Bochum"/></div>
<!-- Logo -->
<div class="rublogo"><a href="http://www.gmg.ruhr-uni-bochum.de/geophysik/seisobs"><img class="rublogo" src="logo_RUB_155x30.png" alt="Ruhr-Universität Bochum" title="Ruhr-Universität Bochum" border="0"/></a></div>
<!-- Map -->
<div id="map" class="map"></div>
<div id="spinner" class="spinner" style="display:none;"><img id="img-spinner" src="spinner.gif" alt="Loading"/><br />Loading ...</div>
</body>
</html>
+186
View File
@@ -0,0 +1,186 @@
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<!-- $Id$ -->
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='de' lang='de'>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>RUB SeisObs - Event and Station Map</title>
<!-- Style definitions -->
<link rel="stylesheet" href="main.css" />
<!-- link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css" / -->
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/cupertino/jquery-ui.css" />
<link rel="stylesheet" href="external/theme.blue.css"/>
<link rel="stylesheet" href="external/jquery.tablesorter.pager.css" />
<link rel="stylesheet" href="external/leaflet.css" />
<!-- link rel="stylesheet" href="external/css/dvf.css" type="text/css" media="screen" / -->
<link rel="stylesheet" href="external/css/leaflet.label.css" type="text/css" media="screen" />
<link rel="stylesheet" href="external/easyPrint.css"/>
<!-- jQuery & jQueryUI -->
<script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<!-- Localtime & sprintf -->
<script type="text/javascript" src="external/jquery.localtime-0.9.1.min.js"></script>
<script type="text/javascript" src="external/sprintf.min.js"></script>
<!-- Tablesorter: required -->
<script type="text/javascript" src="external/jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="external/jquery.tablesorter.widgets.min.js"></script>
<script type="text/javascript" src="external/widget-pager.js"></script>
<!-- script type="text/javascript" src="external/jquery.tablesorter.pager.min.js"></script -->
<!-- script type="text/javascript" src="external/widget-scroller.js"></script -->
<!-- Leaflet -->
<script type="text/javascript" src="external/leaflet.js"></script>
<script type="text/javascript" src="external/TileLayer.Grayscale.js"></script>
<script type="text/javascript" src="external/leaflet-dvf.markers.min.js"></script>
<script type="text/javascript" src="external/leaflet.label.js"></script>
<script src="external/jQuery.print.js"></script>
<script src="external/leaflet.easyPrint.js"></script>
<script src="https://open.mapquestapi.com/sdk/leaflet/v2.2/mq-map.js?key=RPOPuz3lA2GGBtVpEU0ugxtVoGba53Dt"></script>
<!-- <script src="https://www.mapquestapi.com/sdk/leaflet/v2.2/mq-map.js?key=RPOPuz3lA2GGBtVpEU0ugxtVoGba53Dt"></script> -->
<!-- Map, Events & Stations -->
<script type="text/javascript" src="misc.js"></script>
<script type="text/javascript" src="geolocation.js"></script>
<script type="text/javascript" src="specialevents.js"></script>
<script type="text/javascript" src="map.js.en"></script>
<script type="text/javascript" src="events.js.en"></script>
<script type="text/javascript" src="stations.js.en"></script>
</head>
<body>
<!-- noscript -->
<noscript>
<div class="noscript">
<div class="noscriptcontent">
<h2>JavaScript disabled!</h2>
<p>This page requires JavaScript to work. Please enable JavaScript.</p>
<h2>Kein JavaScript verfügbar!</h2>
<p>Diese Seite benötigt JavaScript. Bitte schalten Sie JavaScript ein.</p>
<h2>Impressum</h2>
<!--#include virtual="impressum.inc.de" -->
</div>
</div>
</noscript>
<!-- Tabs -->
<div class="info" id="tabs">
<ul>
<li><a href="#eventstab"><span>Events</span></a></li>
<li><a href="#stationstab"><span>Stations</span></a></li>
<li><a href="#moretab"><span>More</span></a></li>
<li class="infotab"><a href="#infotab"><span>Info</span></a></li>
</ul>
<!-- Ereignisse -->
<div class="tab" id="eventstab">
<div class="pager events" id="eventspager">
<img src="external/first.png" class="first" alt="First" />
<img src="external/prev.png" class="prev" alt="Prev" />
<span class="pagedisplay"></span>
<img src="external/next.png" class="next" alt="Next" />
<img src="external/last.png" class="last" alt="Last" />
<select class="pagesize" title="Select page size">
<option value="5">5</option>
<option value="10">10</option>
<option value="15">15</option>
<option value="20">20</option>
<option value="25">25</option>
<option value="30">30</option>
<option value="35">35</option>
</select>
<select class="gotoPage" title="Select page number"></select>
</div>
<table class="tablesorter" id="eventstable">
<colgroup>
<col width="85" />
<col width="50" />
<col width="50" />
<col />
</colgroup>
<thead>
<tr>
<th>Date</th>
<th>Time</th>
<th>Mag.</th>
<th>Place</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<p class="table-caption">
Events of the last <span id="events-timespan">180</span> days with magnitude <span id="events-minmag">1.2</span> or larger in the area of the map and special events in adjacents regions. Download as <a id="events-csv-link" href="link" download="events.csv">CSV file</a>.
</p>
<p class="table-caption">
<span id="events-type">Symbols:</span>
</p>
<p class="table-caption">
Reverse Geolocation courtesy of <a href="http://photon.komoot.de/" target="_blank">Photon by Komoot</a>
</p>
</div>
<!-- Stations -->
<div class="tab" id="stationstab">
<div class="pager stationspager" id="stationspager">
<img src="external/first.png" class="stationsfirst" alt="First" />
<img src="external/prev.png" class="stationsprev" alt="Prev" />
<span class="stationspagedisplay"></span>
<img src="external/next.png" class="stationsnext" alt="Next" />
<img src="external/last.png" class="stationslast" alt="Last" />
<select class="stationspagesize" title="Select page size">
<option value="5">5</option>
<option value="10">10</option>
<option value="15">15</option>
<option value="20">20</option>
<option value="25">25</option>
<option value="30">30</option>
<option value="35">35</option>
</select>
<select class="stationsgotoPage" title="Select page number"></select>
</div>
<table class="tablesorter" id="stationstable">
<colgroup>
<col width="77" />
<col/>
<col width="100" align="char" char="." />
<col width="100" align="char" char="." />
</colgroup>
<thead>
<tr>
<th>Network</th>
<th>Station</th>
<th>Latitude [°]</th>
<th>Longitude [°]</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<p class="table-caption">Download as <a id="stations-csv-link" href="link" download="stations.csv">CSV file</a>.</p>
</div>
<!-- More -->
<div class="tab" id="moretab"><!--include virtual="more.html.de" --></div>
<!-- Info -->
<div class="tab" id="infotab">
<div id="infoaccordion">
<h3 class="aheader">Navigation / Links</h3>
<!--#include virtual="info.inc.de" -->
<h3 class="aheader">Copyright / License</h3>
<!--#include virtual="copyright.inc.de" -->
<h3 class="aheader">Imprint</h3>
<!--#include virtual="impressum.inc.de" -->
<div>
</div>
</div>
</div>
</div>
<!-- Logo -->
<div class="rublogo"><a href="http://www.gmg.ruhr-uni-bochum.de/geophysik/seisobs"><img class="rublogo" src="logo_RUB_155x30.png" alt="Ruhr-University Bochum" title="Ruhr-University Bochum" border="0"/></a></div>
<!-- Map -->
<div id="map" class="map"></div>
<div id="spinner" class="spinner" style="display:none;"><img id="img-spinner" src="spinner.gif" alt="Loading"/><br />Loading ...</div>
</body>
</html>
+21
View File
@@ -0,0 +1,21 @@
<div class="accordioncontent">
<h4>Navigation zu den Internetseiten</h4>
<ul>
<li>des <a class="intern" href="http://www.gmg.ruhr-uni-bochum.de/geophysik/seisobs">Seismologisches Observatorium</a><br /> der Ruhr-Universität Bochum</li>
<li>der <a class="intern" href="http://www.gmg.ruhr-uni-bochum.de/geophysik/seismology">Arbeitsgruppe Seismologie</a></li>
<li>des <a class="intern" href="http://www.gmg.ruhr-uni-bochum.de">Instituts für Geologie, Mineralogie und Geophysik</a></li>
<li>der <a class="intern" href="http://www.rub.de">Ruhr-Universität Bochum</a></li>
</ul>
<h4>Informationen zu Erdbeben</h4>
<ul>
<li>in <a class="extern" target="_blank" href="http://www.gd.nrw.de/a_beben.php">NRW</a> (<a class="extern" target="_blank" href="http://www.gd.nrw.de">Geologischer Dienst NRW</a>)</li>
<li>in <a class="extern" target="_blank" href="http://www.bgr.bund.de/DE/Themen/Erdbeben-Gefaehrdungsanalysen/Seismologie/Seismologie/Seis-Online/Liste_D_1Jahr/li_d_1jahr_node.html">Deutschland</a> (<a class="extern" target="_blank" href="http://www.bgr.bund.de">BGR Hannover</a>)</li>
<li>in <a class="extern" target="_blank" href="http://www.emsc-csem.org">Europa / Mittelmeerraum</a> (<a class="extern" target="_blank" href="http://www.emsc-csem.org">EMSC</a>)</li>
<li><a class="extern" target="_blank" href="http://geofon.gfz-potsdam.de/eqinfo/seismon/globmon.php">weltweit</a> (<a class="extern" target="_blank" href="http://geofon.gfz-potsdam.de">GEOFON, GFZ Potsdam</a>)</li>
<li><a class="extern" target="_blank" href="http://earthquake.usgs.gov/earthquakes/map/">weltweit</a> (<a class="extern" target="_blank" href="http://earthquake.usgs.gov/">USGS</a>)</li>
</ul>
<h4>Informationen zum Steinkohlenabbau in NRW</h4>
<ul>
<li>Homepage der <a class="extern" target="_blank" href="http://www.rag.de">RAG</a></li>
<li><a class="extern" target="_blank" href="http://www.bid.rag.de">Bürgerinformationssystem</a> der RAG</li>
</div>
+35
View File
@@ -13,6 +13,20 @@
height: 100%;
font-family: sans-serif;
}
div.noscript {
z-index: 20000;
position: absolute;
left: 0px;
top: 0px;
width: 100%;
height: 200%;
background: rgb(255, 255, 255);
}
div.noscriptcontent {
z-index: 20010;
margin: 45px;
font-size: small;
}
div.info {
z-index: 10000;
position: absolute;
@@ -38,6 +52,12 @@
background: rgb(255, 255, 255);
background: rgba(25, 255, 255, 0.95);
}
div.accordioncontent {
z-index: 10010;
margin: 0px!important;
padding: 5px!important;
font: sans-serif;
}
div.rublogo {
z-index: 10000;
position: absolute;
@@ -64,4 +84,19 @@
td.ar {
text-align: right;
}
p.table-caption {
font-size: smaller;
}
div.spinner {
position: fixed;
top: 50%;
left: 50%;
margin-left: -64px; /* half width of the spinner gif */
margin-top: -8px; /* half height of the spinner gif */
text-align:center;
z-index: 19000;
overflow: auto;
width: 128px; /* width of the spinner gif */
height: 40px; /*hight of the spinner gif +2px to fix IE8 issue */
}
</style>
+175 -121
View File
@@ -1,117 +1,107 @@
/* toggles visibility of filtered markers
* only events in the event list are shown */
function toggleFilteredMarkers() {
// show all shown events in map
$("#eventstable > tbody > tr:not(.filtered) > td > a.map-link").each( function() {
if ( $(this).attr("eventid") ) {
eventTable[$(this).attr("eventid")].setStyle({opacity: 1, strokeOpacity: 1, fillOpacity: eventMarkerOpacity});
};
});
/**********************************************************************
* map.js *
* script for map specific functions and setup *
**********************************************************************/
// hide filtered events in map
$("#eventstable > tbody > tr.filtered > td > a.map-link").each( function() {
if ( $(this).attr("eventid") ) {
eventTable[$(this).attr("eventid")].setStyle({opacity: 0, strokeOpacity: 0, fillOpacity: 0});
};
});
highlightFirstEvent();
};
/* License
Copyright 2020 Kasper D. Fischer <kasper.fischer@rub.de>
/* Highlight the first event of the event list on the map if no
* other event is selected */
function highlightFirstEvent() {
var highlightStyle = {
color: 'red',
fillColor: '#f03',
};
var normalStyle = {
fillColor: "#FFF500",
color: "#FFF500"
};
$("#eventstable a.map-link").each( function() {
if ( $(this).attr("eventid") ) {
eventTable[$(this).attr("eventid")].setStyle(normalStyle);
$(this).removeClass('first');
$(this).text('Karte');
};
});
$("#eventstable > tbody > tr:not(.filtered)").first().find("a.map-link").each(function() {
if ( $(this).attr("eventid") ) {
eventTable[$(this).attr("eventid")].setStyle(highlightStyle);
$(this).addClass('first');
$(this).text('Karte (rot)');
};
});
};
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
function highlightEvent( id ) {
var highlightStyle = {
color: 'red',
fillColor: '#f03',
};
var normalStyle = {
fillColor: "#FFF500",
color: "#FFF500"
};
$("#eventstable > tbody > tr:not(.filtered)").find("a.map-link").each( function() {
if ( $(this).attr("eventid") ) {
if ( $(this).attr("eventid") == id ) {
eventTable[$(this).attr("eventid")].setStyle(highlightStyle);
$(this).addClass('first');
$(this).text('Karte (rot)');
} else {
eventTable[$(this).attr("eventid")].setStyle(normalStyle);
$(this).removeClass('first');
$(this).text('Karte');
}
};
});
};
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License along
with this program. If not, see https://www.gnu.org/licenses/.
$Id$
*/
/* add station marker */
function addStationMarker(id, lat, lng) {
var a = 0.0025,
b = Math.sqrt(3)*a,
a = a * Math.cos(lat*Math.PI/180);
var corners = [L.latLng(lat+2*a, lng), L.latLng(lat-a, lng+b), L.latLng(lat-a, lng-b)];
var marker = L.polygon(corners,
function addStationMarker(id, lat, lng, station) {
var marker = L.triangleMarker(L.latLng(lat, lng),
{
fillColor: "#1C771C",
color: "#1C771C",
gradient: true,
fillColor: config['station']['markerColor'],
fillOpacity: config['station']['markerOpacity'],
color: config['station']['markerColor'],
weight: 1,
opacity: 1,
fillOpacity: stationMarkerOpacity,
radius: config['station']['markerSize'][id] || config['station']['markerSize']['defaultSize'],
className: id+' stationMarker',
}).addTo(stationLayer);
});
marker.bindLabel('Station '+station);
stationLayer.addLayer(marker);
stationTable[id] = marker;
};
};
/* add event marker */
function addEventMarker(id, lat, lng, mag) {
var markerOptions = {
fillColor: "#FFF500",
color: "#FFF500",
weight: 1,
opacity: 1,
fillOpacity: eventMarkerOpacity,
className: id+' eventMarker',
function addEventMarker(id, lat, lng, mag, type) {
if ( eventTable[id] ) {
return eventTable[id];
} else {
var markerOptions = {
gradient: true,
dropShadow: false,
fillColor: config['event']['markerColor'],
fillOpacity: config['event']['markerOpacity'],
color: config['event']['markerColor'],
weight: 0,
opacity: 1,
className: id+' eventMarker',
radius: mag2radius(mag)
};
var marker;
switch ( 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'];
markerOptions['innerRadius'] = 0.3*markerOptions['radius'];
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);
break;
default:
marker = L.circleMarker(L.latLng(lat, lng), markerOptions);
};
eventLayer.addLayer(marker);
eventTable[id] = marker;
return marker;
};
var marker = L.circle(L.latLng(lat, lng), mag2radius(mag), markerOptions).addTo(eventLayer);
eventTable[id] = marker;
return marker;
};
};
/* handle to show events on map */
function initMapLink() {
$("#eventstable > tbody > tr > td > a.map-link").off('click');
$("#eventstable > tbody > tr > td > a.map-link").on('click' , function(){
var highlightStyle = {
color: 'red',
fillColor: '#f03',
color: config['event']['markerColorH'],
fillColor: config['event']['markerColorH'],
fillOpacity: 1,
className: $(this).attr('eventid')
}
var normalStyle = {
fillColor: "#FFF500",
color: "#FFF500"
fillColor: config['event']['markerColor'],
fillOpacity: config['event']['markerOpacity'],
color: config['event']['markerColor']
};
// mark currently selected link and remove class selected from all other links
// set everything to normal state
@@ -129,64 +119,128 @@ function initMapLink() {
if ( $(this).hasClass('selected') ) {
$(this).removeClass('selected');
$(this).text('Karte');
map.setView(config['map']['centerDefault'], config['map']['zoomDefault']);
eventTable[$(this).attr('eventid')].setStyle(normalStyle);
map.setView(mapCentreDefault, zoomDefault);
highlightFirstEvent();
// unselected -> selected
} else {
$(this).addClass('selected');
$(this).text('im Fokus (rot)');
eventTable[$(this).attr('eventid')].setStyle(highlightStyle);
map.setView(eventTable[$(this).attr('eventid')].getLatLng(), zoomFocus);
map.setView(eventTable[$(this).attr('eventid')].getLatLng(), config['map']['zoomFocus']);
eventTable[$(this).attr('eventid')].setStyle(highlightStyle)
};
});
return false;
});
};
/******************
* document ready *
******************/
/**********************************************************************
* document ready *
**********************************************************************/
$(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(mapCentreDefault, zoomDefault);
new L.Control.Zoom({ position: 'topright' }).addTo(map);
// add MapQuestOSM tile layer
// L.tileLayer.grayscale('http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg',
L.tileLayer('http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg',
// 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('https://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png',
{
subdomains: '1234',
detectRetina: true,
attribution: 'Map data &copy; <a href="https://openstreetmap.org">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a> | Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a> <img src="https://developer.mapquest.com/content/osm/mq_logo.png">',
attribution: '&copy; <a href="https://openstreetmap.org">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>',
}).addTo(map);
// add ESRI Grayscale World Map (neither city nor road names)
/* L.tileLayer('//server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}',
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 &copy; Esri &mdash; Esri, DeLorme, NAVTEQ',
maxZoom: 16
}).addTo(map); */
}).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('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
{
attribution: 'Tiles &copy; Esri &mdash; 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 &copy; <a href="https://openstreetmap.org">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a> | Tiles Courtesy of <a href="https://www.komoot.de/">Komoot</a>',
}).addTo(map);
break;
case 'mapquestgray': // add MapQuestOSM tile layer
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 &copy; <a href="https://openstreetmap.org">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a> | Tiles Courtesy of <a href="https://www.mapquest.com/">MapQuest</a> <img src="https://developer.mapquest.com/content/osm/mq_logo.png">',
//}).addTo(map);
//break;
case 'mapquest': // add MapQuestOSM tile layer
null;
default:
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 &copy; <a href="https://openstreetmap.org">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a> | Tiles Courtesy of <a href="https://www.mapquest.com/">MapQuest</a> <img src="https://developer.mapquest.com/content/osm/mq_logo.png">',
//}).addTo(map);
};
// read in stations
stationLayer = L.geoJson().addTo(map);
// add controls
new L.Control.Zoom({ position: 'topright' }).addTo(map);
new L.control.scale({position: 'bottomright', imperial: false}).addTo(map);
// read in events, process filter
eventLayer = L.geoJson().addTo(map);
// create station and event layer
// stationLayer = L.geoJson().addTo(map);
stationLayer = new L.MarkerGroup().addTo(map);
eventLayer = new L.MarkerGroup().addTo(map);
// load events
ajaxLoadEvents('', '', '', 'events.xml');
ajaxLoadEvents();
specialEvents.map(function(id) {
ajaxLoadEvents('', '', id)
});
toggleFilteredMarkers();
// bind popupopen event
map.on('popupopen', function() {
// convert date/time to localtime
$("div.leaflet-popup span.utctime").each(function(){$(this).addClass("localtime").removeClass("utctime");$.localtime.formatObject($(this), "dd.MM.yyyy - HH:mm")});
var eventid = $("div.leaflet-popup h3").attr("eventid");
if ( eventid ) {
// highlight event in table
highlightEvent(eventid);
openMarkerID = $("div.leaflet-popup h3").attr("eventid");
if ( openMarkerID ) {
// update city in popup
$("div.leaflet-popup h3").text(geolocationTable[eventid]);
$("div.leaflet-popup h3").text(geolocationTable[openMarkerID]);
// highlight event in table and show details
// highlightEvent(eventid);
$('#eventstable > tbody > tr > td > a.toggle').each(function() {
if ( $(this).attr('eventid') == openMarkerID ) {
$(this)[0].click();
};
});
};
});
map.on('popupclose', function() {
$('#eventstable > tbody > tr > td > a.toggle').each(function() {
if ( $(this).attr('eventid') == openMarkerID ) {
$(this)[0].click();
};
});
});
// print icon
L.easyPrint().addTo(map);
});
+246
View File
@@ -0,0 +1,246 @@
/**********************************************************************
* map.js *
* script for map specific functions and setup *
**********************************************************************/
/* License
Copyright 2020 Kasper D. Fischer <kasper.fischer@rub.de>
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License along
with this program. If not, see https://www.gnu.org/licenses/.
$Id$
*/
/* add station marker */
function addStationMarker(id, lat, lng, station) {
var marker = L.triangleMarker(L.latLng(lat, lng),
{
gradient: true,
fillColor: config['station']['markerColor'],
fillOpacity: config['station']['markerOpacity'],
color: config['station']['markerColor'],
weight: 1,
opacity: 1,
radius: config['station']['markerSize'][id] || config['station']['markerSize']['defaultSize'],
className: id+' stationMarker',
});
marker.bindLabel('Station '+station);
stationLayer.addLayer(marker);
stationTable[id] = marker;
};
/* add event marker */
function addEventMarker(id, lat, lng, mag, type) {
if ( eventTable[id] ) {
return eventTable[id];
} else {
var markerOptions = {
gradient: true,
dropShadow: false,
fillColor: config['event']['markerColor'],
fillOpacity: config['event']['markerOpacity'],
color: config['event']['markerColor'],
weight: 0,
opacity: 1,
className: id+' eventMarker',
radius: mag2radius(mag)
};
var marker;
switch ( 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'];
markerOptions['innerRadius'] = 0.3*markerOptions['radius'];
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);
break;
default:
marker = L.circleMarker(L.latLng(lat, lng), markerOptions);
};
eventLayer.addLayer(marker);
eventTable[id] = marker;
return marker;
};
};
/* handle to show events on map */
function initMapLink() {
$("#eventstable > tbody > tr > td > a.map-link").off('click');
$("#eventstable > tbody > tr > td > a.map-link").on('click' , function(){
var highlightStyle = {
color: config['event']['markerColorH'],
fillColor: config['event']['markerColorH'],
fillOpacity: 1,
className: $(this).attr('eventid')
}
var normalStyle = {
fillColor: config['event']['markerColor'],
fillOpacity: config['event']['markerOpacity'],
color: config['event']['markerColor']
};
// mark currently selected link and remove class selected from all other links
// set everything to normal state
$(this).addClass('selected-now');
$("#eventstable > tbody > tr:not(.filtered) > td > a.map-link:not(.selected-now)").each(function(){
$(this).removeClass('selected');
$(this).text('Karte');
eventTable[$(this).attr('eventid')].setStyle(normalStyle);
});
// switch event of first row to normalStyle if it is not the selected one
( $(this).hasClass('first') ) ? null : eventTable[$("#eventstable > tbody > tr:not(.filtered)").first().find("a.map-link").attr("eventid")].setStyle(normalStyle);
$(this).each(function(){
$(this).removeClass('selected-now');
// selected -> unselected
if ( $(this).hasClass('selected') ) {
$(this).removeClass('selected');
$(this).text('Karte');
map.setView(config['map']['centerDefault'], config['map']['zoomDefault']);
eventTable[$(this).attr('eventid')].setStyle(normalStyle);
highlightFirstEvent();
// unselected -> selected
} else {
$(this).addClass('selected');
$(this).text('at focus (red)');
map.setView(eventTable[$(this).attr('eventid')].getLatLng(), config['map']['zoomFocus']);
eventTable[$(this).attr('eventid')].setStyle(highlightStyle)
};
});
return false;
});
};
/**********************************************************************
* document ready *
**********************************************************************/
$(document).ready(function() {
// create a map in the "map" div, set the view to a given place and zoom
// 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('https://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png',
{
attribution: '&copy; <a href="https://openstreetmap.org">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>',
}).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 &copy; Esri &mdash; Esri, DeLorme, NAVTEQ',
maxZoom: 16
}).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('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
{
attribution: 'Tiles &copy; Esri &mdash; 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 &copy; <a href="https://openstreetmap.org">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a> | Tiles Courtesy of <a href="https://www.komoot.de/">Komoot</a>',
}).addTo(map);
break;
case 'mapquestgray': // add MapQuestOSM tile layer
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 &copy; <a href="https://openstreetmap.org">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a> | Tiles Courtesy of <a href="https://www.mapquest.com/">MapQuest</a> <img src="https://developer.mapquest.com/content/osm/mq_logo.png">',
//}).addTo(map);
//break;
case 'mapquest': // add MapQuestOSM tile layer
null;
default:
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 &copy; <a href="https://openstreetmap.org">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a> | Tiles Courtesy of <a href="https://www.mapquest.com/">MapQuest</a> <img src="https://developer.mapquest.com/content/osm/mq_logo.png">',
//}).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);
eventLayer = new L.MarkerGroup().addTo(map);
// load events
ajaxLoadEvents('', '', '', 'events.xml');
ajaxLoadEvents();
specialEvents.map(function(id) {
ajaxLoadEvents('', '', id)
});
toggleFilteredMarkers();
// bind popupopen event
map.on('popupopen', function() {
// convert date/time to localtime
$("div.leaflet-popup span.utctime").each(function(){$(this).addClass("localtime").removeClass("utctime");$.localtime.formatObject($(this), "dd.MM.yyyy - HH:mm")});
openMarkerID = $("div.leaflet-popup h3").attr("eventid");
if ( openMarkerID ) {
// update city in popup
$("div.leaflet-popup h3").text(geolocationTable[openMarkerID]);
// highlight event in table and show details
// highlightEvent(eventid);
$('#eventstable > tbody > tr > td > a.toggle').each(function() {
if ( $(this).attr('eventid') == openMarkerID ) {
$(this)[0].click();
};
});
};
});
map.on('popupclose', function() {
$('#eventstable > tbody > tr > td > a.toggle').each(function() {
if ( $(this).attr('eventid') == openMarkerID ) {
$(this)[0].click();
};
});
});
// print icon
L.easyPrint().addTo(map);
});
+171 -33
View File
@@ -1,23 +1,38 @@
// calculate marker radius from magnitude, both formulas have equal radii at mag=1.2
/**********************************************************************
* misc.js *
* script for unspecific functions and setup *
**********************************************************************/
/* License
Copyright 2020 Kasper D. Fischer <kasper.fischer@rub.de>
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
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/.
$Id$
*/
/* calculate marker radius from magnitude
* both formulas have equal radii at mag=1.2 */
function mag2radius(mag) {
return 400*mag; // radius proportional to magagnitude
return 3*mag; // radius proportional to magagnitude
// return 8.104*Math.pow(30,mag) // radius proportional to energy
};
// set height of eventlist div
function sleep(milliseconds) {
var start = new Date().getTime();
for (var i = 0; i < 1e7; i++) {
if ((new Date().getTime() - start) > milliseconds){
break;
}
}
}
/* set height of eventlist div */
function setInfoHeight() {
var height = $('div.map').height() - 36;
$('div.info').height(height);
//$('.tab').height(height-80);
//$('#eventtable').height(height-100);
};
/* get region and regionID of a location */
@@ -51,36 +66,159 @@ function getLocation(lat, lng) {
return [ region, regionID ];
};
// window resize
/* window resize */
$( window ).resize(function() {
setInfoHeight();
});
// create global vars
var map
/* parseQueryString */
function parseQueryString() {
var query = (window.location.search || '?').substr(1),
map = {};
query.replace(/([^&=]+)=?([^&]*)(?:&+|$)/g, function(match, key, value) {
key.toLowerCase();
(map[key] = map[key] || []).push(value);
});
return map;
}
/* create global vars */
var map;
var openMarkerID;
var eventTable = {};
var geolocationTable = {};
var eventDetails = {};
var stationTable = {};
var eventMarkerOpacity = 0.3;
var stationMarkerOpacity = 0.5;
var zoomFocus = 12;
var zoomDefault = 9;
var mapCentreDefault = [51.85, 7.0];
var minMag = 1.2;
var config = {
ajax: {
timeout: 20000, // 20 seconds
eventURL: 'https://fdsnws.geophysik.ruhr-uni-bochum.de/fdsnws/event/1/query',
dlsvURL: 'dlsv',
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,
},
event: {
evaluationBlacklist: ['automatic', 'preliminary', 'rejected'],
markerOpacity: 0.4,
markerColor: 'blue',
markerColorH: 'red',
minMag: 1.2,
minMagDelta: 0.1,
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,
zoomFocus: 12,
centerDefault: [51.85, 7.0],
timespan: 180,
latlngDelta: 0.1,
},
station: {
markerColor: 'darkgreen',
markerOpacity: 1,
markerSize: {
defaultSize: 8,
GE_IBBN: 10,
GR_BUG: 10,
GR_KAST: 10,
NL_HGN: 3,
NL_OPLO: 3,
NL_VKB: 3,
NL_WIT: 3,
NL_WTSB: 3,
},
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,
disabled: [2],
max: 4,
},
};
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: '<a href="'+networkURL['GE']+'" target="_blank">GEOFON Seismic Network</a> - Deutsches GeoForschungsZentrum GFZ',
GR: '<a href="'+networkURL['GR']+'" target="_blank">German Regional Seismic Network</a>, BGR Hannover',
NH: '<a href="'+networkURL['NH']+'" target="_blank">Geologischer Dienst NRW</a>, Krefeld',
NL: '<a href="'+networkURL['NL']+'" target="_blank">Netherlands Seismic Network</a>, The Netherlands',
RN: '<a href="'+networkURL['RN']+'" target="_blank">RuhrNet - Ruhr-University Bochum, Germany</a>',
YD: '<a href="'+networkURL['YD']+'" target="_blank">FloodRisk Seismic Network</a>',
};
var bochumStation = ['BUG', 'IBBN', 'KERA', 'KARP'];
// run when ready
// FIX: firefox has no console
if (typeof console == "undefined") var console = { log: function() {} };
/**********************************************************************
* document ready *
**********************************************************************/
$(document).ready(function() {
// parse query string
var parameters = parseQueryString();
if ( parameters['baselayer'] ) {
config['map']['baselayer'] = parameters['baselayer'][0];
};
if ( Number(parameters['lat']) && Number(parameters['lon']) ) {
config['map']['centerDefault'] = [Number(parameters['lat']), Number(parameters['lon'])];
};
if ( Number(parameters['minmag']) ) {
config['event']['minMag'] = Number(parameters['minmag']);
};
if ( parameters['eventcolor'] ) {
config['event']['markerColor'] = parameters['eventcolor'];
};
if ( parameters['eventcolorh'] ) {
config['event']['markerColorH'] = parameters['eventcolorh'];
};
if ( parameters['stationcolor'] ) {
config['station']['markerColor'] = parameters['stationcolor'];
};
if ( Number(parameters['timespan']) ) {
config['map']['timespan'] = Number(parameters['timespan']);
};
if ( Number(parameters['tab']) ) {
if ( Number(parameters['tab']) < config['tab']['max'] ) {
config['tab']['active'] = Number(parameters['tab']);
};
};
// AJAX setup
$.ajaxSetup({timeout: 15000}); // 15 seconds
$.ajaxSetup({timeout: config['ajax']['timeout']});
// adjust height of infocontainer
setInfoHeight();
// create tabs
var tabOptions = {
active: 0,
disabled: [2, 3],
};
$('#tabs').tabs(tabOptions);
// $('.ui-tabs-nav').sortable();
});
// create tabs
$('#tabs').tabs({
active: config['tab']['active'],
disabled: config['tab']['disabled'],
activate: function( event, ui ) { ui['newPanel'].find('table').trigger("update", [true]); },
});
// create accordions
$( '#infoaccordion' ).accordion({
active: 0,
header: 'h3.aheader',
heightStyle: 'content',
animate: 200,
});
// spinner
$(document).bind("ajaxSend", function() {
$("#spinner").show();
}).bind("ajaxStop", function() {
$("#spinner").hide();
});
});
+1
View File
@@ -0,0 +1 @@
Das seismologische Netz der Ruhr-Universität besteht aus 13 Stationen. Zwei breitbandige Stationen (BUG und IBBN) sind gleichzeitig Bestandteil des Deutschen Seismologischen Regionalnetzes (GRSN). Sie befinden sich in der Nähe der Ruhr-Universität in einem stillgelegten Stollen der Zeche Klosterbusch bzw. bei Ibbenbüren. Weitere Außenstationen gibt es bei Rheinberg (BRHE) und Hünxe (ZERL, westliches Ruhrgebiet), bei Haltern (BAVN, nörldiches Ruhrgebiet) und Hamm (HMES, östliches Ruhrgebiet). In Ibbenbüren ergänzen die kurzperiodischen Stationen IBBE und IBBS das Stationsnetz. Im Bereich der Ruhr-Universität werden weiterhin 5 kurzperiodische Stationen (BTEZ, BSHA, BKLB, BHOF, BULI) betrieben, die zur Ortung von Ereignissen im Ruhrgebiet verwendet werden. Das von den Seismometern registrierte Messsignal wird an den Stationen digitalisiert und kontinuierlich an die Auswertezentrale an der Ruhr-Universität Bochum übertragen.
+37
View File
@@ -0,0 +1,37 @@
/* $Id$ */
var specialEvents = [
//'bug2014ytlk', // Vechta 3.0
//'bug2014wjwx', // Haltern 3.6
//'bug2014ldts', // Darmstadt
//'bug2014kowj', // Vogtland 5.0
//'bug2014jptq', // Seeheim-Jugenheim
//'bug2014infb', // Troisdorf
//'bug2014ilxd', // Bassum
//'bug2014gfzw', // Darmstadt
//'bug2014datb', // Groningen
// '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
];
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

+175 -27
View File
@@ -1,48 +1,110 @@
// Load the stations using ajax
function loadStations(stime, etime) {
/**********************************************************************
* stations.js *
* script for station specific functions and setup *
**********************************************************************/
/* License
Copyright 2020 Kasper D. Fischer <kasper.fischer@rub.de>
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
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/.
$Id$
*/
/* Load the stations using ajax */
function loadStations(station, stime, etime) {
var mapBounds = map.getBounds();
var N = mapBounds.getNorth();
var E = mapBounds.getEast();
var S = mapBounds.getSouth();
var W = mapBounds.getWest();
var d = 0.1;
var url = "https://ariadne.geophysik.ruhr-uni-bochum.de/fdsnws/station/1/query";
if ( !stime ) {
var stime = new Date();
stime.setDate(stime.getDate()-180);
stime.setDate(stime.getDate()-config['map']['timespan']);
};
if ( !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()),
minlat: S-d,
maxlat: N+d,
minlon: W-d,
maxlon: E+d,
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",
url: url,
url: config['ajax']['stationURL'],
dataType: "xml",
data: request_data,
success: function (xml) {
$(xml).find('Network').each(function () {
var network = $(this).attr('code');
$(this).find('Station').each(function () {
var station = $(this).attr('code'),
lat = $(this).find('Latitude').text(),
lng = $(this).find('Longitude').text(),
stationID = network+'.'+station;
if ( !stationTable[stationID] ) { // && N >= lat && S <= lat && W<= lng && E >= lng
var row = sprintf('<tr><td>%s</td><td>%s</td><td class="ar">%7.4f</td><td class="ar">%7.4f</td></tr>' , network, station, Number(lat), Number(lng));
var r = $(row);
$('#stationstable tbody').append(r);
addStationMarker(stationID, Number(lat), Number(lng));
};
});
if ( $.inArray(network, config['station']['networkBlacklist'])<0 ) {
$(this).find('Station').each(function () {
var station = $(this).attr('code'),
lat = $(this).find('Latitude:first').text(),
lng = $(this).find('Longitude:first').text(),
stationID = network+'_'+station,
stationText = network+'.'+station;
if ( !stationTable[stationID] && $.inArray(stationID, config['station']['stationBlacklist']) <0 ) {
// general station info (1st line)
var row = sprintf('<tr><td><a href="#" class="toggle">%s</a></td><td><a href="#" class="toggle">%s</a></td><td class="ar">%7.4f</td><td class="ar">%7.4f</td></tr>' , network, station, Number(lat), Number(lng));
// setting up network details (2nd line)
row += sprintf('<tr class="tablesorter-childRow station-details"><td colspan="4">%s', networkText[network] || '');
row += ( $.inArray(station, bochumStation)+1 ) ? '<br /><em>Betreiber:</em> Ruhr-Universität Bochum</td></tr>' : '</td></tr>' ;
if ( network == 'RN' || network == 'Z3' || network == '1A' || network == 'YD' || $.inArray(station, bochumStation)+1 ) {
// setting up station details (3rd line)
row += '<tr class="tablesorter-childRow station-details"><td colspan="4">';
row += stationDetails(station, network, lat, lng, stationID, stationText, $(this));
row += '</td></tr>';
// setting up download links (4th line)
var URL, fdsnxmlURL, fdsnxmlRespURL, sc3mlURL, sc3mlRespURL, dlsvURL;
URL = sprintf('%s?network=%s&station=%s', config['ajax']['stationURL'], network, station);
fdsnxmlURL = URL + '&level=station&format=xml';
fdsnxmlRespURL = URL + '&level=response&format=xml';
sc3mlURL = URL + '&level=station&format=sc3ml';
sc3mlRespURL = URL + '&level=response&format=sc3ml';
dlsvFile = sprintf('%s_%s.dlsv', network.toUpperCase(), station.toUpperCase());
row += '<tr class="tablesorter-childRow station-download"><td colspan="4">'
+ sprintf('Download details: <a download="%s.xml" href="%s" target="_blank">FDSNxml</a> or <a download="%s.sc3" href="%s" target="_blank">SC3ml</a><br /> ', stationID, fdsnxmlURL, stationID, sc3mlURL)
+ sprintf('Response files: <a download="%s_response.xml" href="%s" target="_blank">FDSNxml</a>, <a download="%s_response.sc3" href="%s" target="_blank">SC3ml</a> ', stationID, fdsnxmlRespURL, stationID, sc3mlRespURL)
+ sprintf('or <a href="%s" download="%s" type="application/octet-stream">datalessSEED</a>', config['ajax']['dlsvURL'] + '/' + dlsvFile, dlsvFile.toLowerCase())
+ '</td></tr>';
}
else {
row += '<tr class="tablesorter-childRow station-details"><td colspan="4">Kontaktieren Sie den ';
row += ( networkURL[network.toUpperCase()] ) ? '<a href="'+networkURL[network.toUpperCase()]+'" target="_blank">Netzwerkkoordinator</a>' : 'Netzwerkkoordinator';
row += ' für weitere Details.</td></tr>';
};
$('#stationstable tbody').append(row);
addStationMarker(stationID, Number(lat), Number(lng), stationText.toUpperCase());
};
});
};
});
},
complete: function () {
@@ -53,10 +115,46 @@ function loadStations(stime, etime) {
$("#stationstable").trigger("sorton", [sort]);
$("#stationstable > tbody > tr:even").addClass("odd");
$("#stationstable > tbody > tr:odd").addClass("even");
stationLayer.bringToFront();
},
error: function( jqxhr, textStatus, error ) {
var err = textStatus + ", " + error;
console.log( "Request Failed: " + err );
}
});
// create stations csv download link
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));
};
/* format station Details */
function stationDetails(station, network, lat, lng, stationId, stationText, stationObject) {
var output;
var elevation = stationObject.find('Elevation:first').text();
var name = stationObject.find('Site > Name').text();
output = '<pre>'
+ name + '<br />'
+ 'Position: ' + lat + '°N ' + lng + '°E, Höhe: ' + elevation + ' m NN<br />';
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 += '<br />Kanal ' + code + ', Abtastrate ' + sampleRate + ' Hz, Sensor ' + sensor;
});
output += '</pre>';
return output;
};
/* initStationTable */
function initStationTable() {
// tablesorter for station list
$("#stationstable").tablesorter(
@@ -85,7 +183,7 @@ function initStationTable() {
// css class names of pager arrows
pager_css: {
container : 'stations-tablesorter-pager',
errorRow : 'tablesorter-errorRow', // error information row (don't include period at beginning)
errorRow : 'stations-tablesorter-errorRow', // error information row (don't include period at beginning)
disabled : 'disabled' // class added to arrows @ extremes (i.e. prev/first arrows "disabled" on first page)
},
// jQuery pager selectors
@@ -101,7 +199,7 @@ function initStationTable() {
},
filter_childRows : true,
filter_cssFilter : 'tablesorter-filter',
filter_cssFilter : 'stations-tablesorter-filter',
filter_startsWith : false,
filter_ignoreCase : true,
scroller_height: $('div.map').height() - 250,
@@ -112,7 +210,57 @@ function initStationTable() {
showProcessing: true,
}
});
// hide child rows
$('#stationstable > tbody > tr.tablesorter-childRow > td').hide();
// update map after filtering
// $('#stationsstable').bind('filterEnd', function(){
// toggleFilteredMarkers();
// });
};
/**********************************************************************
* document ready *
**********************************************************************/
$(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
$(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');
$(this).closest('tbody').find('td.selected').each(function(){
if ( ! $(this).hasClass('selected-now') ) {
$(this).hide();
$(this).removeClass('selected');
};
});
$(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').each(function(){
$(this).removeClass('selected-now');
var selected = $(this).hasClass('selected');
if ( selected ) {
$(this).removeClass('selected');
//highlightFirstEvent();
} else {
$(this).addClass('selected');
//toggleHighlightStation($(this).attr('stationid'));
};
});
return false;
});
});
+266
View File
@@ -0,0 +1,266 @@
/**********************************************************************
* stations.js *
* script for station specific functions and setup *
**********************************************************************/
/* License
Copyright 2020 Kasper D. Fischer <kasper.fischer@rub.de>
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
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/.
$Id$
*/
/* Load the stations using ajax */
function loadStations(station, 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']);
};
if ( !etime ) {
var etime = new Date();
etime.setDate(etime.getDate()+1);
};
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",
url: config['ajax']['stationURL'],
dataType: "xml",
data: request_data,
success: function (xml) {
$(xml).find('Network').each(function () {
var network = $(this).attr('code');
if ( $.inArray(network, config['station']['networkBlacklist'])<0 ) {
$(this).find('Station').each(function () {
var station = $(this).attr('code'),
lat = $(this).find('Latitude:first').text(),
lng = $(this).find('Longitude:first').text(),
stationID = network+'_'+station,
stationText = network+'.'+station;
if ( !stationTable[stationID] && $.inArray(stationID, config['station']['stationBlacklist']) <0 ) {
// general station info (1st line)
var row = sprintf('<tr><td><a href="#" class="toggle">%s</a></td><td><a href="#" class="toggle">%s</a></td><td class="ar">%7.4f</td><td class="ar">%7.4f</td></tr>' , network, station, Number(lat), Number(lng));
// setting up network details (2nd line)
row += sprintf('<tr class="tablesorter-childRow station-details"><td colspan="4">%s', networkText[network] || '');
row += ( $.inArray(station, bochumStation)+1 ) ? '<br /><em>Operator:</em> Ruhr-University Bochum, Germany</td></tr>' : '</td></tr>' ;
if ( network == 'RN' || network == 'Z3' || network == '1A' || network == 'YD' || $.inArray(station, bochumStation)+1 ) {
// setting up station details (3rd line)
row += '<tr class="tablesorter-childRow station-details"><td colspan="4">';
row += stationDetails(station, network, lat, lng, stationID, stationText, $(this));
row += '</td></tr>';
// setting up download links (4th line)
var URL, fdsnxmlURL, fdsnxmlRespURL, sc3mlURL, sc3mlRespURL, dlsvURL;
URL = sprintf('%s?network=%s&station=%s', config['ajax']['stationURL'], network, station);
fdsnxmlURL = URL + '&level=station&format=xml';
fdsnxmlRespURL = URL + '&level=response&format=xml';
sc3mlURL = URL + '&level=station&format=sc3ml';
sc3mlRespURL = URL + '&level=response&format=sc3ml';
dlsvFile = sprintf('%s_%s.dlsv', network.toUpperCase(), station.toUpperCase());
row += '<tr class="tablesorter-childRow station-download"><td colspan="4">'
+ sprintf('Download details: <a download="%s.xml" href="%s" target="_blank">FDSNxml</a> or <a download="%s.sc3" href="%s" target="_blank">SC3ml</a><br /> ', stationID, fdsnxmlURL, stationID, sc3mlURL)
+ sprintf('Response files: <a download="%s_response.xml" href="%s" target="_blank">FDSNxml</a>, <a download="%s_response.sc3" href="%s" target="_blank">SC3ml</a> ', stationID, fdsnxmlRespURL, stationID, sc3mlRespURL)
+ sprintf('or <a href="%s" download="%s" type="application/octet-stream">datalessSEED</a>', config['ajax']['dlsvURL'] + '/' + dlsvFile, dlsvFile.toLowerCase())
+ '</td></tr>';
}
else {
row += '<tr class="tablesorter-childRow station-details"><td colspan="4">Kontaktieren Sie den ';
row += ( networkURL[network.toUpperCase()] ) ? '<a href="'+networkURL[network.toUpperCase()]+'" target="_blank">Netzwerkkoordinator</a>' : 'Netzwerkkoordinator';
row += ' für weitere Details.</td></tr>';
};
$('#stationstable tbody').append(row);
addStationMarker(stationID, Number(lat), Number(lng), stationText.toUpperCase());
};
});
};
});
},
complete: function () {
initStationTable();
var sort = [[0,0],[1,0]];
$("#stationstable").trigger("update", [true]);
$("#stationstable").trigger("updateCache");
$("#stationstable").trigger("sorton", [sort]);
$("#stationstable > tbody > tr:even").addClass("odd");
$("#stationstable > tbody > tr:odd").addClass("even");
stationLayer.bringToFront();
},
error: function( jqxhr, textStatus, error ) {
var err = textStatus + ", " + error;
console.log( "Request Failed: " + err );
}
});
// create stations csv download link
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));
};
/* format station Details */
function stationDetails(station, network, lat, lng, stationId, stationText, stationObject) {
var output;
var elevation = stationObject.find('Elevation:first').text();
var name = stationObject.find('Site > Name').text();
output = '<pre>'
+ name + '<br />'
+ 'Position: ' + lat + '°N ' + lng + '°E, height: ' + elevation + ' m a.s.l.<br />';
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 += '<br />Channel ' + code + ', Samplingrate ' + sampleRate + ' Hz, Sensor ' + sensor;
});
output += '</pre>';
return output;
};
/* initStationTable */
function initStationTable() {
// tablesorter for station list
$("#stationstable").tablesorter(
{
theme : 'blue',
cssChildRow: "tablesorter-childRow", // this is the default setting
widgets: ["uitheme", "zebra", "filter", "pager"], // initialize zebra and filter widgets, "scroller"
widgetOptions: {
// output default: '{page}/{totalPages}'
// possible variables: {page}, {totalPages}, {filteredPages}, {startRow}, {endRow}, {filteredRows} and {totalRows}
pager_output: '# {startRow} - {endRow} ({totalRows}) | page {page} ({totalPages})',
// apply disabled classname to the pager arrows when the rows at either extreme is visible
pager_updateArrows: true,
// starting page of the pager (zero based index)
pager_startPage: 0,
// Number of visible rows
pager_size: 35,
// Save pager page & size if the storage script is loaded (requires $.tablesorter.storage in jquery.tablesorter.widgets.js)
pager_savePages: true,
// if true, the table will remain the same height no matter how many records are displayed. The space is made up by an empty
// table row set to a height to compensate; default is false
pager_fixedHeight: false,
// remove rows from the table to speed up the sort of large tables.
// setting this to false, only hides the non-visible rows; needed if you plan to add/remove rows with the pager enabled.
pager_removeRows: false,
// css class names of pager arrows
pager_css: {
container : 'stations-tablesorter-pager',
errorRow : 'stations-tablesorter-errorRow', // error information row (don't include period at beginning)
disabled : 'disabled' // class added to arrows @ extremes (i.e. prev/first arrows "disabled" on first page)
},
// jQuery pager selectors
pager_selectors: {
container : '.stationspager', // target the pager markup (wrapper)
first : '.stationsfirst', // go to first page arrow
prev : '.stationsprev', // previous page arrow
next : '.stationsnext', // next page arrow
last : '.stationslast', // go to last page arrow
goto : '.stationsgotoPage', // go to page selector - select dropdown that sets the current page
pageDisplay : '.stationspagedisplay', // location of where the "output" is displayed
pageSize : '.stationspagesize' // page size selector - select dropdown that sets the "size" option
},
filter_childRows : true,
filter_cssFilter : 'stations-tablesorter-filter',
filter_startsWith : false,
filter_ignoreCase : true,
scroller_height: $('div.map').height() - 250,
scroller_barWidth: 10,
scroller_jumpToHeader: false,
sortList: "[[0,0], [1,0]]",
resort: true,
showProcessing: true,
}
});
// hide child rows
$('#stationstable > tbody > tr.tablesorter-childRow > td').hide();
// update map after filtering
// $('#stationsstable').bind('filterEnd', function(){
// toggleFilteredMarkers();
// });
};
/**********************************************************************
* document ready *
**********************************************************************/
$(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
$(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');
$(this).closest('tbody').find('td.selected').each(function(){
if ( ! $(this).hasClass('selected-now') ) {
$(this).hide();
$(this).removeClass('selected');
};
});
$(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').each(function(){
$(this).removeClass('selected-now');
var selected = $(this).hasClass('selected');
if ( selected ) {
$(this).removeClass('selected');
//highlightFirstEvent();
} else {
$(this).addClass('selected');
//toggleHighlightStation($(this).attr('stationid'));
};
});
return false;
});
});