User Tools

Site Tools


wphase:documentation

This is an old revision of the document!


W-phase documentation

Installation

To install the code, we must first setup a few environment variables. If you use csh or tcsh:

setenv GMT_BIN      /path/to/gmt/bin
setenv RDSEED       /path/to/rdseed/executable
setenv GF_PATH      /path/to/greens/functions/database
setenv WPHASE_HOME  /path/to/wphase/package

If you use bash:

export GMT_BIN=/path/to/gmt/bin
export RDSEED=/path/to/rdseed/executable
export GF_PATH=/path/to/greens/functions/database
export WPHASE_HOME=/path/to/wphase/package

These variables are necessary both at installation time and at run time. In addition to these variables, it is handy to include the wphase “bin” directory into the PATH environment variable:

setenv PATH         ${PATH}:$WPHASE_HOME/bin

or in bash:

export PATH=${PATH}:$WPHASE_HOME/bin

All theses variable assignment can be included in your .tcshrc or your .bashrc file.

Once you have downloaded the last version of the W-phase package and that the above environment variables are properly defined. Then you can proceed as follows to compile the package:

cd ${WPHASE_HOME}/src
make -B

Preparing directories, i_master and CMTSOLUTION

Before each inversion, it is necessary to create a “run” directory containing two input ascii files:

  • CMTSOLUTION: a file containing the PDE, the event centroid location and timing and optionally a “reference” moment tensor solution.
  • i_master: a file containing other parameters such as the band-pass filter parameters, minimum and maximum distances, etc.

The format of these files are described in notes on file formats.

Path to SEED file(s) must be correctly specified after the keyword 'SEED:' in the i_master file. If multiple SEED files are used for the same inversion, each of them must be referenced properly in i_master using one 'SEED:' line per file.


Extracting data from (mini)SEED file(s)

Once the i_master and CMTSOLUTION files are created, we can extract waveforms and instrument response parameters and perform a rough screening by epicentral distance. This can be done using:

${WPHASE_HOME}/bin/extract.csh

which will extract Z, N, E, 1, 2 channels in SEED file(s).

Data is extracted from SEED volumes and written in SAC format in the subdirectory 'DATA'. PZ files containing instrument responses are also located in this directory. After running an extract*.csh script, screened and windowed data files are listed in 'scr_dat_fil_list' while 'coeffs_rec_lut' contains the coefficients for the time domain deconvolution of the instrument response.


Calculating Synthetics, deconvolution and filtering

The next step is to calculate the kernel functions associated with the 6 elements of the seismic moment tensor for the stations listed in 'scr_dat_fil_list' and to convolve them with the moment rate function (MRF) specified in the CMTSOLUTION file (time shift and half duration). We must then deconvolve the instrument response from the data and band pass filter each waveform in the frequency pass band specified in i_master. This is performed using:

${WPHASE_HOME}/bin/prepare_wp.csh

for Z, N, E, 1, 2 channels or

${WPHASE_HOME}/bin/prepare_wp.csh Z

for Z channel only

The scripts listed above will generates i_wpinversion which is a list of sac files to be used in the inversion. This original input file usually includes lots of noisy channels which should be removed further. Output kernel functions will be found generally in ./GF


Inversion

The inversion can then be performed using the Kernels functions in ./GF and data files listed in i_wpinversion.

For more details on options run

${WPHASE_HOME}/bin/wpinversion -h

By default, this program assumes a zero trace moment tensor (i.e. deviatoric moment tensor). This constraint can be disabled by adding the option “-nont”. Another interesting option is “-dc” which enable the inversion for a pure double couple. The options “-stike”, “-dip”, “-rake” and “-mom” provide the possibility to run double couple inversions at fixed strike, dip, rake and/or scalar moment.

Several output files are created after running the inversion:

  • WCMTSOLUTION (ASCII) is the solution obtained after inversion.
  • p_wpinversion (postscript) which can be visualized with gv (or gs, evince …) and printed with lp or lpr.
  • o_wpinversion (ASCII) is the output list of stations. The 1st column is the list of sac files, the 2nd column is the azimuth (degrees), the 3rd column is the epicentral distance (degrees), the 4th column is the index of the first sample of each channel in the concatenated data vector, the 5th column is the index of the first sample of the next channel, the 8th column is the rms misfit
  • fort.15* (ASCII) is a comparison between observed and predicted concatenated W-phase traces. The first column is the data vector, the second column is the predicted data vector after inversion and the (optional) third column is the data predicted from the (optional) reference solution in the CMTSOLUTION file.
  • fort.15_LH? files (ASCII) where '?' is Z, N, E, 1 or 2 are the same concatenated traces but separated by channels.
  • *.synth.sac (SAC files) which are the predicted data after inversion.

Since i_wpinversion includes a lot of noisy traces, the result is usually uncertain. To improve the solution, we must remove noisy data. This can be done as follows:

  1. A first screening can be performed using the option -med : this will reject data with an anomalously small or large interval between maximum and minimum amplitudes.
  2. After a first run of the inversion, it is possible to perform another inversion throwing out the stations with a relative mismatch exceeding 3.0 (i.e. really bad data). The file o_wpinversion which was created by the first inversion will be used an input. After inversion with the better dataset, a new o_wpinversion file will be created. For example using a threshold of 3.0 :
    $WPHASE_HOME/bin/wpinversion -ifil o_wpinversion -ofil o_wpinv.th3.0 -th 3.0 

    (in this example, the new o_wpinversion file is named o_wpinv.th3.0). This step can be repeated two or more times with different thresholds using the option -th (e.g 1.3, 0.9, etc.):

    $WPHASE_HOME/bin/wpinversion -ifil o_wpinv.th3.0 -ofil o_wpinv.th1.3 -th 1.3 
    $WPHASE_HOME/bin/wpinversion -ifil o_wpinv.th1.3 -ofil o_wpinv.th0.9 -th 0.9 
  3. Finally, it is possible to remove the channels showing a large rms ratios (observed/predicted and predicted/observed) using the option –nr (e.g. –nr 2.0):
    $WPHASE_HOME/bin/wpinversion -ifil o_wpinv.th0.9 -ofil o_wpinv.th1.3 -nr 2.0

At the end of the screening process, it is necessary to clean up the run directory so that o_wpinversion correspond to the optimum dataset which can be used later by grid-search and plot routines :

mv o_wpinversion o_wpinv.noth
cp o_wpinv.th0.9 o_wpinversion

RUNA scripts

Data extraction, screening and inversion described above can be performed by running one of the RUNA3*csh scripts (usually in bin). These scripts perform data extraction/screening and calculate a moment tensor solution after median data screening and after rejecting traces associated with large misfit using the threshold 5.0 3.0 0.9 (i.e. -th, see 2. in section 4):

${WPHASE_HOME}/bin/RUNA3.csh

will perform median and rms misfit screening for Z, N, E, 1 and 2 channels,

${WPHASE_HOME}/bin/RUNA3_only_Z.csh 

will perform median and rms misfit screening for Z channels only.

These two scripts don’t perform the “ratio screening” (i.e. 3. above). To run the same routines with an additional screening based on the ratio (observed/predicted and predicted/observed), the following scripts can be used:

${WPHASE_HOME}/bin/RUNA3r.csh 

will perform median, rms misfit and rms ratio for channels Z, N, E, 1, 2 channels,

Remark: RUNAr.csh is not yet fully tested.

Several optional parameters can be used when running RUNA3*csh scripts. These parameters will apply to the wpinversion program. They are described when running wpinversion -h. e.g.: RUNA3.csh -wz 1.0 -wn 0.3 -we 0.5 will give a weights of 1.0, 0.3 and 0.5 for Z, N, E components respectively.

To perform data screening and inversion only, using previously extracted SAC data, it is possible to use:

${WPHASE_HOME}/bin/RUNA3_lite.csh

that is designed for Z, N ,Z ,1, 2 channels


Grid searches

In the grid-search scheme, there is a first global rough exploration which is followed by finer samplings around minimal points. If the optimum is found near a bound, the explored space is extended.

Grid searches can be performed using the script

${WPHASE_HOME}/bin/wp_grid_search.py

. A detailed help can be found by using

${WPHASE_HOME}/bin/wp_grid_search.py -h

. The grid-search computation is parallelized using openMP (if available, it takes advantage of muliple cores).

This script run a time-shift (ts) grid search followed by a centroid position grid-search :

  • By default, the ts grid-search only shift the Green's functions to find an optimum centroid timing. At the end of the grid-search, a new inversion is performed by fixing the source half duration (hd) to the optimal value of ts.
    Using the option -s, the grid-search is preformed while considering ts=hd which is more time consuming.
    Grid-search results can be found in grid_search_ts_out (see note 3). A postscript file (ts_p_wpinversion) as well as a CMTSOLUTION file (ts_WCMTSOLUTION) corresponding to the optimum ts will also be generated automatically. In gereneral all the output files containing the prefix ts_are associated to the time-shift grid search.
  • Then, using the optimum value of ts, it perform a 2D centroid position grid-search (lat/lon). The centroid position grid-search generates a text file named grid_search_xy_out with a structure similar to grid_search_ts_out (see note 3). As for time-shift grid-search, you will also find the usual output files with the prefix xy_.
  • It is also possible to perform a 3D grid-search using the option –z.

Plot routines

All the plotting scripts are coded using python and the module pylab which have to be installed before using them. The module basemap is also needed for plotting maps but it is optional (even if we recommend to install it).

There are 3 script which can be used to plot the W phase inversion results:

  • The first script is
    ${WPHASE_HOME}/bin/make_grids.py

    which be used to display grid-searches results. Use

    ${WPHASE_HOME}/bin/make_grids.py -h

    to have more details on available options and arguments. The 2 other scripts plot observed and synthetic seismograms after W phase inversion.

  • In order to plot complete seismograms individually and place station on a map:
    ${WPHASE_HOME}/bin/traces_global.py

    which draw complete seismograms and show station location on a map (if basemap is available). Please use

    ${WPHASE_HOME}/bin/traces_global.py -h

    for more details on available options.

  • To plot concatenated waveforms:
    ${WPHASE_HOME}/bin/make_cwp.py

    For more details on available options and arguments see

    ${WPHASE_HOME}/bin/make_cwp.py -h

    to see the options.


wphase/documentation.1395187240.txt.gz · Last modified: 2014/03/19 01:00 by wphase