47 changed files with 353 additions and 3259 deletions

No files matched your search

+15 -31
View File
@@ -1,33 +1,17 @@
* text=auto !eol * text=auto !eol
scripts/mkEvents.csh -text www/TileLayer.Grayscale.js -text
www/.htaccess -text www/first.png -text
www/copyright.inc.de -text www/jquery.localtime-0.9.1.min.js -text
www/eventsXML.js -text www/jquery.tablesorter.min.js -text
www/external/TileLayer.Grayscale.js -text www/jquery.tablesorter.pager.css -text
www/external/css/dvf.css -text www/jquery.tablesorter.pager.min.js -text
www/external/css/leaflet.label.css -text www/jquery.tablesorter.widgets.min.js -text
www/external/easyPrint.css -text www/last.png -text
www/external/first.png -text www/leaflet.css -text
www/external/jQuery.print.js -text www/leaflet.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/logo_RUB_155x30.png -text
www/more.inc.de -text www/next.png -text
www/spinner.gif -text www/prev.png -text
www/sprintf.min.js -text
www/theme.blue.css -text
www/widget-pager.js -text
-5
View File
@@ -1,7 +1,2 @@
wsgi/.idea
www/dlsv
www/event.xml www/event.xml
www/events.xml
www/geolocation.js
www/geolocationTable.js
www/stations.xml www/stations.xml
-1
View File
@@ -1 +0,0 @@
curl -o events.xml "https://ariadne.geophysik.ruhr-uni-bochum.de/fdsnws/event/1/query?starttime=2014-08-01&orderby=time&minlat=50.92&maxlat=52.76&minlon=4.26&maxlon=9.74&minmag=1.1"
-130
View File
@@ -1,130 +0,0 @@
#! /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 2014 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
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
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()
# 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:
#warnings.warn('Processing event %s' %publicID)
# send and evaluate nominatim request
url = 'https://open.mapquestapi.com/nominatim/v1/reverse.php?lat={0}&lon={1}&zoom=10&format=json'.format(lat, lng)
response = URL.urlopen(url)
if ( response.msg == 'OK' ):
data = JSON.loads(response.read())
city = []
try:
try:
city = data['address']['city']
except:
warnings.warn('Request {3} for event {0} at {1} N / {2} E did not provide city attribute\n\t(Response: {4})'.format(publicID, lat, lng, url, data))
try:
city = data['address']['town']
warnings.warn('Using attribute town ({1}) for event {0}'.format(publicID, city))
except:
try:
city = data['address']['county']
warnings.warn('Using attribute county ({1}) for event {0}'.format(publicID, city))
except:
warnings.warn('Skipping event')
continue
countryCode = data['address']['country_code'].upper()
if ( countryCode == 'DE' ):
geolocationTable[publicID] = city.encode('utf-8')
else:
geolocationTable[publicID] = '{0} ({1})'.format(city.encode('utf-8'), countryCode)
except:
warnings.warn('Could not extract city for event {0} at {1} N / {2} E (URL: {3})'.format(publicID, lat, lng, url))
else:
warnings.warn('Request {0} failed'.format(url))
# 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)
-401
View File
@@ -1,401 +0,0 @@
#!/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 2015 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='bandpass', 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':
channel = 'BHZ'
else:
if args['length'] < 3600:
channel = 'HH?'
else:
channel = 'BH?'
else:
otime = UTCDateTime('2014-11-15T11:35:25Z')
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)
-117
View File
@@ -1,117 +0,0 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Produce a dayplot from seismogram recordings
Subversion information:
$Id$
license: gpl3
Copyright 2012-2015 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)
-1
View File
@@ -1 +0,0 @@
Allow from all
File renamed without changes.
-54
View File
@@ -1,54 +0,0 @@
<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>
+121 -323
View File
@@ -1,109 +1,8 @@
/**********************************************************************
* events.js *
* script for event specific functions and setup *
**********************************************************************/
/* License
Copyright 2014 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$
*/
/* process loaded events */
function processEvents(xml, target) {
$(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
// get location, try this in order:
// regional map name, given value, cached value, or nominatim lookup
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() );
// create table row: Date, Time, Mag, Location
if ( !eventTable[id] && $.inArray(type, config['event']['typeWhitelist'] )+1 && $.inArray(evaluationStatus, config['event']['evaluationBlacklist'])<0 && Number(mag)+0.05 >= config['event']['minMag'] ) {
// general event info (1st line)
var row = '<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>'
+ '</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);
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);
};
};
});
};
/* 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 */ /* do reverse geolocation lookup */
function getGeolocation(id, lat, lng) { function getGeolocation(id, lat, lng) {
if ( !geolocationTable[id] ) { if ( !geolocationTable[id] ) {
$.getJSON( config['ajax']['nominatimURL'], { lat: lat, lon: lng, zoom: 10, format: "json" } ) // $.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" } )
.done(function( json ) { .done(function( json ) {
var city = json.address["city"]; var city = json.address["city"];
var country = json.address["country"]; var country = json.address["country"];
@@ -116,6 +15,8 @@ function getGeolocation(id, lat, lng) {
$("#eventstable").trigger("update", [true]); $("#eventstable").trigger("update", [true]);
$("#eventstable").trigger("updateCache"); $("#eventstable").trigger("updateCache");
$("#eventstable").trigger("sorton", [sort]); $("#eventstable").trigger("sorton", [sort]);
} else {
console.log("Nominatim did not provide a city tag for "+lat+" / "+lng);
}; };
}) })
.fail(function( jqxhr, textStatus, error ) { .fail(function( jqxhr, textStatus, error ) {
@@ -126,137 +27,90 @@ function getGeolocation(id, lat, lng) {
}; };
/* Load events using ajax */ /* Load events using ajax */
function ajaxLoadEvents(startup, stime, etime, eventid, url, target) { function ajaxLoadEvents(stime, etime) {
var mapBounds = map.getBounds(); var mapBounds = map.getBounds();
var request_data = {}; var N = mapBounds.getNorth();
var rtime; var E = mapBounds.getEast();
var ajax_url = config['ajax']['eventURL']; var S = mapBounds.getSouth();
if ( stime == '' || !stime ) { var W = mapBounds.getWest();
stime = new Date(); var d = 0.1;
stime.setDate(stime.getDate()-config['map']['timespan']); if ( !stime ) {
rtime = new Date(); var stime = new Date();
rtime.setDate(rtime.getDate()-Math.min(config['ajax']['timespan'], config['map']['timespan'])); stime.setDate(stime.getDate()-180);
} else {
rtime = stime;
}; };
if ( url ) { if ( !etime ) {
var ajax_url = url; var etime = new Date();
request_data = {}; etime.setDate(etime.getDate()+1);
} else {
if ( eventid ) {
request_data = { eventid: eventid };
} else {
request_data = {
starttime: sprintf("%d-%02d-%02d", rtime.getFullYear(), rtime.getMonth()+1, rtime.getDate()),
orderby: 'time',
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(); }; var url = "https://ariadne.geophysik.ruhr-uni-bochum.de/fdsnws/event/1/query"
if ( startup ) {
processEvents(eventsXML, false);
} else {
$.ajax({
type: "GET",
url: ajax_url,
data: request_data,
dataType: "xml",
success: function ( xml ) { processEvents(xml, target) },
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 = { var request_data = {
eventid: id, starttime: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()),
includeArrivals: true, 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,
}; };
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: config['ajax']['eventURL'], url: url,
data: request_data, data: request_data,
dataType: "xml", dataType: "xml",
success: function (xml) { success: function (xml) {
eventDetails[id] = true;
$(xml).find('event').each(function () { $(xml).find('event').each(function () {
var event = $(this); var id = $(this).attr('publicID').split('/')[2];
var mag = $(this).find('magnitude > mag > value').text(); var mag = $(this).find('magnitude > mag > value').text();
var otime = $(this).find('origin > time > value').text(); var otime = $(this).find('origin > time > value').text();
var lng = $(this).find('origin > longitude > 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 = $(this).find('origin > latitude > value').text();
var lat_err = $(this).find('origin > latitude > uncertainty').text(); var mag = $(this).find('magnitude > mag > value').text();
var depth = $(this).find('origin > depth > value').text(); var evaluationMode = $(this).find('evaluationMode').text();
var depth_err = $(this).find('origin > depth > uncertainty').text(); var evaluationStatus = $(this).find('evaluationStatus').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(); var type = $(this).find('type').last().text();
// setting up general event info var location = getLocation(Number(lat), Number(lng))[0];
var row = "<pre>" ( location ) ? null : location = $(this).find('description > text').text();
+ sprintf("ID %49s\n", id) // create table row: Date, Time, Mag, Location
+ sprintf("Type %47s\n\n", type) if ( !eventTable[id] && ( type == 'earthquake' || type == 'induced or triggered event' || type == 'outside of network interest') && evaluationMode != 'automatic' && evaluationStatus != 'preliminary' && Number(mag)+0.05 >= minMag ) {
+ "Origin\n" var row = '<tr class="tablesorter-hasChildRow">'
+ sprintf("Date %18s\n", otime.split('T')[0]) + '<td class="utctime-date">'+otime.split('.')[0]+'Z</td>'
+ sprintf("Time %18s UTC\n", otime.split('T')[1].substring(0, 11)) + '<td class="utctime-time">'+otime.split('.')[0]+'Z</td>'
+ sprintf("Latitude %14.4f °N +- %4.1f km\n",Number(lat), Number(lat_err)) + sprintf('<td class="ar">%.1f</td>', Number(mag))
+ sprintf("Longitude %13.4f °E +- %4.1f km\n", Number(lng), Number(lng_err)) + '<td><a href="#" class="toggle" eventid="'+id+'">'+location+'</a><a class="map-link" href="#" eventid="'+id+'">Karte</a></td>'
+ sprintf("Depth %14.1f km +- %4.1f km\n", Number(depth)/1000., Number(depth_err)/1000.) + '</tr>';
+ sprintf("Magnitude %10.1f\n", Number(mag)) row += '<tr class="tablesorter-childRow">'
+ sprintf("Residual RMS %7.1f sec\n", Number(rms)) + '<td colspan="4" eventid="'+id+'">not implemented</td></tr>';
+ sprintf("Azimuthal gap %6.1f °\n\n", Number(gap)) var added = $('#eventstable tbody').append(row);
+ sprintf("%d Phase arrivals:\n", Number(phases_count)) added.find('.tablesorter-childRow td').hide();
+ "sta net dist azi phase time res wt\n"; $('#eventstable').find('td.utctime-date').each(function() {
// adding phase info (TODO sort by distance) $.localtime.formatObject($(this), "dd.MM.yyyy");
$(this).find('origin > arrival').each(function() { $(this).removeClass('utctime-date');
var pickid = $(this).find('pickID').text(); $(this).addClass('localtime-date');
var azi = $(this).find('azimuth').text(); });
var dist = $(this).find('distance').text(); $('#eventstable').find('td.utctime-time').each(function() {
var tres = $(this).find('timeResidual').text(); $.localtime.formatObject($(this), "HH:mm");
var phase = $(this).find('phase').text(); $(this).removeClass('utctime-time');
var tweight = $(this).find('timeWeight').text(); $(this).addClass('localtime-time');
if ( Number(tweight) > 0.0 ) { });
var waveformid = event.find('pick[publicID="'+pickid+'"] > waveformID'); // create marker
var networkcode = waveformid.attr('networkCode'); var marker = addEventMarker(id, Number(lat), Number(lng), Number(mag));
var stationcode = waveformid.attr('stationCode'); var text = sprintf('<h3 eventid="%s">%s</h3>', id, location)
var channel = waveformid.attr('channelCode').substring(2,2); + sprintf('<p>Ereignis: %s</br>', id)
var phasemode = event.find('pick[publicID="'+pickid+'"] > evaluationMode').text().substring(0,1).toUpperCase(); + sprintf('Ort: %.4f °N, %.4f °O </br>', Number(lat), Number(lng))
var picktime = event.find('pick[publicID="'+pickid+'"] > time > value').text().split('T')[1].substring(0,11); + sprintf('Zeit: <span class="utctime">%sZ</span></p>', otime.split('.')[0], otime.split('.')[0]);
row = row marker.bindPopup(text);
+ 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)); // try to get better location with reverse geolocation lookup (nominatim)
}; getGeolocation(id, lat, lng);
}); };
row = row + '</pre>';
$('#eventstable > tbody > tr.event-details > td[eventid='+id+']').html(row);
}); });
}, },
complete: function () { complete: function () {
null; initStationTable();
var sort = [[0,1],[1,1],[2,1]];
$("#eventstable").trigger("update", [true]);
$("#eventstable").trigger("updateCache");
$("#eventstable").trigger("sorton", [sort]);
initMapLink();
}, },
error: function( jqxhr, textStatus, error ) { error: function( jqxhr, textStatus, error ) {
var err = textStatus + ", " + error; var err = textStatus + ", " + error;
@@ -265,86 +119,54 @@ function ajaxLoadEventInfo(id) {
}); });
}; };
/* toggles visibility of filtered markers // add row to table
* only events in the event list are shown */ function addEventRow(id, props) {
function toggleFilteredMarkers() { $('#eventstable').tablesorter({
// show all shown events in map sortList: "[[0,0], [1,1]], [2,1]",
$("#eventstable > tbody > tr:not(.filtered) > td > a.map-link").each( function() { resort: true,
if ( $(this).attr("eventid") ) { showProcessing: true,
map.addLayer(eventTable[$(this).attr("eventid")]); pager_size: 35
};
}); });
// hide filtered events in map var html = '<tr class="tablesorter-hasChildRow">'
$("#eventstable > tbody > tr.filtered > td > a.map-link").each( function() { + '<td class="utctime-date">'+props.date+'T'+props.time.split('.')[0]+'Z</td>'
if ( $(this).attr("eventid") ) { + '<td class="utctime-time">'+props.date+'T'+props.time.split('.')[0]+'Z</td>'
map.removeLayer(eventTable[$(this).attr("eventid")]); + '<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');
}); });
highlightFirstEvent(); $('#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]);
}; };
/* Highlight the first event of the event list on the map if no
* other event is selected */
function highlightFirstEvent() {
$('div.info').show()
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)');
};
});
$('div.info').hide()
};
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() { $(document).ready(function() {
// tablesorter for event list // tablesorter for event list
$("#eventstable").tablesorter( $("#eventstable").tablesorter(
@@ -373,33 +195,31 @@ $(document).ready(function() {
showProcessing: true, showProcessing: true,
} }
}); });
// hide child rows // hide child rows
$('#eventstable > tbody > tr.tablesorter-childRow td').hide(); $('#eventstable > tbody > tr.tablesorter-childRow td').hide();
// update map after filtering // update map after filtering
$('#eventstable').bind('filterEnd', function(){ $('#eventstable').bind('filterEnd', function(){
toggleFilteredMarkers(); toggleFilteredMarkers();
}); });
// highlight first event // highlight first event
$('#eventstable').bind('sortEnd', function(){ $('#eventstable').bind('sortEnd', function(){
highlightFirstEvent(); highlightFirstEvent();
}); });
$('#eventstable').bind('pagerComplete', function(){
highlightFirstEvent();
});
// show / hide event info // show / hide event info
$('#eventstable').delegate('.toggle', 'click' , function(){ $('#eventstable').delegate('.toggle', 'click' , function(){
// load event details
var eventid = $(this).attr('eventid');
( eventDetails[eventid] ) ? null : ajaxLoadEventInfo(eventid);
// toggle visibility of selected row // toggle visibility of selected row
$(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').toggle('slow'); $(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').toggle('slow');
// mark currently selected row and remove class selected from all other rows // mark currently selected row and remove class selected from all other rows
// hide other rows // hide other rows
$(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').addClass('selected-now'); $(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').addClass('selected-now');
$(this).closest('tbody').find('td.selected').each(function(){ $(this).closest('tbody').find('td.selected').each(function(){
if ( ! $(this).hasClass('selected-now') ) { if ( ! $(this).hasClass('selected-now') ) {
$(this).hide(); $(this).hide('slow');
$(this).removeClass('selected'); $(this).removeClass('selected');
}; };
}); });
@@ -408,34 +228,12 @@ $(document).ready(function() {
var selected = $(this).hasClass('selected'); var selected = $(this).hasClass('selected');
if ( selected ) { if ( selected ) {
$(this).removeClass('selected'); $(this).removeClass('selected');
highlightFirstEvent();
} else { } else {
$(this).addClass('selected'); $(this).addClass('selected');
highlightEvent($(this).attr('eventid'));
}; };
}); });
return false; 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':
typetext += 'Steinbruchsprengung&nbsp;(Rad)';
break;
};
$("#events-type").append(typetext);
});
}); });
-434
View File
@@ -1,434 +0,0 @@
/**********************************************************************
* events.js *
* script for event specific functions and setup *
**********************************************************************/
/* License
Copyright 2014 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( config['ajax']['nominatimURL'], { lat: lat, lon: lng, zoom: 10, format: "json" } )
.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);
};
})
.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',
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
// get location, try this in order:
// regional map name, given value, cached value, or nominatim lookup
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() );
// create table row: Date, Time, Mag, Location
if ( !eventTable[id] && $.inArray(type, config['event']['typeWhitelist'] )+1 && $.inArray(evaluationStatus, config['event']['evaluationBlacklist'])<0 && Number(mag)+0.05 >= config['event']['minMag'] ) {
// general event info (1st line)
var row = '<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);
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':
typetext += 'quarry blast&nbsp;(wheel)';
break;
};
$("#events-type").append(typetext);
});
});
-1
View File
@@ -1 +0,0 @@
var eventsXML = '<?xml version="1.0" encoding="UTF-8"?><q:quakeml xmlns="http://quakeml.org/xmlns/bed/1.2" xmlns:q="http://quakeml.org/xmlns/quakeml/1.2"><eventParameters publicID="smi:scs/0.6/EventParameters"><event publicID="smi:scs/0.6/bug2015ihgl"><description><text>Germany</text><type>region name</type></description><typeCertainty>known</typeCertainty><creationInfo><agencyID>BUG</agencyID><creationTime>2015-04-28T19:31:06.509532Z</creationTime></creationInfo><magnitude publicID="smi:scs/0.6/Magnitude#20150429112441.464286.8647"><stationCount>18</stationCount><creationInfo><agencyID>BUG</agencyID><creationTime>2015-04-29T11:25:20.909114Z</creationTime></creationInfo><mag><value>2.703325976</value><uncertainty>0.2034955831</uncertainty></mag><type>MLv</type><methodID>smi:scs/0.6/trimmed_mean</methodID><evaluationStatus>confirmed</evaluationStatus></magnitude><origin publicID="smi:scs/0.6/NLL.20150429112433.840738.8592"><time><value>2015-04-28T19:30:15.51157Z</value></time><longitude><value>7.147255958</value><uncertainty>1.115295736</uncertainty></longitude><latitude><value>51.73785715</value><uncertainty>1.089506063</uncertainty></latitude><quality><associatedPhaseCount>31</associatedPhaseCount><usedPhaseCount>29</usedPhaseCount><usedStationCount>20</usedStationCount><standardError>0.2931376582</standardError><azimuthalGap>122.6652318</azimuthalGap><secondaryAzimuthalGap>123.4107887</secondaryAzimuthalGap><maximumDistance>2.005851651</maximumDistance><minimumDistance>0.01569799009</minimumDistance><medianDistance>0.346324069</medianDistance><groundTruthLevel>-</groundTruthLevel></quality><evaluationMode>manual</evaluationMode><creationInfo><agencyID>BUG</agencyID><creationTime>2015-04-29T11:24:35.318507Z</creationTime></creationInfo><depth><value>1347.167969</value><uncertainty>773.7974949</uncertainty></depth><originUncertainty><horizontalUncertainty>1.891729864</horizontalUncertainty><minHorizontalUncertainty>1.41860728</minHorizontalUncertainty><maxHorizontalUncertainty>1.891729864</maxHorizontalUncertainty><azimuthMaxHorizontalUncertainty>47.39494716</azimuthMaxHorizontalUncertainty><confidenceEllipsoid><semiMajorAxisLength>2.559759439</semiMajorAxisLength><semiMinorAxisLength>1.024499786</semiMinorAxisLength><semiIntermediateAxisLength>1.758627031</semiIntermediateAxisLength><majorAxisPlunge>63.95082002</majorAxisPlunge><majorAxisAzimuth>-136.5073621</majorAxisAzimuth><majorAxisRotation>26.15013373</majorAxisRotation></confidenceEllipsoid></originUncertainty><methodID>smi:scs/0.6/NonLinLoc</methodID><earthModelID>smi:scs/0.6/M1g</earthModelID><evaluationStatus>confirmed</evaluationStatus></origin><preferredOriginID>smi:scs/0.6/NLL.20150429112433.840738.8592</preferredOriginID><preferredMagnitudeID>smi:scs/0.6/Magnitude#20150429112441.464286.8647</preferredMagnitudeID><type>induced or triggered event</type></event><event publicID="smi:scs/0.6/bug2015iftl"><description><text>Germany</text><type>region name</type></description><typeCertainty>known</typeCertainty><creationInfo><agencyID>BUG</agencyID><creationTime>2015-04-27T23:48:03.037762Z</creationTime></creationInfo><magnitude publicID="smi:scs/0.6/NLL.20150429094954.031996.7567#netMag.M"><stationCount>9</stationCount><creationInfo><agencyID>BUG</agencyID><creationTime>2015-04-29T09:53:22.229011Z</creationTime></creationInfo><mag><value>2.178141424</value></mag><type>M</type><methodID>smi:scs/0.6/weighted_average</methodID></magnitude><origin publicID="smi:scs/0.6/NLL.20150429094954.031996.7567"><time><value>2015-04-27T23:47:08.895046Z</value></time><longitude><value>7.136250764</value><uncertainty>1.675214857</uncertainty></longitude><latitude><value>51.73949733</value><uncertainty>1.401308672</uncertainty></latitude><quality><associatedPhaseCount>15</associatedPhaseCount><usedPhaseCount>15</usedPhaseCount><usedStationCount>11</usedStationCount><standardError>0.1694600552</standardError><azimuthalGap>133.34201</azimuthalGap><secondaryAzimuthalGap>135.2689245</secondaryAzimuthalGap><maximumDistance>0.6927065882</maximumDistance><minimumDistance>0.008983063432</minimumDistance><medianDistance>0.3104993328</medianDistance><groundTruthLevel>-</groundTruthLevel></quality><evaluationMode>manual</evaluationMode><creationInfo><agencyID>BUG</agencyID><creationTime>2015-04-29T09:49:54.598393Z</creationTime></creationInfo><depth><value>1301.757812</value><uncertainty>890.5695249</uncertainty></depth><originUncertainty><horizontalUncertainty>2.544668748</horizontalUncertainty><minHorizontalUncertainty>2.12030324</minHorizontalUncertainty><maxHorizontalUncertainty>2.544668748</maxHorizontalUncertainty><azimuthMaxHorizontalUncertainty>95.87565496</azimuthMaxHorizontalUncertainty><confidenceEllipsoid><semiMajorAxisLength>3.162131107</semiMajorAxisLength><semiMinorAxisLength>1.344874069</semiMinorAxisLength><semiIntermediateAxisLength>2.798226486</semiIntermediateAxisLength><majorAxisPlunge>95.91306617</majorAxisPlunge><majorAxisAzimuth>-1.663533311</majorAxisAzLine truncated
-207
View File
@@ -1,207 +0,0 @@
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
@@ -1,54 +0,0 @@
.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
@@ -1,20 +0,0 @@
.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;
}
-161
View File
@@ -1,161 +0,0 @@
/* 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);
-7
View File
@@ -1,7 +0,0 @@
/*
@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)}}}});
-28
View File
@@ -1,28 +0,0 @@
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();
};
-9
View File
@@ -1,9 +0,0 @@
/*
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
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 219 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 720 B

After

Width:  |  Height:  |  Size: 720 B

-29
View File
@@ -1,29 +0,0 @@
<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>
Executable → Regular
+43 -86
View File
@@ -7,62 +7,44 @@
<!-- Style definitions --> <!-- 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" />
<!-- jQuery & jQueryUI --> <!-- jQuery & jQueryUI -->
<script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js"></script> <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script type="text/javascript" src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script> <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>
<!-- Localtime & sprintf --> <!-- Localtime -->
<script type="text/javascript" src="external/jquery.localtime-0.9.1.min.js"></script> <script type="text/javascript" src="jquery.localtime-0.9.1.min.js"></script>
<script type="text/javascript" src="external/sprintf.min.js"></script>
<!-- Tablesorter: required --> <!-- Tablesorter: required -->
<script type="text/javascript" src="external/jquery.tablesorter.min.js"></script> <link rel="stylesheet" href="theme.blue.css">
<script type="text/javascript" src="external/jquery.tablesorter.widgets.min.js"></script> <script src="jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="external/widget-pager.js"></script> <!-- script src="widget-scroller.js"></script -->
<!-- script type="text/javascript" src="external/jquery.tablesorter.pager.min.js"></script --> <script src="jquery.tablesorter.widgets.min.js"></script>
<!-- script type="text/javascript" src="external/widget-scroller.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>
<!-- Leaflet --> <!-- Leaflet -->
<script type="text/javascript" src="external/leaflet.js"></script> <link rel="stylesheet" href="leaflet.css" />
<script type="text/javascript" src="external/TileLayer.Grayscale.js"></script> <script src="leaflet.js"></script>
<script type="text/javascript" src="external/leaflet-dvf.markers.min.js"></script> <!-- script src="TileLayer.Grayscale.js"></script -->
<script type="text/javascript" src="external/leaflet.label.js"></script> <script src="map.js"></script>
<script src="external/jQuery.print.js"></script>
<!-- Stations -->
<!-- Map, Events & Stations --> <script src="stations.js"></script>
<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>
<script type="text/javascript" src="eventsXML.js"></script>
</head> </head>
<body> <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"> <div class="info" id="tabs">
<ul> <ul>
<li><a href="#eventstab"><span>Ereignisse</span></a></li> <li><a href="#eventstab"><span>Ereignisse</span></a></li>
@@ -73,11 +55,11 @@
<!-- Ereignisse --> <!-- Ereignisse -->
<div class="tab" id="eventstab"> <div class="tab" id="eventstab">
<div class="pager events" id="eventspager"> <div class="pager events" id="eventspager">
<img src="external/first.png" class="first" alt="First" /> <img src="first.png" class="first" alt="First" />
<img src="external/prev.png" class="prev" alt="Prev" /> <img src="prev.png" class="prev" alt="Prev" />
<span class="pagedisplay"></span> <span class="pagedisplay"></span>
<img src="external/next.png" class="next" alt="Next" /> <img src="next.png" class="next" alt="Next" />
<img src="external/last.png" class="last" alt="Last" /> <img src="last.png" class="last" alt="Last" />
<select class="pagesize" title="Select page size"> <select class="pagesize" title="Select page size">
<option value="5">5</option> <option value="5">5</option>
<option value="10">10</option> <option value="10">10</option>
@@ -89,7 +71,7 @@
</select> </select>
<select class="gotoPage" title="Select page number"></select> <select class="gotoPage" title="Select page number"></select>
</div> </div>
<table class="tablesorter" id="eventstable"> <table class="tablesorter" id="eventstable" data-sortlist="[[0,0],[1,1],[2,1]]">
<colgroup> <colgroup>
<col width="85" /> <col width="85" />
<col width="50" /> <col width="50" />
@@ -107,24 +89,16 @@
<tbody> <tbody>
</tbody> </tbody>
</table> </table>
<p class="table-caption"> <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>
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">
Nominatim Search Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img alt="Mapquest Logo" src="//developer.mapquest.com/content/osm/mq_logo.png" />
</p>
</div> </div>
<!-- Stations --> <!-- Stations -->
<div class="tab" id="stationstab"> <div class="tab" id="stationstab">
<div class="pager stationspager" id="stationspager"> <div class="pager stationspager" id="stationspager">
<img src="external/first.png" class="stationsfirst" alt="First" /> <img src="first.png" class="stationsfirst" alt="First" />
<img src="external/prev.png" class="stationsprev" alt="Prev" /> <img src="prev.png" class="stationsprev" alt="Prev" />
<span class="stationspagedisplay"></span> <span class="stationspagedisplay"></span>
<img src="external/next.png" class="stationsnext" alt="Next" /> <img src="next.png" class="stationsnext" alt="Next" />
<img src="external/last.png" class="stationslast" alt="Last" /> <img src="last.png" class="stationslast" alt="Last" />
<select class="stationspagesize" title="Select page size"> <select class="stationspagesize" title="Select page size">
<option value="5">5</option> <option value="5">5</option>
<option value="10">10</option> <option value="10">10</option>
@@ -140,8 +114,8 @@
<colgroup> <colgroup>
<col width="77" /> <col width="77" />
<col/> <col/>
<col width="77" align="char" char="." /> <col width="77" />
<col width="77" align="char" char="." /> <col width="77" />
</colgroup> </colgroup>
<thead> <thead>
<tr> <tr>
@@ -154,29 +128,12 @@
<tbody> <tbody>
</tbody> </tbody>
</table> </table>
<p class="table-caption">Download als <a id="stations-csv-link" href="link" download="stations.csv">CSV-Datei</a>.</p>
</div> </div>
<!-- More --> <!-- More -->
<div class="tab" id="moretab"><!--include virtual="more.html.de" --></div> <div class="tab" id="moretab"></div>
<!-- Info --> <!-- Info -->
<div class="tab" id="infotab"> <div class="tab" id="infotab"></div>
<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>
<!-- Logo --> <div class="rublogo"><img class="rublogo" src="logo_RUB_155x30.png" alt="Ruhr-Universität Bochum" title="Ruhr-Universität Bochum"/></div>
<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="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> </body>
</html>
-184
View File
@@ -1,184 +0,0 @@
<!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> -->
<!-- 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 />
<col width="30" />
</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">
Nominatim Search Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img alt="Mapquest Logo" src="//developer.mapquest.com/content/osm/mq_logo.png" />
</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
@@ -1,21 +0,0 @@
<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>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Before

Width:  |  Height:  |  Size: 737 B

After

Width:  |  Height:  |  Size: 737 B

File renamed without changes.
File renamed without changes.
-35
View File
@@ -13,20 +13,6 @@
height: 100%; height: 100%;
font-family: sans-serif; 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 { div.info {
z-index: 10000; z-index: 10000;
position: absolute; position: absolute;
@@ -52,12 +38,6 @@
background: rgb(255, 255, 255); background: rgb(255, 255, 255);
background: rgba(25, 255, 255, 0.95); background: rgba(25, 255, 255, 0.95);
} }
div.accordioncontent {
z-index: 10010;
margin: 0px!important;
padding: 5px!important;
font: sans-serif;
}
div.rublogo { div.rublogo {
z-index: 10000; z-index: 10000;
position: absolute; position: absolute;
@@ -84,19 +64,4 @@
td.ar { td.ar {
text-align: right; 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> </style>
+120 -149
View File
@@ -1,100 +1,117 @@
/********************************************************************** /* toggles visibility of filtered markers
* map.js * * only events in the event list are shown */
* script for map specific functions and setup * 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});
};
});
/* License // hide filtered events in map
Copyright 2014 Kasper D. Fischer <kasper.fischer@rub.de> $("#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();
};
This program is free software: you can redistribute it and/or modify it /* Highlight the first event of the event list on the map if no
under the terms of the GNU General Public License as published by the Free * other event is selected */
Software Foundation, either version 3 of the License, or (at your option) function highlightFirstEvent() {
any later version. 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 distributed in the hope that it will be useful, but function highlightEvent( id ) {
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY var highlightStyle = {
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License color: 'red',
for more details. fillColor: '#f03',
};
You should have received a copy of the GNU General Public License along var normalStyle = {
with this program. If not, see http://www.gnu.org/licenses/. fillColor: "#FFF500",
color: "#FFF500"
$Id$ };
*/ $("#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');
}
};
});
};
/* add station marker */ /* add station marker */
function addStationMarker(id, lat, lng, station) { function addStationMarker(id, lat, lng) {
var marker = L.triangleMarker(L.latLng(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,
{ {
gradient: true, fillColor: "#1C771C",
fillColor: config['station']['markerColor'], color: "#1C771C",
fillOpacity: config['station']['markerOpacity'],
color: config['station']['markerColor'],
weight: 1, weight: 1,
opacity: 1, opacity: 1,
radius: config['station']['markerSize'][id] || config['station']['markerSize']['default'], fillOpacity: stationMarkerOpacity,
className: id+' stationMarker', className: id+' stationMarker',
}); }).addTo(stationLayer);
marker.bindLabel('Station '+station);
stationLayer.addLayer(marker);
stationTable[id] = marker; stationTable[id] = marker;
}; };
/* add event marker */ /* add event marker */
function addEventMarker(id, lat, lng, mag, type) { function addEventMarker(id, lat, lng, mag) {
if ( eventTable[id] ) { var markerOptions = {
return eventTable[id]; fillColor: "#FFF500",
} else { color: "#FFF500",
var markerOptions = { weight: 1,
gradient: true, opacity: 1,
dropShadow: false, fillOpacity: eventMarkerOpacity,
fillColor: config['event']['markerColor'], className: id+' eventMarker',
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 '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':
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 */ /* handle to show events on map */
function initMapLink() { function initMapLink() {
$("#eventstable > tbody > tr > td > a.map-link").off('click');
$("#eventstable > tbody > tr > td > a.map-link").on('click' , function(){ $("#eventstable > tbody > tr > td > a.map-link").on('click' , function(){
var highlightStyle = { var highlightStyle = {
color: config['event']['markerColorH'], color: 'red',
fillColor: config['event']['markerColorH'], fillColor: '#f03',
fillOpacity: 1,
className: $(this).attr('eventid') className: $(this).attr('eventid')
} }
var normalStyle = { var normalStyle = {
fillColor: config['event']['markerColor'], fillColor: "#FFF500",
fillOpacity: config['event']['markerOpacity'], color: "#FFF500"
color: config['event']['markerColor']
}; };
// mark currently selected link and remove class selected from all other links // mark currently selected link and remove class selected from all other links
// set everything to normal state // set everything to normal state
@@ -112,110 +129,64 @@ function initMapLink() {
if ( $(this).hasClass('selected') ) { if ( $(this).hasClass('selected') ) {
$(this).removeClass('selected'); $(this).removeClass('selected');
$(this).text('Karte'); $(this).text('Karte');
map.setView(config['map']['centerDefault'], config['map']['zoomDefault']);
eventTable[$(this).attr('eventid')].setStyle(normalStyle); eventTable[$(this).attr('eventid')].setStyle(normalStyle);
map.setView(mapCentreDefault, zoomDefault);
highlightFirstEvent(); highlightFirstEvent();
// unselected -> selected // unselected -> selected
} else { } else {
$(this).addClass('selected'); $(this).addClass('selected');
$(this).text('im Fokus (rot)'); $(this).text('im Fokus (rot)');
map.setView(eventTable[$(this).attr('eventid')].getLatLng(), config['map']['zoomFocus']); eventTable[$(this).attr('eventid')].setStyle(highlightStyle);
eventTable[$(this).attr('eventid')].setStyle(highlightStyle) map.setView(eventTable[$(this).attr('eventid')].getLatLng(), zoomFocus);
}; };
}); });
return false; return false;
}); });
}; };
/********************************************************************** /******************
* document ready * * document ready *
**********************************************************************/ ******************/
$(document).ready(function() { $(document).ready(function() {
// create a map in the "map" div, set the view to a given place and zoom // create a map in the "map" div, set the view to a given place and zoom
map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); map = L.map('map', { zoomControl: false }).setView(mapCentreDefault, zoomDefault);
new L.Control.Zoom({ position: 'topright' }).addTo(map); new L.Control.Zoom({ position: 'topright' }).addTo(map);
new L.control.scale({position: 'bottomright', imperial: false}).addTo(map);
// create baselayer // add MapQuestOSM tile layer
switch ( config['map']['baselayer'] ) { // L.tileLayer.grayscale('http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg',
case 'osmde': // add OpenStreetMap.DE tile layer L.tileLayer('http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg',
L.tileLayer('http://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png',
{ {
attribution: '&copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>', 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">',
}).addTo(map); }).addTo(map);
break;
case 'esrigray': // add ESRI Grayscale World Map (neither city nor road names) // 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}', /* 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', attribution: 'Tiles &copy; Esri &mdash; Esri, DeLorme, NAVTEQ',
maxZoom: 16 maxZoom: 16
}).addTo(map); }).addTo(map); */
break;
case 'aerial': // add ESRI WordImagery tile layer
L.tileLayer('http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
{
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 'mapquestgray': // add MapQuestOSM tile layer
L.tileLayer.grayscale('http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg',
{
subdomains: '1234',
detectRetina: true,
attribution: 'Map data &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">',
}).addTo(map);
break;
case 'mapquest': // add MapQuestOSM tile layer
null;
default:
L.tileLayer('http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg',
{
subdomains: '1234',
detectRetina: true,
attribution: 'Map data &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">',
}).addTo(map);
};
// create station and event layer // read in stations
// stationLayer = L.geoJson().addTo(map); stationLayer = L.geoJson().addTo(map);
stationLayer = new L.MarkerGroup().addTo(map);
eventLayer = new L.MarkerGroup().addTo(map);
// load events // read in events, process filter
ajaxLoadEvents(true); eventLayer = L.geoJson().addTo(map);
// ajaxLoadEvents(false, '', '', '', 'events.xml'); ajaxLoadEvents();
ajaxLoadEvents(false);
// specialEvents.map(function(id) {
// ajaxLoadEvents(false, '', '', id)
//});
toggleFilteredMarkers(); toggleFilteredMarkers();
// bind popupopen event // bind popupopen event
map.on('popupopen', function() { map.on('popupopen', function() {
// convert date/time to localtime // 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")}); $("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"); var eventid = $("div.leaflet-popup h3").attr("eventid");
if ( openMarkerID ) { if ( eventid ) {
// highlight event in table
highlightEvent(eventid);
// update city in popup // update city in popup
$("div.leaflet-popup h3").text(geolocationTable[openMarkerID]); $("div.leaflet-popup h3").text(geolocationTable[eventid]);
// 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);
}); });
-221
View File
@@ -1,221 +0,0 @@
/**********************************************************************
* map.js *
* script for map specific functions and setup *
**********************************************************************/
/* License
Copyright 2014 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$
*/
/* 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']['default'],
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 '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':
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
map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']);
new L.Control.Zoom({ position: 'topright' }).addTo(map);
new L.control.scale({position: 'bottomright', imperial: false}).addTo(map);
// create baselayer
switch ( config['map']['baselayer'] ) {
case 'osmde': // add OpenStreetMap.DE tile layer
L.tileLayer('http://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png',
{
attribution: '&copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://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)
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
L.tileLayer('http://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 'mapquestgray': // add MapQuestOSM tile layer
L.tileLayer.grayscale('http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg',
{
subdomains: '1234',
detectRetina: true,
attribution: 'Map data &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">',
}).addTo(map);
break;
case 'mapquest': // add MapQuestOSM tile layer
null;
default:
L.tileLayer('http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg',
{
subdomains: '1234',
detectRetina: true,
attribution: 'Map data &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">',
}).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);
});
+31 -162
View File
@@ -1,38 +1,23 @@
/********************************************************************** // calculate marker radius from magnitude, both formulas have equal radii at mag=1.2
* misc.js *
* script for unspecific functions and setup *
**********************************************************************/
/* License
Copyright 2014 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) { function mag2radius(mag) {
return 3*mag; // radius proportional to magagnitude return 400*mag; // radius proportional to magagnitude
// return 8.104*Math.pow(30,mag) // radius proportional to energy // return 8.104*Math.pow(30,mag) // radius proportional to energy
}; };
/* set height of eventlist div */ // 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;
}
}
}
function setInfoHeight() { function setInfoHeight() {
var height = $('div.map').height() - 36; var height = $('div.map').height() - 36;
$('div.info').height(height); $('div.info').height(height);
//$('.tab').height(height-80);
//$('#eventtable').height(height-100);
}; };
/* get region and regionID of a location */ /* get region and regionID of a location */
@@ -66,152 +51,36 @@ function getLocation(lat, lng) {
return [ region, regionID ]; return [ region, regionID ];
}; };
/* window resize */ // window resize
$( window ).resize(function() { $( window ).resize(function() {
setInfoHeight(); setInfoHeight();
}); });
/* parseQueryString */ // create global vars
function parseQueryString() { var map
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 eventTable = {};
var geolocationTable = {};
var eventDetails = {}; var eventDetails = {};
var stationTable = {}; var stationTable = {};
var config = { var eventMarkerOpacity = 0.3;
ajax: { var stationMarkerOpacity = 0.5;
timeout: 10000, // 10 seconds var zoomFocus = 12;
eventURL: '/fdsnws/event/1/query', var zoomDefault = 9;
dlsvURL: 'dlsv', var mapCentreDefault = [51.85, 7.0];
mseedURL: '/fdsnws/dataselect/1/query', var minMag = 1.2;
stationURL: '/fdsnws/station/1/query',
nominatimURL: '//open.mapquestapi.com/nominatim/v1/reverse.php',
// nominatimURL: '//nominatim.openstreetmap.org/reverse',
timespan: 60,
},
event: {
evaluationBlacklist: ['automatic', 'preliminary', 'rejected'],
markerOpacity: 0.4,
markerColor: 'blue',
markerColorH: 'red',
minMag: 1.2,
minMagDelta: 0.1,
typeWhitelist: ['earthquake', 'induced or triggered event'],
},
map: {
zoomDefault: 9,
zoomFocus: 12,
centerDefault: [51.65, 7.2],
timespan: 180,
latlngDelta: 0.1,
},
station: {
markerColor: 'darkgreen',
markerOpacity: 1,
markerSize: {
default: 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'],
},
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',
NL: 'http://www.knmi.nl/seismologie/seismisch_network_knmi3.html',
};
var networkText = {
GE: '<a href="'+networkURL['GE']+'" target="_blank">GEOFON</a> Program, GFZ Potsdam',
GR: '<a href="'+networkURL['GR']+'" target="_blank">German Regional Seismic Network</a>, BGR Hannover',
NL: '<a href="'+networkURL['NL']+'" target="_blank">Netherlands Seismic Network</a>, The Netherlands',
RN: 'RuhrNet - Ruhr-University Bochum, Germany',
};
var bochumStation = ['BUG', 'IBBN', 'KERA', 'KARP'];
// FIX: firefox has no console // run when ready
if (typeof console == "undefined") var console = { log: function() {} };
/**********************************************************************
* document ready *
**********************************************************************/
$(document).ready(function() { $(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 // AJAX setup
$.ajaxSetup({timeout: config['ajax']['timeout']}); $.ajaxSetup({timeout: 15000}); // 15 seconds
// adjust height of infocontainer // adjust height of infocontainer
setInfoHeight(); setInfoHeight();
// create tabs // create tabs
$('#tabs').tabs({ var tabOptions = {
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, active: 0,
header: 'h3.aheader', disabled: [2, 3],
heightStyle: 'content', };
animate: 200, $('#tabs').tabs(tabOptions);
}); // $('.ui-tabs-nav').sortable();
// spinner });
$(document).bind("ajaxSend", function() {
$("#spinner").show();
}).bind("ajaxStop", function() {
$("#spinner").hide();
});
// hide info container
$('div.info').hide()
});
-1
View File
@@ -1 +0,0 @@
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.
File renamed without changes.

Before

Width:  |  Height:  |  Size: 736 B

After

Width:  |  Height:  |  Size: 736 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 745 B

After

Width:  |  Height:  |  Size: 745 B

-14
View File
@@ -1,14 +0,0 @@
/* $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
];
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

File renamed without changes.
+23 -139
View File
@@ -1,37 +1,15 @@
/********************************************************************** // Load the stations using ajax
* stations.js *
* script for station specific functions and setup *
**********************************************************************/
/* License
Copyright 2014 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(stime, etime) { function loadStations(stime, etime) {
var mapBounds = map.getBounds(); var mapBounds = map.getBounds();
var N = mapBounds.getNorth(); var N = mapBounds.getNorth();
var E = mapBounds.getEast(); var E = mapBounds.getEast();
var S = mapBounds.getSouth(); var S = mapBounds.getSouth();
var W = mapBounds.getWest(); var W = mapBounds.getWest();
var d = 0.1;
var url = "https://ariadne.geophysik.ruhr-uni-bochum.de/fdsnws/station/1/query";
if ( !stime ) { if ( !stime ) {
var stime = new Date(); var stime = new Date();
stime.setDate(stime.getDate()-config['map']['timespan']); stime.setDate(stime.getDate()-180);
}; };
if ( !etime ) { if ( !etime ) {
var etime = new Date(); var etime = new Date();
@@ -40,62 +18,31 @@ function loadStations(stime, etime) {
var request_data = { var request_data = {
endafter: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()), endafter: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()),
startbefore: sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate()), startbefore: sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate()),
level: 'channel', minlat: S-d,
minlat: S-config['map']['latlngDelta'], maxlat: N+d,
maxlat: N+config['map']['latlngDelta'], minlon: W-d,
minlon: W-config['map']['latlngDelta'], maxlon: E+d,
maxlon: E+config['map']['latlngDelta'],
}; };
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: config['ajax']['stationURL'], url: url,
dataType: "xml", dataType: "xml",
data: request_data, data: request_data,
success: function (xml) { success: function (xml) {
$(xml).find('Network').each(function () { $(xml).find('Network').each(function () {
var network = $(this).attr('code'); var network = $(this).attr('code');
if ( $.inArray(network, config['station']['networkBlacklist'])<0 ) { $(this).find('Station').each(function () {
$(this).find('Station').each(function () { var station = $(this).attr('code'),
var station = $(this).attr('code'), lat = $(this).find('Latitude').text(),
lat = $(this).find('Latitude:first').text(), lng = $(this).find('Longitude').text(),
lng = $(this).find('Longitude:first').text(), stationID = network+'.'+station;
stationID = network+'_'+station, if ( !stationTable[stationID] ) { // && N >= lat && S <= lat && W<= lng && E >= lng
stationText = network+'.'+station; 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));
if ( !stationTable[stationID] ) { var r = $(row);
// general station info (1st line) $('#stationstable tbody').append(r);
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)); addStationMarker(stationID, 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 == 'X5' || $.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 () { complete: function () {
@@ -106,37 +53,10 @@ function loadStations(stime, etime) {
$("#stationstable").trigger("sorton", [sort]); $("#stationstable").trigger("sorton", [sort]);
$("#stationstable > tbody > tr:even").addClass("odd"); $("#stationstable > tbody > tr:even").addClass("odd");
$("#stationstable > tbody > tr:odd").addClass("even"); $("#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
request_data['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() { function initStationTable() {
// tablesorter for station list // tablesorter for station list
$("#stationstable").tablesorter( $("#stationstable").tablesorter(
@@ -165,7 +85,7 @@ function initStationTable() {
// css class names of pager arrows // css class names of pager arrows
pager_css: { pager_css: {
container : 'stations-tablesorter-pager', container : 'stations-tablesorter-pager',
errorRow : 'stations-tablesorter-errorRow', // error information row (don't include period at beginning) errorRow : '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) disabled : 'disabled' // class added to arrows @ extremes (i.e. prev/first arrows "disabled" on first page)
}, },
// jQuery pager selectors // jQuery pager selectors
@@ -181,7 +101,7 @@ function initStationTable() {
}, },
filter_childRows : true, filter_childRows : true,
filter_cssFilter : 'stations-tablesorter-filter', filter_cssFilter : 'tablesorter-filter',
filter_startsWith : false, filter_startsWith : false,
filter_ignoreCase : true, filter_ignoreCase : true,
scroller_height: $('div.map').height() - 250, scroller_height: $('div.map').height() - 250,
@@ -192,43 +112,7 @@ function initStationTable() {
showProcessing: 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() { $(document).ready(function() {
loadStations(); loadStations();
// 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;
});
}); });
-234
View File
@@ -1,234 +0,0 @@
/**********************************************************************
* stations.js *
* script for station specific functions and setup *
**********************************************************************/
/* License
Copyright 2014 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(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);
};
var request_data = {
endafter: sprintf("%d-%02d-%02d", stime.getFullYear(), stime.getMonth()+1, stime.getDate()),
startbefore: sprintf("%d-%02d-%02d", etime.getFullYear(), etime.getMonth()+1, etime.getDate()),
level: 'channel',
minlat: S-config['map']['latlngDelta'],
maxlat: N+config['map']['latlngDelta'],
minlon: W-config['map']['latlngDelta'],
maxlon: E+config['map']['latlngDelta'],
};
$.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] ) {
// 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</td></tr>' : '</td></tr>' ;
if ( network == 'RN' || network == 'X5' || $.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
request_data['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>Chanel ' + 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();
// 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;
});
});
File renamed without changes.
File renamed without changes.