mtuq.ProcessData¶
- class mtuq.ProcessData(filter_type=None, window_type=None, pick_type=None, freq_min=None, freq_max=None, period_min=None, period_max=None, freq=None, period=None, window_length=None, apply_padding=False, apply_statics=False, time_shift_min=None, time_shift_max=None, apply_weights=True, apply_scaling=True, scaling_power=None, scaling_coefficient=None, capuaf_file=None, taup_model=None, FK_database=None, FK_model=None, CPS_database=None, CPS_model=None, **parameters)[source]¶
Bases:
object
An attempt at a one-size-fits-all data processing class
Usage
Processing data is a two-step procedure. First, the user supplies parameters (see available choices below) to create a data processing function:
function = ProcessData(**parameters)
Second, an ObsPy stream is given as input to the data processing function and a processed stream returned as output:
processed_stream = function(stream)
Data processing can also be applied to an entire
Dataset
at once:processed_dataset = dataset.map(function)
See mtuq/examples/ for further illustration.
Parameters
filter_type
(str)'bandpass'
Butterworth-Bandpass (uses obspy.signal.filter.bandpass)'lowpass'
Butterworth-Lowpass (uses obspy.signal.filter.lowpass)'highpass'
Butterworth-Highpass (uses obspy.signal.filter.highpass)None
no filter will be applied
pick_type
(str)'taup'
calculates P, S travel times from Tau-P model (uses obspy.taup.TauPyModel.get_arrival_times)'FK_metadata'
reads P, S travel times from FK metadata'CPS_metadata'
reads P, S travel times from CPS metadata'SAC_metadata'
reads P, S travel times from SAC metadata fields t5, t6'user_supplied'
reads P, S travel times from columns 8, 10 of capuaf_fileNone
no P,S travel times will be calculated
window_type
(str)'body_wave'
regional-distance body-wave window'surface_wave'
regional-distance surface-wave window'group_velocity'
surface-wave window centered on given group velocityNone
no windows will be applied
apply_statics
(bool) Whether or not to apply static time shifts from columns 11-12 of capuaf_fileapply_weights
(bool) Whether or not to apply objective function weights from columns 3-8 of capuaf_fileapply_scaling
(bool) Whether or not to apply distance-dependent amplitude scalingapply_padding
(bool) Whether or not to use longer Green’s window relative to observed data window (allows for more accurate cross-correlations)Other input arguments that may be required, depending on the above
freq_min
(float) Required for filter_type=bandpassfreq_max
(float) Required for filter_type=bandpassfreq
(float) Required for filter_type=lowpass or filter_type=highpasswindow_length
(float) Window length in secondsgroup_velocity
(float) Group velocity in m/s, required for window_type=group_velocitywindow_alignment
(float) Optional window alignment for window_type=group_velocity (float between 0. and 1.)time_shift_min
(float) Required for apply_padding=Truetime_shift_max
(float) Required for apply_padding=Truetaup_model
(str) Name of built-in ObsPy TauP model or path to custom ObsPy TauP model, required for pick_type=taupFK_database
(str) Path to FK database, required for pick_type=FK_metadataCPS_database
(str) Path to CPS database, required for pick_type=CPS_metadatacapuaf_file
(str) Path to CAPUAF-style text file, required for pick_type=user_supplied