-
Notifications
You must be signed in to change notification settings - Fork 10
Noise Toolkit Polarization Attributes bundle V.1
The IRIS DMC Noise Toolkit Polarization Attributes (POLAR) bundle is a collection of 3 Python scripts that are configurable and allow users to conveniently calculate and extract polarization attributes of 3-C seismic data. Although this package takes advantage of the FDSN Web service client for ObsPy to retrieve necessary waveform data, but it also allows users to process waveform data from their local files. This bundle is a standalone bundle that directly computes the spectra of the input waveform data in order to form the corresponding spectra covariance matrix for polarization analysis. As such, to use this bundle installation of other bundles of the Noise Toolkit is not necessary.
The scripts included in this bundle are:
- ntk_computePolarization.py – an ObsPy script to calculate polarization parameters for a given station and time window
- ntk_extractPolarHour.py – a Python script to extract polarization parameters for the given channels and bounding parameters. The output is similar to the output of the ntk_extractPsdHour.py script of the PDF/PSD bundle with addition of polarization attributes.
- ntk_binPolarDay.py – a Python script to bin polarization attributes to daily files for a given channel tag and bounding parameters. The output is similar to that of the ntk_binPsdDay.py script of the PDF/PSD bundle with addition of polarization attributes.
The output of the polarization scripts also includes power as a function of frequency for the vertical component, the east-west component and the north-south component and the principal eigenvalue (λ).
See also the bundle’s INSTALL.txt file- install Python 2.7 on your computer
- additional required Python modules are:
. matplotlib
. numpy
. scipy
. obspy - download the package under the installation directory.
- under the root directory of the Noise Toolkit (IRIS_NTK) execute the following command to plot polarization attributes of the NM.SLM.00.BH? data for 2 one hour windows with 50% overlap starting at 2009-01-01 01:00:00.0:
python bin/ntk_computePolarization.py param=computePolarization net=NM sta=SLM loc=DASH start=2009-01-01T01:00:00 end=2009-01-01T02:00:00 type=frequency mode=plot
Plot generated by the ntk_computePolarization.py script showing power and polarization parameters obtained by processing one hour of BHZ, BHN, BHE data of the NM.SLM station (St. Louis, MO station, Cooperative New Madrid Seismic Network, NM) between 2009-01-01 01:00:00.0 and 2009-01-01 02:00:00.0 UTC.
Next:
- review all parameter files located under the param directory to get familiar with the script capabilities
- use examples given below to run/test the scripts and become familiar with them
- edit the parameter files under the IRIS_NTK/param directory to change parameters based on your needs
- for more information visit the IRIS DMC Noise Toolkit Data Product web page at:
ds.iris.edu/ds/products/noise-toolkit
- the “DeprecationWarning: Development and maintenance efforts will focus on the new obspy.fdsn client…..” message
that you receive from the script is caused by script loading the IRIS module and should not affect the run
- examples below may turn on the verbose mode. Once you have configured the script, you can turn it off
- We welcome patches and enhancements to this software. When developing patches, please pay particular attention to ease of use and maintenance and also keep dependencies to a minimum.
- for issues, file a ticket under Issues
- R 0.5.0 2015-10-15 Beta release
Use below examples to run/test the scripts and become familiar with them. Edit the parameter files under the IRIS_NTK/param directory to change parameters based on your needs.
compute polarization parameters for a given station and time window using command arguments and the associated parameters in the configuration filespython bin/ntk_computePolarization.py param=computePolarization net=NM sta=SLM loc=DASH start=2009-01-01T01:00:00 end=2009-01-01T02:00:00 type=frequency mode=plot param: configuration file name net: network code sta: station code loc: location identifier start: interval start date time end: interval end date time type: x-axis type (period or frequency) mode: plot - run in plot mode; time - run in timing mode; verbose - run in verbose mode; 0 - run with minimum message output
NOTES & EXAMPLES:
IN ALL EXAMPLES IT IS ASSUMED THAT THE COMMAND IS ISSUED UNDER THE IRIS_NTK/ DIRECTORY
Please note that the “DeprecationWarning: Development and maintenance efforts will focus on the new obspy.fdsn client…..” message
that you receive from the script is caused by script loading the IRIS module and should not affect the run
python bin/ntk_computePolarization.py param=computePolarization net=NM sta=SLM loc=DASH start=2009-01-01T01:00:00 end=2009-01-01T02:00:00 type=frequency mode=0
log period or log frequency. The first sample is placed at xStart second or xStart Hz as defined in the parameter file and
log-regular samples are created on both sides. User may set xStart=‘Nyquist’ in the parameter file to set the Nyquist
frequency as the reference. The former option will result the same period or frequency samples regardless of the station
sampling interval
python bin/ntk_computePolarization.py param=computePolarization net=NM sta=SLM loc=DASH start=2009-01-01T00:00:00 end=2009-01-02T00:00:00 type=frequency mode=0
(see #supported-formats at http://docs.obspy.org/packages/autogen/obspy.core.stream.read.html#supported-formats)
then you can instruct the script to get the waveform data from these files and connect to Web Services for the response information
only. To do this you need to update two parameters in your parameter file (such pas param/computePolarization.py):
set
requestClient = “FILES” to flag the script that the waveform data are coming from file
fileTag = “{IRIS_NTK_PSD}/data/TEST/SAC/W*.SAC” to tell it which files to look at
python bin/ntk_computePolarization.py param=computePolarization net=TA sta=W5 loc=DASH start=2014-03-17T04:30:00 end=2014-03-17T05:30:00 type=frequency mode=plot
too many stations may cause timeouts. Script will only write the timeout message and has no way of handling it. Even for
smaller requests there is a chance that data requests fail when timeout is reported. User should scan the output messages
and re-queue the timed out requests again.
3-channel 1 hour time window with 50% overlap takes about 17 seconds to process.
nohup python bin/ntk_computePolarization.py param=computePolarization net=TA sta=W56A loc=DASH start=2014-03-17T04:30:00 end=2014-03-17T05:30:00 type=frequency mode=time >& /tmp/polarW56A_2014 &
for more information on FDSN WS specifications see
"www.fdsn.org/webservices/FDSN-WS-Specifications-1.1.pdf":http://www.fdsn.org/webservices/FDSN-WS-Specifications-1.1.pdf
python bin/ntk_extractPolarHour.py param=extractPolarHour net=NM sta=SLM loc=DASH chandir=BHZ_BHE_BHN start=2009-01-01T00:00:00 end=2009-01-02T00:00:00 type=frequency mode=0 param: configuration file name net: network code sta: station code loc: location identifier start: interval start date time end: interval end date time type: x-axis type (period or frequency) mode: verbose - run in verbose mode; 0 - run with minimum message outputThe ntk_computePolarization.py output files The output is similar to the output of the ntk_extractPsdHour.py script of the PDF/PSD bundle and PQLX’s exPSDhour script
with additional polarization attributes. The output path/file name are displayed at the end of the run.
python bin/ntk_extractPolarHour.py param=extractPolarHour net=NM sta=SLM loc=DASH chandir=BHZ_BHE_BHN start=2009-01-01T00:00:00 end=2009-01-02T00:00:00 type=period mode=0
<br /><br /> python bin/ntk_binPolarDay.py param=binPolarDay net=NM sta=SLM loc=DASH chandir=BHZ_BHE_BHN start=2009-01-01 end=2009-01-02 type=frequency mode=0 param: configuration file name net: network code sta: station code loc: location identifier chandir: channel directory start: interval start date time end: interval end date time type: x-axis type (period or frequency) mode: plot - verbose - run in verbose mode; 0 - run with minimum message outputThe ntk_computePolarization.py output files
python bin/ntk_binPolarDay.py param=binPolarDay net=NM sta=SLM loc=DASH chandir=BHZ_BHE_BHN start=2009-01-01 end=2009-01-02 type=frequency mode=0
Full path to the output data file(s) is provided at the end of the run. You may turn off hourly file output via the configuration file
Previous release (V.1) docs: