Compute Stretching

Compute seismic velocity changes via the stretching method.

The stretching technique (Sens-Schönfelder and Wegler[1]) measures \(dv/v\) by finding the uniform dilation factor \(\varepsilon\) that maximises the normalised cross-correlation between a time-stretched copy of the reference CCF and the current daily CCF:

\[s_\varepsilon(\tau) = s_\text{ref}\!\left(\frac{\tau}{1+\varepsilon}\right)\]
\[CC(\varepsilon) = \frac{ \int_{\tau_\text{min}}^{\tau_\text{max}} s_\text{cur}(\tau)\, s_\varepsilon(\tau)\, d\tau }{ \sqrt{ \int |s_\text{cur}|^2 d\tau \cdot \int |s_\varepsilon|^2 d\tau } }\]

The relative velocity change is \(dv/v = -\varepsilon^*\) where \(\varepsilon^* = \arg\max_\varepsilon\, CC(\varepsilon)\). In practice, \(\varepsilon\) is sampled over stretching_nsteps values in \([-\varepsilon_\text{max},\, \varepsilon_\text{max}]\) (stretching_max) and the optimal value is found by peak-picking.

Warning

if using only mov_stack = 1, no STR jobs is inserted in the database and consequently, no STR calculation will be done! FIX!

Configuration Parameters

  • stretching.stretching_max : Maximum stretching coefficient (default=0.02)

  • stretching.stretching_nsteps : Number of stretching steps (default=1000)

  • stretching.stretching_minlag : Minimum lag time (default=5.0)

  • stretching.stretching_width : Width of the time lag window (default=30.0)

  • stretching.stretching_lag : How the lag window is defined for stretching (default=static)

  • stretching.stretching_v : What velocity to use to avoid ballistic waves (default=1.0)

  • stretching.stretching_sides : Which sides to use (default=both)

  • stack.mov_stack : A list of two parameters: the time to “roll” over (default 1 day) and the granularity (step) of the resulting stacked CCFs (default 1 day) to stack for the Moving-window stacks. This can be a list of tuples, e.g. ((‘1d’,’1d’),(‘2d’,’1d’)) corresponds to the MSNoise 1.6 “1,2” before. Time deltas can be anything pandas can interpret (“d”, “min”, “sec”, etc). (default=((‘1D’,’1D’)))

  • refstack.ref_begin : Start of REF period. Absolute date (YYYY-MM-DD) OR negative integer for rolling-index mode (e.g. -5 means 5 windows before current) (default=1970-01-01)

  • refstack.ref_end : End of REF period. Absolute date (YYYY-MM-DD) OR negative integer (e.g. -1 means exclude self). Must be > ref_begin when both are negative. (default=2100-01-01)

  • cc.cc_sampling_rate : Sampling Rate for the CrossCorrelation (in Hz) (default=20.0)

  • cc.maxlag : Maximum lag (in seconds) (default=120.0)

  • cc.components_to_compute : List (comma separated) of components to compute between two different stations (default=ZZ)

  • cc.components_to_compute_single_station : List (comma separated) of components within a single station. ZZ would be the autocorrelation of Z component, while ZE or ZN are the cross-components. Defaults to [], no single-station computations are done. (default=)

  • global.hpc : Is MSNoise going to run on an HPC? (default=N)

The output of this process is a table of delays measured at each window in the functions. The following is an example for lag times between -115 and -90. In this case, the window length was 10 seconds with an overlap of 5 seconds.

      LAG_TIME          DELAY           ERROR         MEAN COHERENCE
-1.1500000000e+02 -1.4781146383e-01 5.3727119135e-02 2.7585243911e-01
-1.1000000000e+02 -6.8207526992e-02 2.0546644311e-02 3.1620999352e-01
-1.0500000000e+02 -1.0337029577e-01 8.6645155402e-03 4.2439269880e-01
-1.0000000000e+02 -2.8668775696e-02 6.2522215988e-03 5.7159849528e-01
-9.5000000000e+01  4.1803941008e-02 1.5102285789e-02 4.1238557789e-01
-9.0000000000e+01  4.8139400233e-02 3.2700657018e-02 3.0586187792e-01

This process is job-based, so it is possible to run several instances in parallel.

Once done, each job is marked “D”one in the database and, unless hpc is Y, DTT jobs are inserted/updated in the database.

To run this step:

$ msnoise cc dtt compute_stretching

This step also supports parallel processing/threading:

$ msnoise -t 4 cc dtt compute_stretching

will start 4 instances of the code (after 1 second delay to avoid database conflicts). This works both with SQLite and MySQL but be aware problems could occur with SQLite.

Parallel Processing

See also

Reading these results in Python — use MSNoiseResult:

from msnoise.results import MSNoiseResult
from msnoise.core.db import connect
db = connect()
r = MSNoiseResult.from_ids(db, ...)  # include the steps you need
# then call r.get_stretching(...)

See Reading outputs with MSNoiseResult for the full guide and all available methods.