User Tools

Site Tools


wphase:documentation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
wphase:documentation [2014/03/19 01:00]
wphase
wphase:documentation [2015/01/23 18:38]
wphase
Line 1: Line 1:
  
-===== W-phase documentation =====+====== W-phase documentation ​======
  
-==== Installation ====+ 
 +===== Installation ​===== 
 + 
 +==== Getting the code ==== 
 + 
 +Currently, the W-phase package is hosted as a github repository. Ask Zacharie Duputel <​zacharie.duputel@unistra.fr>​ or Luis Rivera <​luis.rivera@unistra.fr>​ for access to the repository. 
 + 
 +Check out W-phase repository:​ 
 +<​code>​ 
 +git clone https://​github.com/​eost/​wphase.git wphase_package 
 +</​code>​ 
 + 
 +To update your W-phase repository (pull changes) 
 +<​code>​ 
 +cd /​to/​the/​wphase/​directory/​ 
 +git pull origin master 
 +</​code>​ 
 + 
 +For more details, you can also checkout [[wphase:​repository|this wiki page.]] 
 + 
 +==== Dependencies ==== 
 + 
 +The w-phase package have only been tested on Unix and Linux computers. You will need the following:​ 
 +  - csh shell 
 +  - gcc and gfortran 
 +  - python2.7 
 +  - You have to install numpy, matplotlib and basemap to run some python scripts which make figures. 
 +  - GMT4 
 + 
 +==== Building the code ====
  
 To install the code, we must first setup a few environment variables. If you use csh or tcsh: To install the code, we must first setup a few environment variables. If you use csh or tcsh:
Line 37: Line 66:
  
 ----- -----
 +
 +===== How to run W-phase ​ =====
 +
 +You can checkout [[wphase:​tutorial:​this wiki tutorial page]].
  
 ==== Preparing directories,​ i_master and CMTSOLUTION ==== ==== Preparing directories,​ i_master and CMTSOLUTION ====
Line 49: Line 82:
 ----- -----
  
-==== Extracting data from (mini)SEED file(s) ​====+==== Extracting data from SEED ====
 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: ​ 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: ​
 <​code>​${WPHASE_HOME}/​bin/​extract.csh</​code> ​ <​code>​${WPHASE_HOME}/​bin/​extract.csh</​code> ​
Line 155: Line 188:
  
 ------- -------
 +
 +
 +===== Data formats =====
 +
 +=== CMTSOLUTION FILE ===
 +
 +example:
 +<​code>​
 + PDE 2003  9 25 19 50  6.40  41.8100 ​ 143.9100 ​ 27.0 6.9 8.1 HOKKAIDO, JP
 +event name:     ​092503C ​       ​
 +time shift: ​    ​19.8100
 +half duration: ​ 33.5000
 +latitude: ​      ​42.2100
 +longitude: ​    ​143.8400
 +depth: ​         28.2400
 +Mrr:       ​7.770000e+27
 +Mtt:      -4.110000e+27
 +Mpp:      -3.660000e+27
 +Mrt:       ​1.320000e+28
 +Mrp:       ​2.590000e+28
 +Mtp:      -6.620000e+27
 +</​code>​
 +
 +The first line of this file is the PDE. 
 +  * The first 4 characters of this line (including the first white space in the example above) generaly indicates the agency which provide the origin time, the hypocenter location and preliminary magnitude estimates. ​
 +  * Characters from 6 to 27 correspond to the PDE origin time
 +  * Characters from 29 to 52 are the PDE latitude, longitude and depth. This hypocenter location will be used to define the time window in order to select the part of the waveform which will be inverted
 +  * Characters from 54 to 60 are PDE magnitude estimates The rest of the line provides some details on epicenter location (region, country, ...)
 +
 +The second line, 'event name' correspond to the event id
 +
 +Lines 3 and 4 are the parameters of the STF.
 +
 +Lines 5, 6 and 7 are the '​latitude',​ '​longitude'​ and '​depth'​ of the centroïd wich will be used for the rotation of horizontal components and for the computation of synthetic kernel functions.
 +
 +The last 6 lines are optional, they correspond to a moment tensor solution (e.g. a reference GCMT for comparision with the W phase inversion).
 +
 +
 +
 +=== i_master file ===
 +
 +This file is composed of several fields (some of them are optional):
 +   * EVNAME: Arbitrary event name
 +   * SEED:  path to SEED file. This field must be used several times if there are multiple SEED files.
 +   * DMAX:  Maximum distance to be used. 
 +   * DMIN:  Minimum distance to be used (optional). ​ If omitted, it is defaulted to 0.
 +   * CMTFILE: Path to the CMTSOLUTION file
 +   * filt_order: order of the butterworth filter.
 +   * filt_cf1: ​ low-frequency cut –off.
 +   * filt_cf2: ​ high-frequency cut –off.
 +   * filt_pass: unused parameter (let it to 1).
 +   * IDEC_2: the second number is the number of seconds just before P wave over which the baseline is defined (let the other parameters to 2 and 0.1) .
 +   * IDEC_3: Instrument response fit parameters for the deconvolution. The two first parameters define the frequency band in which the fit is measured. The third parameter is the number of samples used in this frequency range and the last parameter is a maximum misfit above which the channel is rejected.
 +   * WP_WIN: time window definition.  ​
 +     * If one value $B$ (eg. WP_WIN: 15) is used, then the window is defined by $[P_{tt},​P_{tt}+B\times\Delta]$ where $P_{tt}$ is the P-wave travel-time.  ​
 +     * If two values $A$ $B$ are specified (e.g., WP_WIN: 0. 15.), then the window is $[P_{tt}+A\times\Delta,​P_{tt}+B\times\Delta]$.  ​
 +     * If three values $A$, $B$ and $C$ are used (e.g., WP_WIN: 0. 15. 12.) the time window is defined as:
 +        * $[P_{tt}+A\times\Delta,​P_{tt}+B\times\Delta]$ if $\Delta>​C$
 +        * $[P_{tt}+A\times C,​P_{tt}+B\times C]$ if $\Delta<​C$ ​
 +     * If Four values, $A$, $B$, $C$ and $D$ are given (e.g., WP_WIN: 0. 15. 12. 50.) then the window is:
 +        * $[P_{tt}+A\times \Delta,​P_{tt}+B\times\Delta]$ if $C<​\Delta<​D$
 +        * $[P_{tt}+A\times C,​P_{tt}+B\times C]$ if $\Delta<​C$
 +        * $[P_{tt}+A\times D,​P_{tt}+B\times D]$ if $\Delta>​D$
 +   * GFDIR: Name of the Green'​s function directory (optional)
 +
 +example:
 +<​code>​
 +EVNAME: ​  ​Tokachi-Oki_2003
 +SEED:    ../​../​WP6/​SEEDS/​2003_tokachi_oki_LH.SEED ​
 +DMAX:    90. 
 +DMIN:    0.  ​
 +CMTFILE: CMTSOLUTION
 +
 +# data deconvolution
 +filt_order: 4
 +filt_cf1 ​ : 0.001
 +filt_cf2 ​ : 0.005
 +filt_pass : 1
 +IDEC_2: ​ 2  280   0.1
 +IDEC_3: ​ 0.001   ​0.1 ​ 100  0.03
 +
 +#inversion
 +WP_WIN: 15.  ​
 +GFDIR: ./GF 
 +</​code>​
 +
 +
 +=== Grid-search output files: grid_search_ts_out and grid_search_xy_out ===
 +
 +
 +grid_search_ts_out corresponds to the time-shift grid-search. ​
 +
 +Example:
 +<​code>​
 +   ​60.0000 ​  ​0.20140377
 +   ​81.7621 ​  ​0.32070120
 +000 000     ​1.0000 ​   81.7621 ​  ​-35.8500 ​  ​-72.7100 ​   44.8000 ​  ​0.60186830 ​  ​1.83279165
 +001 000     ​5.0000 ​   81.7621 ​  ​-35.8500 ​  ​-72.7100 ​   44.8000 ​  ​0.58186860 ​  ​1.60449952
 +002 000     ​9.0000 ​   81.7621 ​  ​-35.8500 ​  ​-72.7100 ​   44.8000 ​  ​0.55865993 ​  ​1.40553383
 +003 000    13.0000 ​   81.7621 ​  ​-35.8500 ​  ​-72.7100 ​   44.8000 ​  ​0.53241366 ​  ​1.23245105
 +004 000    17.0000 ​   81.7621 ​  ​-35.8500 ​  ​-72.7100 ​   44.8000 ​  ​0.50339138 ​  ​1.08142045
 +(…)
 +014 000    57.0000 ​   81.7621 ​  ​-35.8500 ​  ​-72.7100 ​   44.8000 ​  ​0.20380139 ​  ​0.31131967
 +015 000    61.0000 ​   81.7621 ​  ​-35.8500 ​  ​-72.7100 ​   44.8000 ​  ​0.20198340 ​  ​0.30827735
 +016 000    65.0000 ​   81.7621 ​  ​-35.8500 ​  ​-72.7100 ​   44.8000 ​  ​0.21088280 ​  ​0.32324637
 +017 000    69.0000 ​   81.7621 ​  ​-35.8500 ​  ​-72.7100 ​   44.8000 ​  ​0.22888998 ​  ​0.35415847
 +018 000    73.0000 ​   81.7621 ​  ​-35.8500 ​  ​-72.7100 ​   44.8000 ​  ​0.25358477 ​  ​0.39808714
 +(…)
 +039 000   ​157.0000 ​   81.7621 ​  ​-35.8500 ​  ​-72.7100 ​   44.8000 ​  ​0.65903444 ​  ​3.48513694
 +040 000   ​161.0000 ​   81.7621 ​  ​-35.8500 ​  ​-72.7100 ​   44.8000 ​  ​0.65708573 ​  ​3.35654281
 +041 000   ​165.0000 ​   81.7621 ​  ​-35.8500 ​  ​-72.7100 ​   44.8000 ​  ​0.65410621 ​  ​3.18301823
 +042 001    59.0000 ​   81.7621 ​  ​-35.8500 ​  ​-72.7100 ​   44.8000 ​  ​0.20151331 ​  ​0.30749196
 +043 001    63.0000 ​   81.7621 ​  ​-35.8500 ​  ​-72.7100 ​   44.8000 ​  ​0.20516181 ​  ​0.31360143
 +044 001    67.0000 ​   81.7621 ​  ​-35.8500 ​  ​-72.7100 ​   44.8000 ​  ​0.21889318 ​  ​0.33689015
 +045 002    58.0000 ​   81.7621 ​  ​-35.8500 ​  ​-72.7100 ​   44.8000 ​  ​0.20231439 ​  ​0.30883067
 +046 002    60.0000 ​   81.7621 ​  ​-35.8500 ​  ​-72.7100 ​   44.8000 ​  ​0.20140377 ​  ​0.30730901
 +047 002    62.0000 ​   81.7621 ​  ​-35.8500 ​  ​-72.7100 ​   44.8000 ​  ​0.20324196 ​  ​0.31038266
 +048 002    64.0000 ​   81.7621 ​  ​-35.8500 ​  ​-72.7100 ​   44.8000 ​  ​0.20771868 ​  ​0.31790207
 +</​code>​
 +
 +The two first lines correspond respectively to the optimum and to the initial centroid time-shifts,​ the first column being the time-shift itself and the second column being the associated rms misfit.
 + 
 +The following lines provide some details on the grid-search : 
 +1st col. : index for this time-shift value, ​
 +2nd col. : iteration number,
 +3rd col. : time-shift
 +4rd col. : centroid latitude
 +5th col. : centroid longitude
 +6th col. : centroid depth
 +7th col. : rms
 +8th col. : normalized rms
 +
 +In the example above you can see that a global grid-search is performed from 1 to 165 sec (until computation 41) at the 0th iteration with a time step of 4sec. The 1st iteration corresponds to computations 42-44 which extend the grid-search to unexplored time-shift between 57sec and 69sec with a sampling interval of 2sec. The 2nd iteration perform an even finer sampling to guarantee a 1sec grid-search between 57sec and 65sec. Once this file is available to us (after running the time-shift grid-search),​ we can run
 +<​code>​
 +${WPHASE_HOME}/​bin/​make_grids.py –t 
 +</​code>​
 +to create the file grid_search_ts.pdf containing Fig. 1 which corresponds to the above example.
 +
 +
 +
 +The output centroid position grid-search file grid_search_xy_out as a quite similar same structure replacing the time-shit in the 2 first lines by optimum and initial latitudes, longitudes and depth.
 +<​code>​
 +  -35.4500 ​  ​-72.8325 ​   25.5000 ​  ​0.19118874
 +  -35.2500 ​  ​-72.7100 ​   25.5000 ​  ​0.19314386
 +000 000    60.0000 ​   60.0000 ​  ​-36.4500 ​  ​-74.1794 ​   25.5000 ​  ​0.24214954 ​  ​0.37750789
 +001 000    60.0000 ​   60.0000 ​  ​-36.4500 ​  ​-73.6896 ​   25.5000 ​  ​0.22150727 ​  ​0.34137918
 +002 000    60.0000 ​   60.0000 ​  ​-36.4500 ​  ​-73.1998 ​   25.5000 ​  ​0.20980594 ​  ​0.32142471
 +003 000    60.0000 ​   60.0000 ​  ​-36.4500 ​  ​-72.7100 ​   25.5000 ​  ​0.20938393 ​  ​0.32071163
 +(…)
 +067 001    60.0000 ​   60.0000 ​  ​-35.6500 ​  ​-72.4651 ​   25.5000 ​  ​0.19798867 ​  ​0.30161961
 +068 001    60.0000 ​   60.0000 ​  ​-35.8500 ​  ​-72.4651 ​   25.5000 ​  ​0.19830051 ​  ​0.30213800
 +069 001    60.0000 ​   60.0000 ​  ​-35.8500 ​  ​-72.7100 ​   25.5000 ​  ​0.19640545 ​  ​0.29899114
 +070 001    60.0000 ​   60.0000 ​  ​-34.6500 ​  ​-72.9549 ​   25.5000 ​  ​0.19787217 ​  ​0.30142600
 +(…)
 +104 002    60.0000 ​   60.0000 ​  ​-35.3500 ​  ​-72.5875 ​   25.5000 ​  ​0.19326491 ​  ​0.29379393
 +105 002    60.0000 ​   60.0000 ​  ​-35.3500 ​  ​-72.7100 ​   25.5000 ​  ​0.19296721 ​  ​0.29330241
 +106 002    60.0000 ​   60.0000 ​  ​-35.5500 ​  ​-72.7100 ​   25.5000 ​  ​0.19360157 ​  ​0.29435001
 +</​code>​
 +
 +The first line corresponds to the optimum centroid location and the second line indicates the a priori location specified in the CMTSOLUTION file. In these two lines, the 1st, 2nd and 3rd column correspond respectively to the centroid latitute, longitude and depth. The 4th column presents the associated rms misfits. ​
 +
 +The following lines provide some details on the grid-search : 
 +1st col. : index of the explorated centroid position, ​
 +2nd col. : iteration number,
 +3rd col. : time-shift
 +4th col. : half duration
 +5th col. : centroid latitude
 +6th col. : centroid longitude
 +7th col. : centroid depth
 +8th col. : rms
 +9th col. : normalized rms
 +
 +Once the grid-search is performed, the grid_search_xy_out is available to us (after running the time-shift grid-search),​ we can run
 +<​code>​
 +${WPHASE_HOME}/​bin/​make_grids.py –p -b 
 +</​code>​
 +to create the file grid_search_xy.pdf containing Fig. 1 which corresponds to the above example. The option –b is optional: it allows to use the basemap module in order to plot coastlines and topography.
wphase/documentation.txt · Last modified: 2022/01/10 07:39 by wphase