5.2.8.1.1. eqcorrscan.utils.mag_calc.amp_pick_event

eqcorrscan.utils.mag_calc.amp_pick_event(event, st, inventory, chans=('Z',), var_wintype=True, winlen=0.9, pre_pick=0.2, pre_filt=True, lowcut=1.0, highcut=20.0, corners=4, min_snr=1.0, plot=False, remove_old=False, ps_multiplier=0.34, velocity=False, water_level=0, iaspei_standard=False)[source]

Pick amplitudes for local magnitude for a single event.

Looks for maximum peak-to-trough amplitude for a channel in a stream, and picks this amplitude and period. There are a few things it does internally to stabilise the result:

1. Applies a given filter to the data using obspy’s bandpass filter. The filter applied is a time-domain digital SOS filter. This is often necessary for small magnitude earthquakes. To correct for this filter later the gain of the filter at the period of the maximum amplitude is retrieved using scipy’s sosfreqz, and used to divide the resulting picked amplitude.

2. Picks the peak-to-trough amplitude, but records half of this to cope with possible DC offsets.

3. The maximum amplitude within the given window is picked. Care must be taken to avoid including surface waves in the window;

4. A variable window-length is used by default that takes into account P-S times if available, this is in an effort to include only the body waves. When P-S times are not available the ps_multiplier variable is used, which defaults to 0.34 x hypocentral distance.

Parameters:
  • event (obspy.core.event.event.Event) – Event to pick

  • st (obspy.core.stream.Stream) – Stream associated with event

  • inventory (obspy.core.inventory.Inventory) – Inventory containing response information for the stations in st.

  • chans (tuple) – Tuple of the components to pick on, e.g. (Z, 1, 2, N, E)

  • var_wintype (bool) – If True, the winlen will be multiplied by the P-S time if both P and S picks are available, otherwise it will be multiplied by the hypocentral distance*ps_multiplier, defaults to True

  • winlen (float) – Length of window, see above parameter, if var_wintype is False then this will be in seconds, otherwise it is the multiplier to the p-s time, defaults to 0.9.

  • pre_pick (float) – Time before the s-pick to start the cut window, defaults to 0.2.

  • pre_filt (bool) – To apply a pre-filter or not, defaults to True

  • lowcut (float) – Lowcut in Hz for the pre-filter, defaults to 1.0

  • highcut (float) – Highcut in Hz for the pre-filter, defaults to 20.0

  • corners (int) – Number of corners to use in the pre-filter

  • min_snr (float) – Minimum signal-to-noise ratio to allow a pick - see note below on signal-to-noise ratio calculation.

  • plot (bool) – Turn plotting on or off.

  • remove_old (bool) – If True, will remove old amplitudes and associated picks from event and overwrite with new picks. Defaults to False.

  • ps_multiplier (float) – A p-s time multiplier of hypocentral distance - defaults to 0.34, based on p-s ratio of 1.68 and an S-velocity 0f 1.5km/s, deliberately chosen to be quite slow.

  • velocity (bool) – Whether to make the pick in velocity space or not. Original definition of local magnitude used displacement of Wood-Anderson, MLv in seiscomp and Antelope uses a velocity measurement. velocity and iaspei_standard are mutually exclusive.

  • water_level (float) – Water-level for seismometer simulation, see https://docs.obspy.org/packages/autogen/obspy.core.trace.Trace.remove_response.html

  • iaspei_standard (bool) – Whether to output amplitude in IASPEI standard IAML (wood-anderson static amplification of 1), or AML with wood-anderson static amplification of 2080. Note: Units are SI (and specified in the amplitude)

Returns:

Picked event

Return type:

obspy.core.event.Event

Note

Signal-to-noise ratio is calculated using the filtered data by dividing the maximum amplitude in the signal window (pick window) by the normalized noise amplitude (taken from the whole window supplied).

Note

With iaspei_standard=False, picks will be returned in SI units (m or m/s), with the standard Wood-Anderson sensitivity of 2080 applied such that the measurements reflect the amplitude measured on a Wood Anderson instrument, as per the original local magnitude definitions of Richter and others.