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:03]
wphase
wphase:documentation [2021/10/22 16:55]
wphase
Line 1: Line 1:
  
-===== W-phase documentation =====+====== W-phase documentation ​======
  
-==== Installation ====+In addition to this page, you should probably have a look to [[wphase:​tutorial|this tutorial page]]. 
 + 
 +===== Installation ​===== 
 + 
 +==== Getting the code ==== 
 + 
 +Currently, the W-phase package is hosted as a github repository. To check out the 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 on using git for W-phase, [[wphase:​repository|you can read this 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 (or later) 
 +  - You have to install numpy, matplotlib, basemap and netCDF4 to run some python scripts which make figures. 
 +  - rdseed 
 + 
 +To install these dependencies on MacOs, [[wphase:​macos|you can refer to this page]]. 
 +==== 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:
 <​code>​ <​code>​
-setenv GMT_BIN ​     /​path/​to/​gmt/​bin 
 setenv RDSEED ​      /​path/​to/​rdseed/​executable setenv RDSEED ​      /​path/​to/​rdseed/​executable
 setenv GF_PATH ​     /​path/​to/​greens/​functions/​database setenv GF_PATH ​     /​path/​to/​greens/​functions/​database
-setenv WPHASE_HOME ​ /​path/​to/​wphase/package+setenv WPHASE_HOME ​ /​path/​to/​wphase
 </​code>​ </​code>​
 If you use bash: If you use bash:
 <​code>​ <​code>​
-export GMT_BIN=/​path/​to/​gmt/​bin 
 export RDSEED=/​path/​to/​rdseed/​executable export RDSEED=/​path/​to/​rdseed/​executable
 export GF_PATH=/​path/​to/​greens/​functions/​database export GF_PATH=/​path/​to/​greens/​functions/​database
Line 38: Line 65:
 ----- -----
  
-==== How to run the W-phase ​code ====+===== How to run W-phase ​ =====
  
-=== Preparing directories,​ i_master and CMTSOLUTION ===+You should also have a look to [[wphase:​tutorial|the W-phase tutorial page]]. 
 + 
 +==== Preparing directories,​ i_master and CMTSOLUTION ​====
 Before each inversion, it is necessary to create a “run” directory containing two input ascii files: ​ 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.   * 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.                          ​   * 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 [[wphase#Notes on file formats|notes on file formats]]. ​+The format of these files are described in [[wphase:​documentation#Data formats|the file formats ​section]]. 
  
 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.  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. 
Line 51: Line 80:
 ----- -----
  
-=== 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 60: Line 89:
 ----- -----
  
-=== Calculating Synthetics, deconvolution and filtering ===+==== Extracting data from TGZ including SAC and PZ files (e.g., from WILBER / NIED) ==== 
 +As SEED volumes are no longer supported, waveforms and instrument response can also be retrived from a gzipped tar archive (hereafter referred to as tgz file) including SAC and SAC_PZ (poles and zeros) files. This can be done using:  
 +<​code>​${WPHASE_HOME}/​bin/​tgz2DATA_org.py path_to_tgz_archive.tgz</​code>​  
 +where path_to_tgz_archive.tgz is the path to the tgz archive including SAC and SAC_PZ files. 
 + 
 +Two tgz archive formats are currently supported: namely WILBER (default) and NIED. Using the default WILBER (i.e. IRIS) format, SAC files should be named with a "​.SAC"​ or "​.sac"​ extension and SAC_PZ file names should start with "​SAC_PZ"​. Although this is the default format, extraction from a WILBER tgz archive can be stated explicitly by running 
 +<​code>​${WPHASE_HOME}/​bin/​tgz2DATA_org.py path_to_tgz_archive.tgz wilber</​code> ​  
 + 
 +Using the NIED format, SAC_PZ files should end with "​.zp"​ and SAC file names can have any format. Extraction from a NIED tgz archive can be done using  
 +<​code>​${WPHASE_HOME}/​bin/​tgz2DATA_org.py path_to_tgz_archive.tgz nied</​code>​  
 + 
 +--- 
 + 
 +==== 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: 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:
 <​code>​${WPHASE_HOME}/​bin/​prepare_wp.csh</​code> ​ <​code>​${WPHASE_HOME}/​bin/​prepare_wp.csh</​code> ​
Line 70: Line 112:
  
 ----- -----
-=== Inversion ===+==== Inversion ​====
 The inversion can then be performed using the Kernels functions in ./GF and data files listed in i_wpinversion. ​ The inversion can then be performed using the Kernels functions in ./GF and data files listed in i_wpinversion. ​
  
Line 94: Line 136:
 $WPHASE_HOME/​bin/​wpinversion -ifil o_wpinv.th1.3 -ofil o_wpinv.th0.9 -th 0.9  $WPHASE_HOME/​bin/​wpinversion -ifil o_wpinv.th1.3 -ofil o_wpinv.th0.9 -th 0.9 
 </​code>​ </​code>​
-  - 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): <​code>​+  - Finally, it is possible to remove the channels showing a large rms amplitude ​ratios (observed/​predicted and predicted/​observed) using the option –nr (e.g. –nr 2.0): <​code>​
 $WPHASE_HOME/​bin/​wpinversion -ifil o_wpinv.th0.9 -ofil o_wpinv.th1.3 -nr 2.0 $WPHASE_HOME/​bin/​wpinversion -ifil o_wpinv.th0.9 -ofil o_wpinv.th1.3 -nr 2.0
 </​code>​ </​code>​
Line 105: Line 147:
  
 ----- -----
-=== RUNA scripts === +==== 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):+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 the "​Inversion" ​section ​above):
 <​code>​ <​code>​
 ${WPHASE_HOME}/​bin/​RUNA3.csh ${WPHASE_HOME}/​bin/​RUNA3.csh
Line 116: Line 158:
 will perform median and rms misfit screening for Z channels only. 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:+These two scripts don’t perform the “ratio screening” (i.e. 3. in the "​Inversion"​ section ​above). To run the same routines with an additional screening based on the rms amplitude ​ratio (observed/​predicted and predicted/​observed),​ the following ​script ​can be used:
 <​code>​ <​code>​
 ${WPHASE_HOME}/​bin/​RUNA3r.csh ​ ${WPHASE_HOME}/​bin/​RUNA3r.csh ​
Line 135: Line 177:
  
 ----- -----
-=== Grid searches ===+==== 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. 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.
  
Line 146: Line 188:
  
 ----- -----
-=== Plot routines ===+==== 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). 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).
Line 153: Line 195:
  
    * The first script is <​code>​${WPHASE_HOME}/​bin/​make_grids.py</​code>​ which be used to display grid-searches results. Use <​code>​${WPHASE_HOME}/​bin/​make_grids.py -h</​code>​ to have more details on available options and arguments. The 2 other scripts plot observed and synthetic seismograms after W phase inversion. ​    * The first script is <​code>​${WPHASE_HOME}/​bin/​make_grids.py</​code>​ which be used to display grid-searches results. Use <​code>​${WPHASE_HOME}/​bin/​make_grids.py -h</​code>​ 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: <​code>​${WPHASE_HOME}/​bin/​traces_global.py</​code>​ which draw complete seismograms and show station location on a map (if basemap is available). Please use <​code>​${WPHASE_HOME}/​bin/​traces_global.py -h</​code>​ for more details on available options.+   * In order to plot complete seismograms individually and place station on a map: <​code>​${WPHASE_HOME}/​bin/​traces.py</​code>​ which draw complete seismograms and show station location on a map (if basemap is available). Please use <​code>​${WPHASE_HOME}/​bin/​traces.py -h</​code>​ for more details on available options.
    * To plot concatenated waveforms:<​code>​${WPHASE_HOME}/​bin/​make_cwp.py</​code>​ For more details on available options and arguments see <​code>​${WPHASE_HOME}/​bin/​make_cwp.py -h</​code>​ to see the options.    * To plot concatenated waveforms:<​code>​${WPHASE_HOME}/​bin/​make_cwp.py</​code>​ For more details on available options and arguments see <​code>​${WPHASE_HOME}/​bin/​make_cwp.py -h</​code>​ to see the options.
  
 ------- -------
  
 +===== Using ETOPO01 Global Relief Model =====
 +
 +ETOPO01 is a 1 arc-minute global relief model of the Earth'​s surface
 +provided by Amante et al. (2009):
 +<​http://​www.ngdc.noaa.gov/​mgg/​global/​global.html>​
 +
 +If Basemap is installed, you can optionally draw ETOPO01 topography and
 +bathymetry. To do so, the path to the ETOPO01 netCDF file must be
 +assigned to the environment variable $ETOPOFILE which can be
 +done in your .tcshrc fil (or .bachrc, .cshrc, etc.). The make_grids.py
 +script have been tested only for grid-registered netCDF file of the
 +ETOPO1 bedrock file available at:
 +<​http://​www.ngdc.noaa.gov/​mgg/​global/​relief/​ETOPO1/​data/​bedrock/​grid_registered/​netcdf/​ETOPO1_Bed_g_gmt4.grd.gz>​
 +
 +
 +-------
 +
 +
 +===== Data formats =====
  
-==== File formats ==== +You can also have a look to [[wphase:​tutorial|the W-phase tutorial page]].
  
 === CMTSOLUTION FILE === === CMTSOLUTION FILE ===
wphase/documentation.txt · Last modified: 2022/01/10 07:39 by wphase