11 Commits

Author SHA1 Message Date
a2713522c9 update Vagrantfile
create link to map directory at right position
2022-02-27 22:36:18 +01:00
a1e044c082 use ubuntu/jammy64 (22.04) as base image 2022-02-27 22:35:36 +01:00
4c7a1c6916 update .gitignore
ignore .vagrant directory
2022-02-27 22:34:57 +01:00
5d38db389d Merge branch 'develop' into feature/vagrant 2022-02-23 16:54:07 +01:00
9333db3d29 test for "Deutschland" in contryCode when doing geolocation lookup. 2022-02-23 16:53:37 +01:00
2d287ea304 add event bug2020ahxi (Erftstadt 2.9) to specialevents.js 2022-02-23 16:52:44 +01:00
a7d16e5b8a fix scripts/mkGeolocationTable.py
* increase query limit to 10
* increase min_delay_seconds of RateLimiter to 2 seconds
2022-02-23 15:17:08 +01:00
08047bcff8 clean up of file specialevents.js 2022-02-23 15:15:26 +01:00
34f1bd4877 Merge branch 'develop' into feature/vagrant 2022-02-23 14:32:41 +01:00
8b4df0c04d add Vagrant file 2022-02-23 13:51:16 +01:00
42588db791 change URL of photon service by komoot to photon.komoot.io 2022-02-23 13:41:08 +01:00
22 changed files with 52 additions and 28 deletions

7
.gitignore vendored
View File

@@ -38,6 +38,12 @@ Network Trash Folder
Temporary Items Temporary Items
.apdisk .apdisk
## Vagrant
.vagrant/
# Log files (if you are creating logs in debug mode, uncomment this)
# *.log
## Project Files ## Project Files
wsgi/.idea wsgi/.idea
www/dlsv www/dlsv
@@ -47,3 +53,4 @@ www/data/events.xml
www/data/geolocation.js www/data/geolocation.js
scripts/*.json scripts/*.json
scripts/*.xml scripts/*.xml

View File

@@ -1,4 +1,4 @@
# Version: v1.2 (2022-02-23) # Version: VVVVV
FROM nginx:alpine FROM nginx:alpine
# set labels # set labels

16
Vagrantfile vendored Normal file
View File

@@ -0,0 +1,16 @@
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/jammy64"
config.vm.synced_folder ".", "/vagrant"
config.vm.network(:forwarded_port, guest: 80, host: 8888)
config.vm.provision :shell, inline: <<-SHELL
sudo apt-get -y update
sudo apt-get -y install nginx
echo "Starting nginx..."
sudo ln -s /vagrant/www /var/www/html/map
sudo cp /vagrant/www/index.html.en /vagrant/www/index.html
sudo useradd -s /bin/false nginx
sudo service nginx restart
SHELL
end

View File

@@ -9,7 +9,7 @@ services:
build: build:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
image: seisobs-map:v1.1 image: seisobs-map:dev
networks: networks:
- seisobs - seisobs
volumes: volumes:

View File

@@ -1,4 +1,4 @@
# Version: v1.2 (2022-02-23) # Version: VVVVV
server { server {
listen 80; listen 80;
listen [::]:80; listen [::]:80;

View File

@@ -1,4 +1,4 @@
# Version: v1.2 (2022-02-23) # Version: VVVVV
user nginx; user nginx;
worker_processes 1; worker_processes 1;

View File

@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
# Version: v1.2 (2022-02-23) # Version: VVVVV
# get starting date # get starting date
# find gdate or date command ( OSX: brew install coreutils) # find gdate or date command ( OSX: brew install coreutils)

View File

@@ -12,7 +12,7 @@
AJAX calls to the Nominatim service small, e. g. : AJAX calls to the Nominatim service small, e. g. :
curl -s "https://fdsnws.geophysik.ruhr-uni-bochum.de/fdsnws/event/1/query?minlat=50&maxlat=54&minlon=3&maxlon=10&minmag=1" | mkGeolocationTable.py > geolocationTable.js curl -s "https://fdsnws.geophysik.ruhr-uni-bochum.de/fdsnws/event/1/query?minlat=50&maxlat=54&minlon=3&maxlon=10&minmag=1" | mkGeolocationTable.py > geolocationTable.js
Version: v1.2 (2022-02-23) Version: VVVVV
License License
Copyright 2020-2021 Kasper D. Fischer <kasper.fischer@rub.de> Copyright 2020-2021 Kasper D. Fischer <kasper.fischer@rub.de>
@@ -52,7 +52,7 @@ def mkGeolocationTable(file=''):
from geopy.exc import GeocoderServiceError from geopy.exc import GeocoderServiceError
## constants ## constants
URL = 'https://photon.komoot.io/reverse?lon={lng:.3f}&lat={lat:.3f}&limit=5' URL = 'https://photon.komoot.io/reverse?lon={lng:.3f}&lat={lat:.3f}&limit=10'
NAMESPACES = {'sc3': 'http://geofon.gfz-potsdam.de/ns/seiscomp3-schema/0.7', NAMESPACES = {'sc3': 'http://geofon.gfz-potsdam.de/ns/seiscomp3-schema/0.7',
'qml': 'http://quakeml.org/xmlns/bed/1.2'} 'qml': 'http://quakeml.org/xmlns/bed/1.2'}
@@ -70,7 +70,7 @@ def mkGeolocationTable(file=''):
# parse event.xml # parse event.xml
DOM = ET.parse(stdin).getroot() DOM = ET.parse(stdin).getroot()
geolocator = Photon() geolocator = Photon()
reverse_geolocate = RateLimiter(geolocator.reverse, min_delay_seconds=1) reverse_geolocate = RateLimiter(geolocator.reverse, min_delay_seconds=2)
# iterate over all events # iterate over all events
count = 0 count = 0
@@ -88,7 +88,7 @@ def mkGeolocationTable(file=''):
else: else:
logging.info('Processing event {id}'.format(id=publicID)) logging.info('Processing event {id}'.format(id=publicID))
try: try:
locations = reverse_geolocate("{lat:.3f}, {lng:.3f}".format(lat=lat, lng=lng),exactly_one=False,limit=5) locations = reverse_geolocate("{lat:.3f}, {lng:.3f}".format(lat=lat, lng=lng),exactly_one=False,limit=10)
except GeocoderServiceError: except GeocoderServiceError:
logging.warning('Reverse Geolocation failed. Skipping event.') logging.warning('Reverse Geolocation failed. Skipping event.')
continue continue
@@ -125,7 +125,7 @@ if __name__ == "__main__":
# parse arguments # parse arguments
import argparse import argparse
versionText = 'v1.2 (2022-02-23)' versionText = 'VVVVV'
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
description='Reverse geocoding lookup of events in xml format (stdin).', description='Reverse geocoding lookup of events in xml format (stdin).',
epilog=versionText) epilog=versionText)

View File

@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
# version: v1.2 (2022-02-23) # version: VVVVV
function fail { function fail {
printf '%s\n' "$1" >&2 ## Send message to stderr. printf '%s\n' "$1" >&2 ## Send message to stderr.
exit "${2-1}" ## Return a code specified by $2, or 1 by default. exit "${2-1}" ## Return a code specified by $2, or 1 by default.

View File

@@ -4,7 +4,7 @@
Get waveform data from FDSN web service and create a fancy plot Get waveform data from FDSN web service and create a fancy plot
This programme runs as a script or as a WSGI application. This programme runs as a script or as a WSGI application.
:version v1.1 (2021-10-31) :version VVVVV
:license :license
Copyright 2020 Kasper Fischer <kasper.fischer@ruhr-uni-bochum.de> Copyright 2020 Kasper Fischer <kasper.fischer@ruhr-uni-bochum.de>
@@ -378,7 +378,7 @@ if __name__ == "__main__":
epilog=u'$Revision$ ($Date$, $Author$)'.replace( epilog=u'$Revision$ ($Date$, $Author$)'.replace(
"$", "")) "$", ""))
parser.add_argument(u'-v', u'-V', u'--version', action='version', parser.add_argument(u'-v', u'-V', u'--version', action='version',
version=u'v1.1 (2021-10-31)') version=u'VVVVV')
parser.add_argument(u'-u', u'--url', action='store', dest='server', parser.add_argument(u'-u', u'--url', action='store', dest='server',
default=u'https://ariadne.geophysik.ruhr-uni-bochum.de', 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).') help=u'Base URL of the FDSN web service (https://ariadne.geophysik.ruhr-uni-bochum.de).')

View File

@@ -8,7 +8,7 @@ def application(environ, start_response):
:return: response to be sent to the client by the wsgi server :return: response to be sent to the client by the wsgi server
:rtype: list :rtype: list
:version: v1.2 (2022-02-23) :version: VVVVV
""" """
from cgi import FieldStorage from cgi import FieldStorage

View File

@@ -3,7 +3,7 @@
""" """
Produce a dayplot from seismogram recordings Produce a dayplot from seismogram recordings
version: v1.2 (2022-02-23) version: VVVVV
license: gpl3 license: gpl3
Copyright 2012-2020 Seismological Observatory, Ruhr-University Bochum Copyright 2012-2020 Seismological Observatory, Ruhr-University Bochum

View File

@@ -1,4 +1,4 @@
/* last change 2021-10-30 */ /* last change 2022-20-23 */
var specialEvents = [ var specialEvents = [
// 'bug2016ajgm', // CTBT violation North Korea // 'bug2016ajgm', // CTBT violation North Korea
// 'bug2016qphy', // Central Italy 6.1 // 'bug2016qphy', // Central Italy 6.1
@@ -6,5 +6,6 @@ var specialEvents = [
// 'bug2016vico', // Central Italy 6.5 // 'bug2016vico', // Central Italy 6.5
// 'bug2017rfxe', // CTBT violation North Korea 6.1 // 'bug2017rfxe', // CTBT violation North Korea 6.1
// 'bug2019fura', // Sprengung Duisburg-Hochheide (Weißer Riese) 2.0 // 'bug2019fura', // Sprengung Duisburg-Hochheide (Weißer Riese) 2.0
'bug2021vtgi' // Geilenkirchen 1.9 'bug2021vtgi', // Geilenkirchen 1.9
'bug2022ahxi' // Erftstadt 2.9
]; ];

View File

@@ -19,7 +19,7 @@
You should have received a copy of the GNU General Public License along You should have received a copy of the GNU General Public License along
with this program. If not, see http://www.gnu.org/licenses/. with this program. If not, see http://www.gnu.org/licenses/.
Version v1.1 (2021-10-31) Version VVVVV
*/ */
/* adding row(s) to a table and format date strings afterwards */ /* adding row(s) to a table and format date strings afterwards */
@@ -47,7 +47,7 @@ function getGeolocation(id, lat, lng) {
var city = json.features[0].properties.city; var city = json.features[0].properties.city;
var countryCode = json.features[0].properties.country; var countryCode = json.features[0].properties.country;
geolocationTable[id] = city; geolocationTable[id] = city;
( countryCode != "Germany" ) ? geolocationTable[id] = geolocationTable[id] + " ("+countryCode+")" : null; ( countryCode != "Germany" && countryCode != "Deutschland" ) ? geolocationTable[id] = geolocationTable[id] + " ("+countryCode+")" : null;
if ( city ) { if ( city ) {
$("#eventstable a.toggle[eventid="+id+"]").text(geolocationTable[id]); $("#eventstable a.toggle[eventid="+id+"]").text(geolocationTable[id]);
var sort = [[0,1],[1,1],[2,1]]; var sort = [[0,1],[1,1],[2,1]];

View File

@@ -19,7 +19,7 @@
You should have received a copy of the GNU General Public License along You should have received a copy of the GNU General Public License along
with this program. If not, see http://www.gnu.org/licenses/. with this program. If not, see http://www.gnu.org/licenses/.
Version v1.1 (2021-10-31) Version VVVVV
*/ */
/* adding row(s) to a table and format date strings afterwards */ /* adding row(s) to a table and format date strings afterwards */
@@ -47,7 +47,7 @@ function getGeolocation(id, lat, lng) {
var city = json.features[0].properties.city; var city = json.features[0].properties.city;
var countryCode = json.features[0].properties.country; var countryCode = json.features[0].properties.country;
geolocationTable[id] = city; geolocationTable[id] = city;
( countryCode != "Germany" ) ? geolocationTable[id] = geolocationTable[id] + " ("+countryCode+")" : null; ( countryCode != "Germany" && countryCode != "Deutschland" ) ? geolocationTable[id] = geolocationTable[id] + " ("+countryCode+")" : null;
if ( city ) { if ( city ) {
$("#eventstable a.toggle[eventid="+id+"]").text(geolocationTable[id]); $("#eventstable a.toggle[eventid="+id+"]").text(geolocationTable[id]);
var sort = [[0,1],[1,1],[2,1]]; var sort = [[0,1],[1,1],[2,1]];

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<!-- Version v1.1 (2021-10-31) --> <!-- Version VVVVV -->
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='de' lang='de'> <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='de' lang='de'>
<head> <head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" /> <meta http-equiv="content-type" content="text/html;charset=UTF-8" />

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<!-- Version v1.1 (2021-10-31) --> <!-- Version VVVVV -->
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='de' lang='de'> <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='de' lang='de'>
<head> <head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" /> <meta http-equiv="content-type" content="text/html;charset=UTF-8" />

View File

@@ -19,7 +19,7 @@
You should have received a copy of the GNU General Public License along You should have received a copy of the GNU General Public License along
with this program. If not, see https://www.gnu.org/licenses/. with this program. If not, see https://www.gnu.org/licenses/.
Version v1.1 (2021-10-31) Version VVVVV
*/ */
/* add station marker */ /* add station marker */

View File

@@ -19,7 +19,7 @@
You should have received a copy of the GNU General Public License along You should have received a copy of the GNU General Public License along
with this program. If not, see https://www.gnu.org/licenses/. with this program. If not, see https://www.gnu.org/licenses/.
Version v1.1 (2021-10-31) Version VVVVV
*/ */
/* add station marker */ /* add station marker */

View File

@@ -19,7 +19,7 @@
You should have received a copy of the GNU General Public License along You should have received a copy of the GNU General Public License along
with this program. If not, see http://www.gnu.org/licenses/. with this program. If not, see http://www.gnu.org/licenses/.
Version v1.1 (2021-10-31) Version VVVVV
*/ */
/* calculate marker radius from magnitude /* calculate marker radius from magnitude

View File

@@ -19,7 +19,7 @@
You should have received a copy of the GNU General Public License along You should have received a copy of the GNU General Public License along
with this program. If not, see http://www.gnu.org/licenses/. with this program. If not, see http://www.gnu.org/licenses/.
Version v1.1 (2021-10-31) Version VVVVV
*/ */
/* Load the stations using ajax */ /* Load the stations using ajax */

View File

@@ -19,7 +19,7 @@
You should have received a copy of the GNU General Public License along You should have received a copy of the GNU General Public License along
with this program. If not, see http://www.gnu.org/licenses/. with this program. If not, see http://www.gnu.org/licenses/.
Version v1.1 (2021-10-31) Version VVVVV
*/ */
/* Load the stations using ajax */ /* Load the stations using ajax */