Skip to content

Install local SEFRAN3

François Beauducel edited this page Apr 16, 2021 · 3 revisions

Overview

The SEFRAN3 is a graphical interface to operate seismic data flux, multi-channel waveform and spectrogram chart, manual and semi-automatic detection of events, and earthquake catalog bulletin management. For more information about SEFRAN3, see the section about SEFRAN3/MC3 of the WebObs user's manual.

To run SEFRAN3 totally locally, that is to say without a connection to an observatory network in real-time, a portable fdsnws dataselect server can be implemented and connected to a SEFRAN3 using local miniSEED formatted data. This server requires a data index to serve data from a repository. We proposed to used Mseedindex to synchronize miniSEED data with a database that can be either PostgreSQL or SQLite. Here, SQLite is privileged to manage data stored locally. An overview of the architecture is presented in the figure:

Installation

This article is based on the Linux operating system and the installation follows the numbering shown in the image. For macOS or Window users, small modifications need to be done but the main guidelines can be followed.

Requirements:

  • Python 2.7 or higher, ObsPy, and common modules.
  • Webobs

Download data to your local machine

To run a local SEFRAN3, you need to have data stored on your personal computer. To have access right to an observatory server, you need to send an email to the administrator. It is very likely that you will be asked for your ssh public key. When your key is added to the server, the rsync command allows you to synchronize/download data from the remote server to your local machine. The basic command is rsync [options] source [destination], to use ssh and more advanced options you can use rsync -av -e 'ssh -p portNumber' login@IPaddress:/remote/file/path /local/folder/path.

SQLite database

SQLite is an open-source relational database management system (https://sqlite.org/index.html).

  • Install on your Debian based(Ubuntu, Debian, etc.) machine by executing the commands:
$ sudo apt-get update
$ sudo apt-get install sqlite3
  • (Optional) The SQLite Browser, a front-end for SQLite, can also be installed:

$ sudo apt install sqlitebrowser

Mseedindex - Synchronize miniSEED with database

The mseedindex programs maintain an index of downloaded miniSEED data with a database. See https://github.com/iris-edu/mseedindex/wiki for further information.

  • Install in a specified directory:
 git clone https://github.com/iris-edu/mseedindex.git
 cd mseedindex/
 WITHOUTPOSTGRESQL=1 make
  • To index miniSEED in one or more files, the basic command is $ mseedindex -sqlite3 timeseries.sqlite <miniSEED files>. In our case, we proposed to use : mseedindex -vv -kp -noup -sqlite timeseries.sqlite <miniSEED files>.

  • (Optional) Create the summary table, useful for optimizing queries to large index tables. Using the SQLite command-line tool issue these statements (assuming the index table name is tsindex):

DROP TABLE IF EXISTS tsindex_summary;
CREATE TABLE tsindex_summary AS
   SELECT network,station,location,channel,
   min(starttime) AS earliest, max(endtime) AS latest, datetime('now') as updt
   FROM tsindex
   GROUP BY 1,2,3,4;

Portable fdsnws dataselect server

The portable-fdsnws-dataselect server is an implementation of the International FDSN’s fdsnws-dataselect web service specification. Information can be founded at: https://iris-edu.github.io/portable-fdsnws-dataselect/. This server provide access to the data by using a standardized web service.

  • Locate your python setup path with which python command.
  • Install the server using pip : /path/to/python/bin/pip install portable-fdsnws-dataselect
  • Create a server configuration file : /path/to/python/bin/portable-fdsnws-dataselect -s > server.iniv
  • Edit the server configuration file ('server.ini') to point the path option in the [index_db] to your SQLite database file.
  • Run the server specifying the config file: /path/to/python/bin/portable-fdsnws-dataselect server.ini

Into a web browser, you can move to the portable FDSNWS Dataselect Service Interface by addressing to http://ServerHost:ServerPort/ , e.g. http://localhost:8080/ . Using the documentation provided, you can send a query to validate the proper functionning of the server.

If necessary to kill an old process use ps aux |grep fdsn to have the process id and then sudo kill -9 <process_id>.

Configure the local SEFRAN3

The local WebObs need to be configure according to the miniseed data provided.

  • Modify data source and format of SEFRAN3.conf file:

DATASOURCE| protocole fdsn localhost:port

(Optional) Increase UPDATE_HOURS and MIN_RUNTIME_SECONDS values

  • Modify the SEFRAN3 channel definition into SEFRAN3_Channels.conf with adequate information. For instance:
Alias Stream            Sensitivity     Filter          PP      RGB       Spectrogram
PUS   VG.MEPAS.00.HHZ	9.99001E+08	hpbu3,0.2	5e-5	"#008800" 1,0,50,lin
  • Run job: Into 'ADMIN > JOBS SCHEDULER > MANAGER edit the job definition and provide :
    • JID=<job's id from JOBS TABLE >; Example: scheduler submit JID=myjob
    • XEQ1: $WEBOBS{JOB_MCC} sefran3
    • XEQ2: SEFRAN3
    • XEQ3: start date (Date format is yyyymmddHHMMSS but can be given partially, e.g. 20210409 )
    • (Optional) LOGPATH (specify the directory for JOB's STDOUT and STDERR), RES (JOB's RESOURCE), MAXSYSLOAD (CPU LOAD THRESHOLD), UID (UID to be used for end-of-job notication)
    • Validity: unchecked
  • Submit the job manually.

Make sure to look into the run and log file for errors if things are not working as wanted.

When the job is finished you can now move to the SEFRAN3 windows.