mtuq.PolarityMisfit¶
- class mtuq.PolarityMisfit(method='taup', taup_model='ak135', FK_database=None, FK_model=None, CPS_database=None, CPS_model=None, **parameters)[source]¶
Bases:
object
Polarity misfit function
Usage
Evaluating polarity misfit is a two-step procedure.
First, the user supplies parameters such as the method used to calculate predicted polarities (see below for detailed parameter descriptions):
polarity_misfit = PolarityMisfit(**parameters)
Second, the user invokes the misfit function:
values = polarity_misfit(data, greens, sources)
During misfit evaluation
observed polarities are collected from the data argument, which can be either a list of integers or a Dataset with observed polarity values attached (see convention below for more information)
predicted polarities are calculated from the greens argument (see parameter descriptions below for more information)
a NumPy array of length len(sources) is returned, giving the number of mismatches between observed and predicted
Parameters
method
(str)'taup'
Calculate polarities using Taup-P'FK_metadata'
Read polarities from FK database'CPS_metadata'
Read polarities from CPS database'waveform'
Determine polarity from full-waveform synthetics (not implemented yet)
Other input arguments that may be required, depending on the above
taup_model
(str): Name of built-in ObsPy TauP model or path to custom ObsPy TauP model, required for method=taupFK_database
(str): Path to FK database, required for for method=FK_metadata.Note
Convention : Positive vertical first motions are encoded as +1 and negative vertical first motions are encoded as -1. Unpicked or indeterminate first motions can be encoded as 0.
Public Methods
Collect polarity-related attributes (used for beachball plots)
Extracts observed polarities from data
Calculates predicted polarities