relmt.extra module#
- relmt.extra.apparent_corner_frequency(sig, sampling_rate, fmin=None, fmax=None)[source]#
Find apparant corner frequency in velocity spectrum of 1D seismogram
- Parameters:
- Returns:
float– Maximum of the spectrum (Hz)
Attention
Depends on
multitaper
- relmt.extra.focal_mechanism_to_mt(strike, dip, rake, magnitude=None)[source]#
Convert focal mechanism to moment tensor
- relmt.extra.geoconverter_latlon2utm(latitude, longitude, depth, utm_num, utm_let)[source]#
Convert geographic to local UTM coordinates
- Parameters:
- Returns:
north, east, depth (float) – Local UTM coordinates in meters
Hint
Wrap into a custom function to use as a geoconverter when reading station or event tables
def geconverter_oslo(lat, lon, dep): return geoconverter_latlon2utm(lat, lon, dep, 32, "V")
Attention
Depends on
utm
- relmt.extra.geoconverter_utm2latlon(northing, easting, depth, utm_num, utm_let)[source]#
Convert geographic to local UTM coordinates
- Parameters:
- Returns:
latitude, longitude, depth (float) – Geographical coordinates in degree and kilometers
Attention
Depends on
utm
- relmt.extra.get_utm_zone(latitudes, longitudes)[source]#
Get UTM zone number and letter from coordinates.
- Parameters:
- Returns:
num (int) – Consensus UTM zone number
let (str) – Consensus UTM zone letter
- Raises:
LookupError: – If coordinates exceed one zone.
Attention
Depends on
utm
- relmt.extra.make_waveform_array(header, phase_dict, stream)[source]#
Isolate time windows around picks and write to waveform array
- Parameters:
header (
Header) – Station and phase meta dataphase_dict (
dict[str,Phase]) – Phase dictionary containing phase arrival timesstream (
obspy.core.stream.Stream) – Seismic event waveforms
- Returns:
arr (
numpy.ndarray) – Waveform arrayhdr (
relmt.core.Header) – Updated waveform header
Attention
Depends on
obspy
- relmt.extra.optimal_bandpass(wvarr, sampling_rate, data_window, phase_start, phase_end, fmin=None, fmax=None, min_snr=0)[source]#
Find bandpass with signal-to-noise ratio above threshold
- Parameters:
- Returns:
highpass, lowpass (float) – Optimal filter corners (Hz)
Attention
Depends on
multitaper
- relmt.extra.read_catalog_picks(catalog, event_dict, include_at=inf)[source]#
Read arrival times from ObsPy Catalog object
- Parameters:
catalog (
obspy.core.event.catalog.Catalog) – Must contain station codes, phases, and arrival times.include_at (
float) – Include picks within this time difference between event_dict and catalog origin times (seconds)
- Returns:
Attention
Depends on
obspy
- relmt.extra.read_obspy_inventory_files(filenames)[source]#
Read station files using
obspy.core.inventory.inventory.read_inventory()Attention
Depends on
obspy
- relmt.extra.read_station_inventory(inventory, geoconverter, strict=True)[source]#
- Parameters:
inventory (
obspy.core.inventory.inventory.Inventory) – Must contain network and station codes, and coordinates.geoconverter (
Callable) – Function that takes longitude, latitude and depth as arguments and returns local northing and easting and depth coordinates in meters. Depth conversion unused, solely required for compatibility with geoconverter argument inrelmt.io.read_event_table().strict (
bool) – Raise a KeyError for repeated station codes with unequal coordinates. If False, last occurrence overwrites previous occurrences
- Returns:
- Raises:
ValueError: – When station code contains the reserved character ‘_’
KeyError: – When repeated station codes are met and stict=True
Attention
Depends on
obspy