EQTransformer is an AI-based earthquake signal detector and phase (P&S) picker based on a deep neural network with an attention mechanism. It has a hierarchical architecture specifically designed for earthquake signals. EQTransformer has been trained on global seismic data and can perform detection and arrival time picking simultaneously. In addition to the prediction probabilities, it also provides estimated model uncertainties.
The EQTransformer python 3 package includes modules for downloading continuous seismic data, preprocessing, performing earthquake signal detection, and phase (P & S) picking using pre-trained models, building and testing new models, and performing a simple phase association.
- Authors: S. Mostafa Mousavi
- Documentation: https://rebrand.ly/EQT-documentations
- PyPI: https://pypi.org/project/EQTransformer/
- Anaconda: https://anaconda.org/smousavi05/eqtransformer
To cite EQTransformer, use the following reference To cite EQTransformer, use the following reference:
- Mousavi, S.M., Ellsworth, W.L., Zhu, W., Chuang, L.Y., Beroza, G.C., "Earthquake Transformer: An Attentive Deep-learning Model for Simultaneous Earthquake Detection and Phase Picking ". Nature Communications, (2020).
EQTransformer supports a variety of platforms, including Microsoft Windows, macOS, and Linux operating systems. Note that you will need to have Python 3.x (3.6 or 3.7) installed. The EQTransformer Python package can be installed using the following options:
conda create -n eqt python=3.7
Conda activate eqt
conda install -c smousavi05 eqtransformer
If you already have Obspy
installed on your machine, you can get EQTransformer through PyPI:
pip install EQTransformer
The sources for EQTransformer can be downloaded from the Github repo
.
You can either clone the public repository:
git clone git://github.com/smousavi05/EQTransformer
Once you have a copy of the source, you can cd to EQTransformer directory and install it with:
python setup.py install
If you have installed EQTransformer Python package before and want to upgrade to the latest version, you can use the following command:
pip install EQTransformer -U
See either:
https://rebrand.ly/EQT-documentations
or
https://rebrand.ly/EQT-examples
Note: to run the notebook exampels, you may need to reinstall the jupyter on the same environment that EQTransformer has been installed.
from EQTransformer.core.mseed_predictor import mseed_predictor
mseed_predictor(input_dir='downloads_mseeds',
input_model='ModelsAndSampleData/EqT_model.h5',
stations_json='station_list.json',
output_dir='detection_results',
detection_threshold=0.2,
P_threshold=0.1,
S_threshold=0.1,
number_of_plots=10,
plot_mode='time_frequency',
batch_size=500,
overlap=0.3)
If you would like to contribute to the project as a developer, follow these instructions to get started:
- Fork the EQTransformer project (https://github.com/smousavi05/EQTransformer)
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
The EQTransformer package is distributed under the MIT license
, a permissive open-source (free software) license.
Report bugs at https://github.com/smousavi05/EQTransformer/issues.
If you are reporting a bug, please include:
- Your operating system name and version.
- Any details about your local setup that might be helpful in troubleshooting.
- Detailed steps to reproduce the bug.