Aftershock Sequence Selection Code (CHURCHILL_aftershockselect)
- 1. University of Bristol
- 2. Cardiff University
Description
This python code selects aftershock sequences for moderate-large mainshocks using three methods: our own 2D and 3D methods, and an external Nearest Neighbour Declustering (NND) method. Methods are explained in the accompanying paper by Churchill, Werner, Biggs, and Fagereng: Churchill, R.M., Werner, M.J., Biggs, J. and Fagereng, Å., 2022. Relative afterslip moment does not correlate with aftershock productivity: Implications for the relationship between afterslip and aftershocks. Geophysical Research Letters, 49(24), p.e2022GL101165. https://agupubs.onlinelibrary.wiley.com/doi/full/10.1029/2022GL101165 (please cite this accompanying study when refering to this notebook). Relevant references are given in the accompanying study as well as at the bottom of this code.
This notebook has the following sections:
1. Introduction (including Requirements, Imports, and Functions)
2. Specification of Mainshock Information
3. Calculation of 2D and 3D Aftershock-zone Scaling Distances and Preliminary Search for Seismicity
4. Aftershock Selection (Import and Run 2D Aftershock Selection Function, Run 3D Selection, Run NND Selection)
5. Generate Plots
Cells in this notebook need to be run in sequence. The code may be buggy for particular mainshocks and may require manual editting/commenting-out of certain lines (e.g. when the 3D or NND method can't be used for a particular mainshock, or when too few aftershocks are selected for a given mainshock). The role of this notebook is to guide someone through the aftershock selection methods used in the accomanying paper in an intuative and step-by-step way (e.g. we often use arrays and lists instead of Pandas dataframes). For this reason, the code in this notebook is not particularly efficient, nor is it unbreakable. Please feel free to use and adapt.
The following Python packages are required for this notebook: datetime, libcomcat, os, pandas, numpy, matplotlib, scipy, haversine, shapely, math. This code requires an internet connection to run 'Search' from the libcomcat library (libcomcat can be installed from here: https://doi.org/10.5066/P91WN1UQ, You may wish to to adapt section 3 to use an offline downloaded catalog).
Please download all items to the same directory - the directory that this notebook is being run in requires the file 'OUTNEIC_M4.txt' and the folder 'srcmod' (which is currently compressed).
- 'OUTNEIC_M4.txt' is the pre-processed NND data. We ran a Nearest Neighbour Declustering algorithm (Baiesi & Paczuski 2004, Baiesi et al 2006, Zaliapin & Ben-Zion 2016) on the NEIC catalog 1979-2019, using the parameters of Zaliapin & Ben-Zion (2016) and an Mc of 4.5.
- 'srcmod' is a folder of all slip models compiled in the Earthquake source model catalog SRCMOD (Mai & Thingbaijam 2014).
Subsequent versions may be uploaded with additional/alternative comments. However, the functionality of this code will not change.