Geofon
Geofon
Geofon
Release 0.1a1
GEOFON Team
1 Introduction 1
2 Preparatory homework 3
2.1 Option 1: VirtualBox installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 Option 2: SeisComP3 installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
7 Using fdsnws_fetch 23
7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
7.2 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
7.3 Usage examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
9 Download of Resources 27
i
ii
CHAPTER
ONE
INTRODUCTION
GEOFON operates jointly with many partner institutions a global broadband seismic network with focus on Eu-
roMed and Indian Ocean regions. It consists presently of 78 high quality stations. Most data is acquired in
real-time.
GEOFON also operates a comprehensive data archive for GFZ and partner networks as well as for temporary
deployments. Most data is open for public access, also real-time data feeds, if available.
GEOFON operates a global earthquake monitoring system using data from GEOFON and partner networks. It
publishes most timely earthquake information, first automatic solutions are mostly manually revised later.
1
GEOFON Training Material
2 Chapter 1. Introduction
CHAPTER
TWO
PREPARATORY HOMEWORK
The first thing that you should have to start with the training is a version of SeisComP3 running on your ma-
chine. To do this you are presented with two options. You can use an image from a virtual machine provided by
GEOFON, which already has SeisComP3 installed on it (but not configured), or you deploy it on your computer.
Select only one of the two options presented in this chapter.
First, download and install VirtualBox if you do not have a native Linux on your laptop (see the chapter Download
of Resources).
Then, install the VirtualBox image with SC3 preinstalled.
1. Download the file from http://geofon.gfz-potsdam.de/jakarta-2016/SC3-Trieste.ova . The file has a size of
ca. 3.9 GB. (MD5 sum: a4ccdbf9b78b497ac8a75b10e8875a85 SC3-Trieste.ova)
2. Open the VirtualBox program
3. Go to the menu File -> Import appliance
4. Select the .ova file downloaded
At this stage you should have a machine loaded into the machine list of the VirtualBox program.
In the virtual machine that you received all the passwords for the accounts are “sysop”. So the password for
“sysop” is “sysop” and the password for “root” is “sysop”. If the system becomes slow, feel free to upgrade the
memory size or to add another disk to the VM.
Note: The keyboard layout was configured to be “English”. To change it to your preferred language: open the
Dash, type “keyboard”, open “Text entry”, add the layout you want and move it to the top.
3
GEOFON Training Material
• Download the SeisComp3 binary package taking into account your Linux distribution and the architecture.
– Ubuntu 16.04 (and Mint 18) 64 bit
– Ubuntu 16.04 (and Mint 18) 32 bit
– Ubuntu 14.04 (and Mint 17) 64 bit
– Ubuntu 14.04 (and Mint 17) 32 bit
• Alternatively you can download the SeisComp3 binary package from this link (here you will have to fill in
the form on the right side of the page the first time you attempt to download a file).
• Download the SeisComp3 maps
• Download the SeisComp3 documentation
• Untar the seiscomp* files (binary package, maps and documentation) you find in your home directory
sysop@ubuntu:~$ tar xzf seiscomp3-jakarta-2016.161.01-ubuntu16.04-x86_64.tar.gz
sysop@ubuntu:~$ tar xzf seiscomp3-seattle-maps.tar.gz
sysop@ubuntu:~$ tar xzf seiscomp3-jakarta-2016.062-doc.tar.gz
sysop@ubuntu:~$ vi .bashrc
• Create and add the following lines to the mysql seiscomp3.cnf file.
sysop@ubuntu:~$ sudo vi /etc/mysql/conf.d/seiscomp3.cnf
[mysqld]
innodb_buffer_pool_size = 64M
innodb_flush_log_at_trx_commit = 2
• Restart mysql.
sysop@ubuntu:~$ sudo service mysql restart
mysql stop/waiting
mysql start/running, process 5522
• Run seiscomp setup and enter your preferred IDs and password. For the other fields, you can always accept
the default values.
sysop@ubuntu:~$ seiscomp setup
• Enable at least the following modules from the command line, can be done also from the scconfig GUI
sysop@ubuntu:~$ seiscomp enable seedlink slarchive arclink scautopick scautoloc
scamp scmag scevent fdsnws
If the application runs without problems you have correctly installed SeisComP3. Congratulations!
THREE
• Move to the “Submit request” tab and select Metadata (Inventory XML). Add your username and click on
the “Submit” button.
7
GEOFON Training Material
• Move to the “Download data” tab and click on [+] to see more information about the request. Click on
“Download Volume” to save the data locally. Save the file as GE_BH_inventory.xml
Note: In case of a slow connection or large processing time, the dataset can be downloaded from
http://geofon.gfz-potsdam.de/jakarta-2016/GE-inventory.xml .
Start “scconfig” from a terminal select the “inventory” icon on the left side bar.
• Click on Import, select Arclink format (for inventory.xml) or any format according to what you would like
to import.
• Provide the path to your file in the “Source” field.
• Repeat the last two points you need to add additional metadata (remember to select the right format).
• Press the “Sync Keys” button.
Configure “Bindings”
• If you want to archive data, create a slarchive profile and name it “default”
(no other changes necessary).
• Drag and drop all profiles from the right side to the network icon on the left side (you may do that also at
the station level).
• Press CTRL+S
• Goto the system tab and press ESC (to deselect everything)
– Click on Update configuration
– Press Seiscomp start to start acquiring data from the already configured stations.
FOUR
In the previous chapter we have imported metadata from a data centre to configure the real-time acquisition of the
GEOFON network. Now we will introduce the different metadata formats that you can use.
Today there are three usual formats to store metadata:
* Dataless SEED
* FDSN StationXML
* SC3 inventory
SC3 inventory
Due to historical reasons, there are two (equivalent) XML representations of the SC3 inventory: Arclink XML
(which pre-dates SC3) and SC3 XML (SCXML).
When importing metadata into an SC3 system, using either of those guarantees 100% lossless conversion.
Fig. 4.1: Click on this link to open the image and be able to zoom in.
11
GEOFON Training Material
SCXML example
<restricted>false</restricted>
<shared>true</shared>
<remark/>
<sensorLocation publicID="SensorLocation#20130513163602.244886.25" code="">
<start>2007-03-04T00:00:00.0000Z</start>
<latitude>-22.7058</latitude>
<longitude>-69.57188</longitude>
<elevation>1440</elevation>
<stream code="LLZ" datalogger="Datalogger#20130513163602.212591.7"
sensor="Sensor#20130513163602.219932.14">
<start>2007-03-04T00:00:00.0000Z</start>
<dataloggerSerialNumber>1843</dataloggerSerialNumber>
<dataloggerChannel>0</dataloggerChannel>
<sensorSerialNumber>2555</sensorSerialNumber>
<sensorChannel>0</sensorChannel>
<sampleRateNumerator>1</sampleRateNumerator>
<sampleRateDenominator>1</sampleRateDenominator>
<depth>0</depth>
<azimuth>0</azimuth>
<dip>-90</dip>
<gain>427566.942</gain>
<gainFrequency>1</gainFrequency>
<gainUnit>M/S**2</gainUnit>
<format>Steim2</format>
<flags>GC</flags>
<restricted>false</restricted>
<shared>true</shared>
</stream>
</sensorLocation>
</station>
</network>
</Inventory>
</seiscomp>
• From Arclink-XML:
arclink2inv -f inventory.xml >etc/inventory/mynetwork.xml
Things to avoid
• Requesting in dataless format from Arclink and importing with dlsv2inv (request inventory and use ar-
clink2inv instead).
• Converting XML to dataless, editing with PDCC, converting dataless back to XML (use invextr or SMP
instead).
We will request the inventory from all stations belonging to network GE.
The FDSN web services are the new standard proposed by the FDSN and are being deployed at almost every data
centre. One of them is called the Station WS and is the service to contact to get all information related to stations,
sensors, responses, etc.
To get data from the Station WS you can use any web client (browser or command line). For instance, the wget
command. The file you will receive will be in StationXML format.
$ wget "http://geofon.gfz-potsdam.de/fdsnws/station/1/query?net=GE&level=response" -O ge.xml
arclink_fetch is a command-line client which allows you to send requests (e.g. data, inventory) to Arclink servers.
The inventory information you receive will *be in *Inventory XML format.
$ echo "1980,1,1,0,0,0 2030,1,1,0,0,0 GE * * *" | arclink_fetch
-u andres@gfz-potsdam.de -k inv -vvv -o ge.xml
WebDC3 is a graphical interface which allows you not only to send requests to Arclink servers, but also to explore
available stations and query event catalogs from different data centres among other possibilities.
You can find detailed information about WebDC3 in the on-line documentation at
http://webdc3.readthedocs.io/en/latest/
• Go to http://eida.gfz-potsdam.de/webdc3 with a browser.
• Click on “Explore events” and select a date interval from 24-08-2016 to 25-08-2016 and a minimum mag-
nitude of 6.
• Shift+click on the map to select a square around Europe and then click on “Search”.
• Only one event in Central Italy should appear in the list on the right part of the page.
• Click on “Explore stations” and move the slider to select only the year 2016 and only “Public permanent
nets” on the Network type list.
• Select “by Events” on the “Stations” section to select stations based on their distance related to the selected
event.
• Select stations only to a distance from the event less than 15 degrees.
• Click on the BH entry in the list of streams and then “Search”.
• Between 600 and 700 stations should appear on the list below the event.
• Go to the third tab, named “Submit request”.
• Click on “Absolute Mode” for the “Time Window Selection” and select time window from 24-08-2016 to
25-08-2016.
• In the “Request type” section, click on “Metadata (Inventory XML)”
If you would like to create you own inventory you could try to use some tools like SMP, which is an online tool
which you can use at https://test.gempa.de/smp/ (beta version). Previously you will need to create an account at
https://seismo.gempa.de/smp/ .
FIVE
Some methods to download data are suitable only if data are hosted only at one data centre. For the next examples,
we need to know in advance that the data has been archived at GEOFON.
You can use a browser or the “wget” command line tool to download data from HH channels of station LVC in
network GE with location code 10 on a particular time frame.
sysop@SC3-VirtualBox:~$ wget "http://geofon.gfz-potsdam.de/fdsnws/dataselect/1/query?
starttime=2015-02-22T02:30:00&endtime=2015-02-22T07:30:00&net=GE&sta=LVC&loc=10&
cha=HH*" -O GE.mseed
And with another command you can download data from HH Channels of all stations in network CX for the same
time window.
sysop@SC3-VirtualBox:~$ wget "http://geofon.gfz-potsdam.de/fdsnws/dataselect/1/query?
starttime=2015-02-22T02:30:00&endtime=2015-02-22T07:30:00&net=CX&cha=HH*"
-O CX.mseed
You can get the same data by creating a plain text file specifying the streams and time windows that you need with
the following format in every line:
NN SS LL CC STARTTIME ENDTIME
Here, NN SS LL CC are the network, station, location and channel respectively and STARTTIME and ENDTIME
are in ISO8601 format (YYYY-MM-DDTHH:MM:SS).
sysop@SC3-VirtualBox:~$ cat post-req.txt
CX * * HH* 2015-02-22T02:30:00 2015-02-22T07:30:00
GE LVC 10 HH* 2015-02-22T02:30:00 2015-02-22T07:30:00
sysop@SC3-VirtualBox:~$ wget --post-file=post-req.txt
"http://geofon.gfz-potsdam.de/fdsnws/dataselect/1/query" -O allData.mseed
--2015-05-11 11:16:12-- http://geofon.gfz-potsdam.de/fdsnws/dataselect/1/query
Auflösen des Hostnamen »geofon.gfz-potsdam.de (geofon.gfz-potsdam.de)« 139.17.3.177
Verbindungsaufbau zu geofon.gfz-potsdam.de (geofon.gfz-potsdam.de)|139.17.3.177|:80
verbunden.
HTTP-Anforderung gesendet, warte auf Antwort... 200 OK
Länge: nicht spezifiziert [application/vnd.fdsn.mseed]
In »»allData.mseed«« speichern.
[ <=>
2015-05-11 11:16:59 (1,87 MB/s) - »allData.mseed« gespeichert [91132928]
17
GEOFON Training Material
For more complex requests, where data is distributed in many data centres, you will need a client to find where
the data are hosted and perform the request to the different data centres.
Arclink_fetch
As we mentioned in the past chapters, arclink_fetch is a command line client which allows you to retrieve data
and metadata from all data centres taking part of EIDA.
You will need to specify what you want to request in a format like this:
$ cat req.txt
2015,2,22,2,30,0 2015,2,22,7,30,0 CX * HH* *
2015,2,22,2,30,0 2015,2,22,7,30,0 GE LVC HH* 10
In this example, we will download one hour of waveforms from selected stations for a particular time window.
Namely, BH channels from all stations in GE and the ones with a distance of less than 15° from an event on August
24th 2016 in Italy.
• Go to http://eida.gfz-potsdam.de/webdc3 with a browser.
• Click on “Explore events” and select a date interval from 24-08-2016 to 25-08-2016 and a minimum mag-
nitude of 6.
• Shift+click on the map to select a square around Europe and then click on “Search”.
• Only one event in Central Italy should appear in the list on the right part of the page.
• Click on “Explore stations” and move the slider to select only the year 2016 and only “Public permanent
nets” on the Network type list.
• Select “by Events” on the “Stations” section to select stations based on their distance related to the selected
event.
• Select stations only to a distance from the event less than 15 degrees.
• Click on the BH entry in the list of streams and then “Search”.
• Between 600 and 700 stations should appear on the list below the event.
• Go to the third tab, named “Submit request”.
• Select “Relative Mode” to define time windows relative to the estimated P arrival.
• Enter “10” in Start time and “50” in End time to request a time window of one hour around the event.
• In the “Request type” section, click on “Waveform (Mini-SEED)”
Warning: For the next two examples it is important to include the dot as a last parameter to the scart
command.
Alternatively, you can do it for the file with all the preloaded data.
sysop@SC3-VirtualBox:~/seiscomp3/var/lib/archive$ scart -vvvv -I ~/Downloads/data.mseed .
SIX
Connect to your Arclink server through telnet and perform a request with the following commands:
telnet localhost 18001
hello
user you@yourdomain
request waveform
2016,8,24,2,0,0 2016,8,24,2,10,0 GE UPC BHZ .
END
You will receive a number as a response from the last command. Let’s suppose that it’s 333. Then, continue with
the following commands.
status 333
Keep asking for the status until you can see that it’s OK. Next to the status, the final size of your request will be
shown, in case you want to download it with the following command:
download 333
• Open scconfig.
• Click on the “Modules” icon and go to the “global” module.
• Look for the “database” section and complete the following:
type=mysql
parameters=sysop:sysop@localhost/seiscomp3
21
GEOFON Training Material
Metadata
Waveforms
• You can do the same for the waveforms that you have imported.
• In the browser go to http://localhost:8080/fdsnws/dataselect/1/query?starttime=2016-08-24T02:00:00&
endtime=2016-08-24T02:10:00&net=GE
• You requested all the waveforms from the GE network from 2016-08-24T02:00:00 to 2016-08-24T02:10:00.
Now you can use clients to work with your data. For instance, scolv. Remember to switch in scolv to “combined”
(combined://localhost:18000;localhost:18001) to load the waveforms from the archive.
SEVEN
USING FDSNWS_FETCH
Introduction
fdsnws_fetch is a Python script that simplifies downloading data and metadata from FDSN web services. It
supports the following notable features:
• Routing the request to datacenters that archive respective stations/channels.
• Merging results from multiple datacenters into one MiniSEED, XML or text file.
• Authentication with username/password or a token.
Installation
fdsnws_fetch is a single script without any special dependencies. It is compatible with Python 2 (at least 2.6) and
Python 3.
Note: The following examples assume that the script can be found in PATH and execute bit added (chmod a+x
fdsnws_fetch).
Usage examples
Request 60 minutes of the "LHZ" channel of EIDA stations starting with "A" for a seismic event around 2010-
02-27 07:00 (UTC). Optionally add "-v" for verbosity. Resulting Mini-SEED data will be written to file
"data.mseed".
$ fdsnws_fetch.py -N "*" -S "A*" -L "*" -C "LHZ" \
-s "2010-02-27T07:00:00Z" -e "2010-02-27T08:00:00Z" -v -o data.mseed
StationXML metadata for the above request can be requested using the following command:
$ fdsnws_fetch.py -N "*" -S "A*" -L "*" -C "LHZ" \
-s "2010-02-27T07:00:00Z" -e "2010-02-27T08:00:00Z" \
-y station -q level=response -v -o station.xml
Bulk requests can be made in ArcLink (-f), breq_fast (-b) or native FDSNWS POST (-p) format. Query parameters
should not be included in the request file, but specified on the command line.
23
GEOFON Training Material
EIGHT
In this chapter we will summarize some of the different topics which have been seen previously. We will start with
information about an event and will go through the whole process until you can use the SeisComP3 GUIs to work
on the traces.
• Download inventory from all stations from networks MN, IV and GE with BH streams operating on August
24th 2016.
$ ./fdsnws_fetch.py -N "MN,IV,GE" -C "BH*" -y station -q level=response \
-s "2016-08-24T01:30:00Z" -e "2016-08-24T03:00:00Z" -v -o mnivge.xml
Note: In case of a slow connection or large processing time, the dataset can be downloaded from
http://geofon.gfz-potsdam.de/jakarta-2016/mnivge.xml .
• Download 90 minutes of all BH streams from networks MN, IV and GE related to the event at Central Italy
on August 24th 2016 (http://geofon.gfz-potsdam.de/eqinfo/event.php?id=gfz2016qphx).
$ ./fdsnws_fetch.py -N "MN,IV,GE" -C "BH*" -s "2016-08-24T01:30:00Z" \
-e "2016-08-24T03:00:00Z" -v -o mnivge.mseed
• Import the metadata using scconfig. If there was a previous inventory version which could collide it should
be deleted.
• Archive the data by means of scart.
$ cd ~/seiscomp3/var/lib/archive
$ scart -vvvv -I ~/mnivge.mseed .
• Open scolv and configure the recordstream to read the data from your local disk (sd-
sarchive:///home/sysop/seiscomp3/var/lib/archive). Create an artificial origin with the details of the event
from the web page at GEOFON.
$ scolv -I sdsarchive:///home/sysop/seiscomp3/var/lib/archive
Exercise 2 - Myanmar
In the above case, the standard EIDA routing service is used. We can also specify a different routing service URL,
for example, use an extended routing service that includes IRIS DMC:
25
GEOFON Training Material
• Download inventory from all stations from networks II, IU, IC and GE with BH streams operating on August
24th 2016.
$ ./fdsnws_fetch.py -u "http://rz-vm258.gfz-potsdam.de/eidaws/routing/1/" \
-N "II,IC,IU,GE" -C "BH*" -L "00,--" -y station -q level=response \
-s "2016-08-24T10:30:00Z" -e "2016-08-24T12:00:00Z" -v -o iiiciuge.xml
Note: In case of a slow connection or large processing time, the dataset can be downloaded from
http://geofon.gfz-potsdam.de/jakarta-2016/iiiciuge.xml .
• Download 90 minutes of all BH streams from networks II, IU, IC and GE related to the event at Myanmar
on August 24th 2016 (http://geofon.gfz-potsdam.de/eqinfo/event.php?id=gfz2016qpzr).
$ ./fdsnws_fetch.py -u "http://rz-vm258.gfz-potsdam.de/eidaws/routing/1/" \
-N "II,IC,IU,GE" -C "BH*" -L "00,--" -s "2016-08-24T10:30:00Z" \
-e "2016-08-24T12:00:00Z" -v -o iiiciuge.mseed
• Import the metadata using scconfig. If there was a previous inventory version which could collide it should
be deleted.
• Archive the data by means of scart.
$ cd ~/seiscomp3/var/lib/archive
$ scart -vvvv -I ~/iiiciuge.mseed .
• Open scolv and configure the recordstream to read the data from your local disk (sd-
sarchive:///home/sysop/seiscomp3/var/lib/archive). Create an artificial origin with the details of the event
from the web page at GEOFON.
$ scolv -I sdsarchive:///home/sysop/seiscomp3/var/lib/archive
NINE
DOWNLOAD OF RESOURCES
• VirtualBox download
– Windows
– OS X
• VirtualBox Image download
– LUbuntu 16.04 64 bit with SeisComP3 installed
• SeisComP3 binaries download 1
– Ubuntu 16.04 (and Mint 18) 64 bit
– Ubuntu 16.04 (and Mint 18) 32 bit
– Ubuntu 14.04 (and Mint 17) 64 bit
– Ubuntu 14.04 (and Mint 17) 32 bit
• SeisComP3 maps
• SeisComp3 documentation
• Data from the event in Central Italy (24.08.2016)
– Pre-assembled dataset
• Metadata
– Pre-assembled dataset
1 For other Linux distributions see the SeisComP3 download page (http://www.seiscomp3.org/downloader).
27
GEOFON Training Material
TEN
29