AutoQuakePycker package¶
Submodules¶
AutoQuakePycker.nlloc_wrapping module¶
Various wrapping functions for integrating AutoQuakePycker with NonLinLoc
-
AutoQuakePycker.nlloc_wrapping.get_theoretical_tt(event)¶ Find theoretical arrival times from NLLoc Time2EQ (containing 1 event).
Parameters: event (ObsPy event object) – Returns: e Return type: ObsPy event object containing theoretical arrival times
-
AutoQuakePycker.nlloc_wrapping.relocate(evt_refined)¶ Carry out relocation using newly picked events in NonLinLoc
Parameters: - evt_refined (ObsPy event object) –
- tr (ObsPy trace object) –
Returns: ev_new
Return type: ObsPy event object containing relocated event
AutoQuakePycker.pickerfuncs module¶
Various functions for the Kurtosis picker of AutoQuakePycker
-
AutoQuakePycker.pickerfuncs.CF_kurtosis(kurt_win_size, tr)¶ This is the Kurtosis function of Baillard et al. (2014, SRL) (Eq. 10). Sets values outside of window to NaN.
Parameters: - kurt_win_size (kurtosis window length in seconds) –
- tr (ObsPy trace object) –
Returns: cf
Return type: kurtosis characteristic function time series
-
AutoQuakePycker.pickerfuncs.get_best_picks(sta, max_wind, orig_time, comps, sptype, cfg)¶ Define best Picks Choose whether to use fixed min S-P time or variable S-P time depending on P-arrival time and Vp/Vs ratio (Wadati method) This is quite messy. Could benefit from some improvements.
Parameters: - sta (Station dictionary containing picking results) –
- max_wind (Window length around theoretical arrival time to select pick in) –
- orig_time (UTCDateTime) –
Returns: f4
Return type: f4 kurtosis transform time series
-
AutoQuakePycker.pickerfuncs.kurt_transform_f2(f1, kurt_win_size, tr)¶ Apply transformations as per Baillard (BSSA). Remove neg slope of the CF from the sliding kurtosis fonction.
Parameters: - f1 (f1 transform time series) –
- kurt_win_size (kurtosis window length in seconds) –
- tr (ObsPy trace object) –
Returns: f2
Return type: f2 kurtosis transform time series
-
AutoQuakePycker.pickerfuncs.kurt_transform_f3(f2, kurt_win_size, tr)¶ Remove the linear trend of F2. Eq. 12
Parameters: - f2 (f2 transform time series) –
- kurt_win_size (kurtosis window length in seconds) –
- tr (ObsPy trace object) –
Returns: f3
Return type: f3 kurtosis transform time series
-
AutoQuakePycker.pickerfuncs.kurt_transform_f4(f3, kurt_win_size, tr)¶ Find greatest minima correspond to the greatest onset strengths.
Parameters: - f3 (f3 transform time series) –
- kurt_win_size (kurtosis window length in seconds) –
- tr (ObsPy trace object) –
Returns: f4
Return type: f4 kurtosis transform time series
AutoQuakePycker.plotting module¶
Routines for plotting the results of AutoQuakePycker
-
AutoQuakePycker.plotting.plot_record_section(st_sta)¶ TODO
-
AutoQuakePycker.plotting.plot_sta_results(sta, st_sta, runtype, orig_time, pdf, fig, cmps, cfg)¶ Plot picking results for each station
Parameters: - sta (Dictionary of station pick results) –
- st_sta (ObsPy stream containing waveform data for station) –
- runtype –
- tr (ObsPy trace object) –
Returns: ev_new
Return type: ObsPy event object containing relocated event
AutoQuakePycker.running_funcs module¶
Main functions for processing events on different processors
-
AutoQuakePycker.running_funcs.AutoQuakePycker_run()¶ Starts up AutoQuakePycker and sets-up processes
-
AutoQuakePycker.running_funcs.process_events(cat_data, n_run, cfg, sta_locs)¶ This is the main function that runs a given set of events and does the multi-stage refinement.
-
AutoQuakePycker.running_funcs.process_station(sta, st_sta, dist, ev_dict, evt, orig_time, phase, cmps, cfg)¶ Get ready to process data. Sets up emtpy arrays. Checks noise level of data.
-
AutoQuakePycker.running_funcs.process_trace(n_tr, tr, sta, orig_time, cmps, cfg)¶ Process picking on each trace parsed by process_station.
-
AutoQuakePycker.running_funcs.refine_events(st, stations_dist, cmps, max_pick_diff, evt, do_plot, n_refine, fig, sptype, path_to_figs, ev_dict, ev_id, cfg, rot=False)¶ This is one of the main functions of this code. It processes a refinement attempt for each event.
AutoQuakePycker.utils module¶
Routines for plotting the results of AutoQuakePycker
-
AutoQuakePycker.utils.add_picks(sta, e, orig_time, st, cfg)¶ Add picks made to ObsPy event structure.
Parameters: - sta (variable station & picking data (dict)) –
- e (event (ObsPy event object)) –
- orig_time (event origin time (ObsPy UTCDateTime object)) –
- st (stream of ObsPy traces containing data (Obspy stream object)) –
Returns: e
Return type: event containg added picks (ObsPy event object)
-
AutoQuakePycker.utils.compute_magnitude(evt, st, cfg)¶ Compute local magnitude for event. Uses the same approach as Bie et al. (2019, SRL), although we don’t bother with checking signal-to-noise ratio this time.
Parameters: - evt (ObsPy event object) –
- st (Obspy event stream containing waveform data) –
- cfg (Attribute-style dictionary containing picker configuration) –
Returns: evt
Return type: ObsPy event object containing computed magnitude
-
AutoQuakePycker.utils.compute_noise_levels(tr, cfg)¶ Get simple estimate of trace noise level using STA/LTA function - similar to thhat described by Baillard et al. (2014, BSSA).
-
AutoQuakePycker.utils.copytree(src, dst, symlinks=False, ignore=None)¶ Make NLLOC run directory for each process
Parameters: - src (Copy source location (str)) –
- dst (Copy desination location (dst)) –
-
AutoQuakePycker.utils.do_smooth(d, WT, sample_rate)¶ Simple windowing smoothing function. (takes data to right of smoothing point).
Parameters: - d (Time series to smooth (NumPy array)) –
- WT (Smoothing window length in seconds (float)) –
- sample_rate (sampling rate of time series (float)) –
Returns: d_smooth
Return type: smoothed time series (NumPy array)
-
AutoQuakePycker.utils.rotate(st, evt)¶ Rotate raw 3-component data to ZRT coordinate system. Throws up flag if rotation cannot be done (e.g. due to not all components spanning the same time)
Parameters: - st (ObsPy stream containing waveform data) –
- evt (ObsPy event object containing epicentre information for rotation) –
Returns: - st_sta_rot (ObsPy event object containing rotated traces)
- done (Boolean flag stating whether rotation was succesful or not)
-
AutoQuakePycker.utils.write_evt(evt, ev_id)¶ Write refined event with new picks to stationxml file
Parameters: - evt (Obspy event object) –
- ev_id (Event ID (str)) –