Skip to main content

Simplified machine-learning driven earthquake detection, location, and analysis

Project description

easyQuake

Simplified machine-learning driven earthquake detection, location, and analysis in one easy-to-implement python package.

On most systems you should be able to simply:

pip install easyQuake

Or if you need to tweak something, like the number of GPUs in gpd_predict, you could:

git clone https://github.com/jakewalter/easyQuake.git
cd easyQuake
pip install .

If you find this useful, please cite:

Walter et al. (in review), easyQuake: Putting machine learning to work for your regional seismic network or local earthquake study

Requirements

This code leverages machine-learning for earthquake detection. You should have suitable hardware to run CUDA/Tensorflow, which usually means some sort of GPU. This has been tested on servers with nvidia compute cards and modest multi-core desktop with consumer gaming nvidia card (e.g. Geforce 1050 Ti). The event-mode can be run efficiently enough on a laptop.

  • Requires nvidia-cuda-toolkit, obspy, keras==2.3.1, tensorflow-gpu==2.1 (if using multiple GPUs only tensorflow 1.15 is tested), basemap
  • I've found that the the easiest way to install cuda, tensorflow, and keras is through installing Anaconda python and running conda install tensorflow-gpu==2.1

Running easyQuake

The example runs easyQuake for a recent M6.5 earthquake in Idaho

from easyQuake import download_mseed
from easyQuake import daterange
from datetime import date
from easyQuake import combine_associated
from easyQuake import detection_continuous
from easyQuake import association_continuous

from easyQuake import magnitude_quakeml
from easyQuake import simple_cat_df

import matplotlib.pyplot as plt
maxkm = 300
maxdist=300
lat_a = 42
lat_b = 47.5
lon_a = -118
lon_b = -111


start_date = date(2020, 3, 31)
end_date = date(2020, 4, 1)

project_code = 'idaho'
project_folder = '/data/id'
for single_date in daterange(start_date, end_date):
    print(single_date.strftime("%Y-%m-%d"))
    dirname = single_date.strftime("%Y%m%d")
    download_mseed(dirname=dirname, project_folder=project_folder, single_date=single_date, minlat=lat_a, maxlat=lat_b, minlon=lon_a, maxlon=lon_b)
    detection_continuous(dirname=dirname, project_folder=project_folder, project_code=project_code, single_date=single_date, machine=True,local=True)
    association_continuous(dirname=dirname, project_folder=project_folder, project_code=project_code, maxdist=maxdist, maxkm=maxkm, single_date=single_date, local=True)

cat, dfs = combine_associated(project_folder=project_folder, project_code=project_code)
cat = magnitude_quakeml(cat=cat, project_folder=project_folder,plot_event=True)
cat.write('catalog_idaho.xml',format='QUAKEML')


catdf = simple_cat_df(cat)
plt.figure()
plt.plot(catdf.index,catdf.magnitude,'.')

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

easyQuake-0.2.3.tar.gz (19.4 MB view details)

Uploaded Source

Built Distribution

easyQuake-0.2.3-py3-none-any.whl (19.4 MB view details)

Uploaded Python 3

File details

Details for the file easyQuake-0.2.3.tar.gz.

File metadata

  • Download URL: easyQuake-0.2.3.tar.gz
  • Upload date:
  • Size: 19.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for easyQuake-0.2.3.tar.gz
Algorithm Hash digest
SHA256 162ebbf04c73f479eb7fa48e3e1d21ca821dfd6fe7c80f09a5c11b545a07f04f
MD5 a5e9d66b6058c92ca6df7cb7d0d2a364
BLAKE2b-256 68f37943a12bb2261f766461c2cf59f00fad73471825af48c2c51fe4b9617c76

See more details on using hashes here.

File details

Details for the file easyQuake-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: easyQuake-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 19.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for easyQuake-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 195c630bf30ee594d5c1eb2e023bf0968e97c3d007d7692c21f81e26794f5e72
MD5 f31369f3f7dbb92a2ac4523a58693d1b
BLAKE2b-256 5ce23f6195ff4bfc027076d39302198688ad8de7a99ddc3f2ed757339f22ef55

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page