6.2.8.1.6. eqcorrscan.utils.mag_calc.relative_amplitude

eqcorrscan.utils.mag_calc.relative_amplitude(st1, st2, event1, event2, noise_window=(-20, -1), signal_window=(-0.5, 20), min_snr=1.5, use_s_picks=False)[source]

Compute the relative amplitudes between two streams.

Uses standard deviation of amplitudes within trace. Relative amplitudes are computed as:

\[\frac{std(tr2)}{std(tr1)}\]

where tr1 is a trace from st1 and tr2 is a matching (seed ids match) trace from st2. The standard deviation of the amplitudes is computed in the signal window given. If the ratio of amplitudes between the signal window and the noise window is below min_snr then no result is returned for that trace. The SNR here is defined as the ratio of RMS-amplitudes of signal and noise (equal to ratio of L2-norms of signal and noise, but normalized for signal length). The Windows are computed relative to the first pick for that station.

If one stream has insufficient data to estimate noise amplitude, the noise amplitude of the other will be used.

Parameters:
  • st1 (obspy.core.stream.Stream) – Stream for event1

  • st2 (obspy.core.stream.Stream) – Stream for event2

  • event1 (obspy.core.event.Event) – Event with picks (nothing else is needed)

  • event2 (obspy.core.event.Event) – Event with picks (nothing else is needed)

  • noise_window (tuple of float) – Start and end of noise window in seconds relative to pick

  • signal_window (tuple of float) – Start and end of signal window in seconds relative to pick

  • min_snr (float) – Minimum signal-to-noise ratio allowed to make a measurement

  • use_s_picks (bool) – Whether to allow relative amplitude estimates to be made from S-picks. Note that noise and signal windows are relative to pick-times, so using an S-pick might result in a noise window including P-energy.

Return type:

dict, dict, dict

Returns:

Dictionary of relative amplitudes keyed by seed-id Dictionary of signal-to-noise ratios for st1 Dictionary of signal-to-noise ratios for st2