3 Software installation
"ARTMOTIV"
A PYTHON code for an automated fast inversion of seismic data for a centroid moment tensor solution (CMT).
If the automatic detection and classification routine (WP5 - Task 2 -"classification") detects a long period event (LP)/ very long period event (VLP), the ARTMOTIV tool is automatically called. The time stamp of the event is given as part of the call.
INPUT
time stamp of a detected LP/VLP event
OUTPUT
xml-file containing information about location, time, mechanism of the source, and tons of meta data
Prerequisits
PYTHON 2.4 (or higher)
PYTHON-modules:
- scipy
- numpy
- Scientific.IO.NetCDF
- lxml
PYMSEED
Software Configuration
- ARTMOTIV.PY & AM_TOOLS.PY must be put into one folder, which is in the PYTHONPATH of the classification routine
- PYMSEED must be installed in the PYTHONPATH via the call 'python pymseed.py setup'
- Name of the configuration file must be coded into ARTMOTIV.PY
- set the correct address of the database server for putting the output xml-file at the right place
General Configuration
- The geometry of a (not necessary regular!!) source grid must be set up and stored as an ascii table with pointwise row-entries:
(latitude, longitude, depth in metres) - The geometry of the station configuration must be given as a separate file with entries for each station as follows:
[station name]
lat = <latitude>
lon = <longitude>
- The coordinate convention is N,E,Zup (North, East, z positive in up)
- For the given geometrical setup, a set of Green's functions must be provided. One file for each station in "NetCDF"-format with the naming
'gf_v<GF version number>_length<length in seconds>_sampling<sampling in Hz>_station_<station name>.nc'
The NetCDF-file contains one array with the time steps as rows. The columns are set up as follows:- first column is time axis
N-Mnn,N-Mee,N-Mzz,N-Mne,N-Mnz,N-Mez,E-Mnn,E-Mee,E-Mzz,E-Mne,E-Mnz,E-Mez,Z-Mnn,Z-Mee,Z-Mzz,Z-Mne,Z-Mnz,Z-Mez
( 3 components of the station N,E,Zup with each 6 components of the moment tesor Mnn, Mee, Mzz, Mne, Mnz,Mez ) - Time format in the call must be 'YYYY-MM-DDTHH:mm:SS'
- A configuration file must be provided; its name coded directly into 'ARTMOTIV.PY'
(Style of configuration file: see 'Configuration File')
First time run
'ARTMOTIV.PY <timestamp>' is called by the automatic event detection. A temporary path (under the basic directory, set in the configuration file) and file structure is set up. The configuration of existing (and desired) stations and grid points is read in, the respective Green's functions (GF) are read from the NetCDF-files into an array. The array (and resulting correlation matrices) are stored within a temporary file for faster access later on.
All data existing within the data base for a time window around the given time stamp is scanned and read in. In case of data gaps, the GF and correlation matrices are corrected.
A combinated inversion- and grid search-routine is carried out in a moving time window frame, and a best solution in terms of location, time and mechanism is obtained.
The solution is assembled into an xml file. The xml-file is put into the main data base.
Following runs
'ARTMOTIV.PY <timestamp>' is called by the automatic event detection. If nothing changed w.r.t. the first run, all GF and correlation matrices are read from file. In case of changes in the source grid, they have to be read in from scratch. For the rest of the run, the old scheme holds.
Configuration File
- This file contains all information, needed by 'ARTMOTIV.PY'. The general form is <key> = <value>. The order as well as the sectioning by [<section name>] is only important for human readability.
- Lines starting with "#" are ignored by the program
- Content with explaining comments:
############################################################################################
# 'Example configuration file'
##'Interesting' meta-meta information - not important for the run, but yielded by the xml-file:
[general]
#no comment
author = Scrooge McDuck
#should coincide with the naming within the main database
volcano_id = Volcano No. 1
#should coincide with the naming within the main database
project_id = 08/15
#information about the velocity model
model_name = Duckburgh
#-----------------------------------------
## set important directories
[directories]
#main directory, coordintes, weights and subdirectories are located here
base_dir =/net/scratch2/gp/u25400/lasse/ruhr/inv_run
#directory containing the NetCDF files - addressed w.r.t. base_dir
gf_dir = DB/GF
#parent directory containing all mseed data - addressed w.r.t. base_dir
data_dir = ../data/mseed_format
#-----------------------------------------
## set file names
[files]
#file containing stations information - formatting see above
station_coordinates_filename = conf_file_suited_stations.dat.all
#file containing source grid point coordinates - formatting see above
grid_coordinates_filename = grid_coordinates_ruhr_all_stats_SW_shifted_150m.dat
#possibility to provide a list of GF_files - appears in the output xml-file
GF_files = dummylist
#name of the output xml-file - saved in base_dir
xml_file_name = moment_tensor_inversion_testfile_ruhrgebiet.xml
#possibility to provide a list of files with meta information about the stations - appears in the output xml-file
stationinformationfiles = 0.
#possibility to provide a list of files with meta information about the data - appears in the output xml-file
datafiles = 0.
#possibility to provide a file with information about the topography (DEM) - appears in the output xml-file
topography_model_file =
#possibility to provide a file with information about the velocity model - appears in the output xml-file
velocity_model_file =
#possibility to provide a file with information about the source time function - appears in the output xml-file
sourcetimefunction_file =
#-----------------------------------------
##information about the data type
[data]
#current version of the data set
#possibility to set an additional parametre to distinguish between several data sets
#mainly used for debugging and testing with ascii data sets - can be ignored in case of MiniSeed data
data_version = 2
#length of moving analysis window in secondes
time_window_length = 4
#step size of moving time window in seconds
window_steps_in_s = 22.
#if not continuous, the total length of time trace/length of the desired time window to analyse in seconds
# if necessary, this is expanded to the length of the moving analysis window
main_window_length = 2.
#weighting off/linear/external (0/1/2)
#contribution of data is either unweighted or linearily weighted by distance from the source grid or weighted by factors given in an external file
# in the linear case (1), the weight goes from '1' at the station nearest to the source down to '0.5' at the farthest station
weight_stations = 2
#file with station weights in the format <stationname> <weighting factor>
#stations not listed are weighted with factor = 1
# file location w.r.t. "base_dir"
file_with_weighting_factors = station_weights.txt
#-----------------------------------------
##information about the Green's functions
[Greens_functions]
#version of Green's functions - part of the name of the NetCDF-files
#possibility to set an additional parametre to distinguish between several GF sets
gf_version = 6
#original length of the GF trace in seconds - part of the name of the NetCDF-files
gf_length = 10
#sampling rate of the GF in Hz - part of the name of the NetCDF-files
gf_sampling_rate = 100.
#flag, if only lp GF are provided
#currently not necessary - IGNORE !!
lp_flag = 0
#-----------------------------------------
##information about the filtering of data and GF
[filter]
#flag for bandpass filtering
#none (0), boxcar window (1), butterworth (2)
#boxcar is implemented within the module
#butterworth is set up with the help of SCIPY.SIGNAL
filter_flag = 2
#lower corner frequency in Hz
bp_lower_corner = 0.5
#upper corner frequency in Hz
bp_upper_corner = 2
#order of butterworth function
bp_order = 4
#padding length factor - pad time trace with zeros to reduce filter effects
#length of added section (in terms of original length) - only integers are taken
zero-pad-factor = 3
#-----------------------------------------
##possibility to tune the moment tensor properties
[moment_tensor_estimation]
#different decompositions of the deviatoric part may be possible
# see e.g. Jost & Herrmann
#choose from :DC+CLVD (0), DC_major+DC_minor (1), DC1+DC2+DC3 (2)
decomp_key = 0
#if used contiuously (to be implemented!!), an alarm will be triggered, if the VR exceeds this value
#threshold for automatic alert, given in percent (goodness-of-fit)
vr_threshold = 80
#-----------------------------------------
##genreal stuff
[other]
#TODO implement alternative method (U.Wegler)
#flag, if to compare result with other methods
#currently to be IGNORED !!!
compare = 0
#-----------------------------------------
##configuration for the graphical output
#only important, if used as stand alone tool
[gmt]
#flag, if plot wanted
#within Exupery, default is "0"
visualisation = 1
#choose between horizontal or vertical section of the source grid
#currently only horizontal section implemented
#do not change !!
#style of plot
plotflag_z = 3
#choose, how many traces shall be shown in the plot
#(for the sake of clearity, max. 30 traces can be plotted simultaneously)
#if more stations are available, a random sample is drawn
#number of traces to plot
n_traces_in_plot = 24
#name of temporary psmeca-data
#(if one wants to keep data for external plotting)
#saved within the temporary directory
grd_plot_datafile = tmp_psmeca_datafile.dat
#filename of final plots
#only the ending - beginning of filename is set within the program
#put into 'plots' directory
grd_plot_plotfile = synth_SW_150m.pdf
#colour table file needed by GMT
#addreses w.r.t. base_dir
colourtable = /net/scratch2/gp/u25400/lasse/ekofisk/svn_py/colourtable_psmeca2.cpt
#plot other layer than best source
#given in index w.r.t. best source layer
#for horizontal sections, positive means downwards
plot_devi_layer = 0
#provide component to plot
#if omitted, 'Z' is set as default
#plot_component = z
#-----------------------------------------
##choose only section of general source point grid
#smaller grids makes the run much faster!!
#every change here causes new set up of GF and correlation matrices!!
[grid_section]
#different geometric sections are available:
#circular or rectangular - at the centre of original grid or shifted
# choose section from 0,11,12,21,22
# 0 - no section, whole grid taken
# 11- circle around centre,
# 12- centre plusminus lat/lon or metre ranges,
# 21- circle around given point,
# 22- given point plusminus lat/lon or metre ranges
gs_type_of_section = 11
#centre of section - latitude
#in degrees or deg,min,sec
gs_section_centre_lat = 51.6542560
#centre of section - longitude
#in degrees or deg,min,sec
gs_section_centre_lon = 7.7401026
#radius of circular section in metres
gs_radius_of_circle = 10000
#latitude range of section in degrees
#gs_lat_range = 0
#longitude range of section in degrees
#gs_lon_range = 0
#latitude range of section in metres
gs_lat_range_in_m = 10000
#longitude range of section in metres
gs_lon_range_in_m = 10000
#restriction in depth only valid for ' gs_type_of_section != 0 '
#minimal depth of section
gs_depth_upper_boundary = 800
#restriction in depth only valid for ' gs_type_of_section != 0 '
#maximal depth of section
gs_depth_lower_boundary = 1100
#-----------------------------------------
##re-configure the station configuration
#e.g. exclude bad stations from the analysis
[receiver_configuration]
#[optional]
#possibility to manually provide list of stations
#for controlling or debugging, otherwise comment!!
#list_of_contributing_stations = HM04, HM20, HM07, HM08
#[optional]
#manually provide list of stations to skip (overrides the former choice)
#for controlling, debugging, or simple exclusion of bad stations, otherwise comment !!!
#list_of_stations_to_skip = BFO,CLL,clz, hea, hfs, llw, mud, rue
#[optional]
#manually provide list of channels
#for controlling or debugging, otherwise comment!!
list_of_contributing_channels = BHN, bHZ, bhE
#[optional]
#manually provide list of channels to skip (overrides the former choice)
#for controlling, debugging, or simple exclusion of bad channels, otherwise comment !!!
#list_of_channels_to_skip =
#[optional]
# number of stations, taken for the analysis
#randomly chosen (uniformly distributed) for bootstrap test, otherwise comment !!!
#number_of_random_stations = 8
#-----------------------------------------
##set up a dummy input for testing
#ignore and /or delete for real use
[dummy_event]
#if no event ID provided, take this
event_ID = 2006-10-08T11:45:08.000
#event type for later use on several different occasions
#if no type provided, take this
#1 - tectonic
#2 - lp-event
#3 - induced
#4 - landslide
event_type = 2
#End of configuration file example
############################################################################################