Skip to content

Codes used in the earthquake detection and location method presented in Beauce et al. 2019. A real data example is also provided.

Notifications You must be signed in to change notification settings

sulphur1010/earthquake_detection_EB_et_al_2019

 
 

Repository files navigation

earthquake_detection_EB_et_al_2019

Codes used in the earthquake detection and location method presented in Beauce et al. 2019. A real data example is also provided.

Prerequirements:

To make our lives easier, we should work with the same Puython environment as the one I am using to develop these codes. I recommand to use conda (cf. https://www.anaconda.com/) to manage different environments. The file "package_list_Beauce_2019.txt" contains all the information required for you to clone my environment by running the following command line:

$ conda create --name Beauce2019 --file package_list_Beauce_2019.txt

Once your new Python environment has been created, activate it by running:

$ source activate Beauce2019

Template matching is done using the software Fast Matched Filter (FMF, Beaucé et al 2017, doi: 10.1785/0220170181), which is available at https://github.com/beridel/fast_matched_filter. cf. the documentation to properly install FMF. If you go for the pip installation (which I recommend), make sure your Beauce2019 environment is activated when installing FMF.

To compile both FMF and the codes provided here, you will need a C compiler and the cuda compiler nvcc if you wish to use the GPU codes. For example, gcc 4.8.5 (C compiler) with the tools from cuda 7.5 are known to work well.

Procedure to follow:

  • Download the repository.
  • Go to the folder automatic_detection and compile the libraries using the Makefile by running the command line:

$ make

  • Go back to the main folder and start running the scripts from the folder scripts. You should either use ipython (which is my personal preference) or add your current working directory to your python path. The first code to run is 00_download_data.py (for example with the command line ipython ./scripts/00_download_data.py), which downloads the data, the moveout grid and the classifier from my dropbox.
  • Run 0_make_architecture.py, which creates different folders where the intermediate outputs will be stored.
  • You are now ready to start the detection workflow. Run 1_calculate_CNR.py, which calculates the composite network response and extract a bunch of candidate template events and store them to the output folder.
  • Run 2_extract_features.py, which calculates the features presented in Beauce et al. 2019 for all the events detected previously.
  • Run 3_classify_candidate_template_events.py, which uses our classifier to select only the good candidate template events for subsequent matched-filter searches.
  • Run 4_output_template_objects.py, which properly formates the database of template events.
  • Run 5_matched_filter_search.py, which detect new events by using the template events in a matched-filter search.
  • Run 6_automatic_relocation.py, which relocates the template events using the stack of all the newly detected events (more precisely, using the SVDWF). New templates will be stored in output/template_db_2/.

You can run scripts 5 and 6 iteratively if you change the paths written at the beginning of each script. template_db_1 and matched_filter_1 are for the first matched-filter search, and you can run a second matched-filter search by modifying those to template_db_2 and matched_filter_2. Between each matched-filter search, do not forget to run the script update_database_index.py.

Plotting functions are provided in 1_calculate_CNR.py, so that running:

$ ipython -i scripts/1_calculate_CNR.py

will allow you to enter a ipython terminal from where you can run the plotting functions to see what kind of events were detected.

This Github repository is still work-in-progress, and it should get easier to use in the future. If you have any question, don't hesitate to contact me at: ebeauce@mit.edu

Enjoy!

About

Codes used in the earthquake detection and location method presented in Beauce et al. 2019. A real data example is also provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 87.1%
  • Cuda 8.3%
  • C 4.3%
  • Makefile 0.3%