Coder Social home page Coder Social logo

maihao14 / quakelabeler Goto Github PK

View Code? Open in Web Editor NEW
20.0 2.0 4.0 7.96 MB

QuakeLabeler is a Python package to create and manage your seismic training data, processes, and visualization in a single place — so you can focus on building the next big thing.

License: MIT License

Python 92.30% Jupyter Notebook 7.70%
earthquake-datasets python seismology deep-learning labeler seismic-signal phase-picking

quakelabeler's Introduction

QuakeLabeler

Quake Labeler was born from the need for seismologists and developers who are not AI specialists to easily, quickly, and independently build and visualize their training data set.

Introduction

QuakeLabeler is a Python package to customize, build and manage your seismic training data, processes, and visualization in a single place — so you can focus on building the next big thing. Current functionalities include retrieving waveforms from data centers, customizing seismic samples, auto-building datasets, preprocessing and augmenting for labels, and visualizing data distribution. The code helps all levels of AI developers and seismology researchers for querying and building their own earthquake datasets and can be used through an interactive command-line interface with little knowledge of Python.

Installation, Usage, documentation and scripts are described at https://maihao14.github.io/QuakeLabeler/

If your data is on local end, please switch to localmode.

Author: Hao Mai(Developer and Maintainer) & Pascal Audet (Developer and Maintainer)

Installation

Conda environment

We recommend creating a custom conda environment where QuakeLabeler can be installed along with its dependencies.

  • Create a environment called ql and install pygmt:
conda create -n ql gmt python=3.8
  • Activate the newly created environment:
conda activate ql

Installing from source

Download or clone the repository:

git clone https://github.com/maihao14/QuakeLabeler.git
cd QuakeLabeler
pip install -e .

Running the scripts

Create a work folder where you will run the scripts that accompany QuakeLabeler. For example:

mkdir ./WorkFolder
cd WorkFolder

Run QuakeLabeler. Input QuakeLabeler to macOS terminal or Windows consoles:

QuakeLabeler

Or input quakelabeler also works:

quakelabeler

A QuakeLabeler welcome interface will be loading:

(ql) hao@HaodeMacBook-Pro QuakeLabeler % QuakeLabeler
Welcome to QuakeLabeler----Fast AI Earthquake Dataset Deployment Tool!
QuakeLabeler provides multiple modes for different levels of Seismic AI researchers

[Beginner] mode -- well prepared case studies;
[Advanced] mode -- produce earthquake samples based on Customized parameters.

Example to build a dataset in STEAD format

Here's a brief introduction of how to convert USGS dataset into STEAD format. https://github.com/maihao14/QuakeLabeler/blob/main/quakelabeler/examples/GenerateSTEADformat.ipynb

Reference

Mai, H., & Audet, P. (2022). QuakeLabeler: A Fast Seismic Data Set Creation and Annotation Toolbox for AI Applications. Seismological Society of America, 93(2A), 997-1010. https://doi.org/10.1785/0220210290

BibTeX:

@article{mai2022quakelabeler,
  title={QuakeLabeler: A Fast Seismic Data Set Creation and Annotation Toolbox for AI Applications},
  author={Mai, Hao and Audet, Pascal},
  journal={Seismological Society of America},
  volume={93},
  number={2A},
  pages={997--1010},
  year={2022}
}

Contributing

In current version, raw waveforms data from part of Chinese Earthquake stations are unavailable to access automatically (But you can still use QuakeLabeler in China). Any collaborators are welcome to help extend the data sources, develop the codes, etc.

All constructive contributions are welcome, e.g. bug reports, discussions or suggestions for new features. You can either open an issue on GitHub or make a pull request with your proposed changes. Before making a pull request, check if there is a corresponding issue opened and reference it in the pull request. If there isn't one, it is recommended to open one with your rationale for the change. New functionality or significant changes to the code that alter its behavior should come with corresponding tests and documentation. If you are new to contributing, you can open a work-in-progress pull request and have it iteratively reviewed. Suggestions for improvements (speed, accuracy, etc.) are also welcome.

quakelabeler's People

Contributors

maihao14 avatar paudetseis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

quakelabeler's Issues

QuakeLabeler ModuleNotFoundError

I followed the installation instructions to install the fascinating QuakeLabeler package
But I encountered an error as follows
Traceback (most recent call last): File "/home/panxiong/anaconda3/envs/ql/bin/QuakeLabeler", line 5, in <module> from quakelabeler.scripts.QuakeLabeler import main ModuleNotFoundError: No module named 'quakelabeler.scripts'
Please give me a solution, thanks.

the problem of QuakeLabeler used in the Ubuntu

After I create the python environment needed by QuakeLabeler and install it in my Ubuntu computer, there was the problem, "AttributeError: 'numpy.int64' object has no attribute 'split'" when I execute QuakeLabeler (quakelabeler) in the terminal.

“”“
Traceback (most recent call last):
File "/home/xxx/anaconda3/envs/slc/bin/QuakeLabeler", line 33, in
sys.exit(load_entry_point('QuakeLabeler', 'console_scripts', 'QuakeLabeler')())
File "/home/xxx/anaconda3/envs/slc/bin/QuakeLabeler", line 25, in importlib_load_entry_point
return next(matches).load()
File "/home/xxx/anaconda3/envs/slc/lib/python3.8/importlib/metadata.py", line 77, in load
module = import_module(match.group('module'))
File "/home/xxx/anaconda3/envs/slc/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 961, in _find_and_load_unlocked
File "", line 219, in _call_with_frames_removed
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 961, in _find_and_load_unlocked
File "", line 219, in _call_with_frames_removed
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 843, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/xxx/EQ_Detection/QuakeLabeler/quakelabeler/init.py", line 5, in
from .classes import QuakeLabeler, Interactive, CustomSamples, QueryArrival, BuiltInCatalog, MergeMetadata, GlobalMaps
File "/home/xxx/EQ_Detection/QuakeLabeler/quakelabeler/classes.py", line 35, in
from obspy.core.utcdatetime import UTCDateTime
File "/home/xxx/.local/lib/python3.8/site-packages/obspy/init.py", line 39, in
from obspy.core.utcdatetime import UTCDateTime # NOQA
File "/home/xxx/.local/lib/python3.8/site-packages/obspy/core/init.py", line 124, in
from obspy.core.utcdatetime import UTCDateTime # NOQA
File "/home/xxx/.local/lib/python3.8/site-packages/obspy/core/utcdatetime.py", line 27, in
from obspy.core.util.deprecation_helpers import ObsPyDeprecationWarning
File "/home/xxx/.local/lib/python3.8/site-packages/obspy/core/util/init.py", line 27, in
from obspy.core.util.base import (ALL_MODULES, DEFAULT_MODULES,
File "/home/xxx/.local/lib/python3.8/site-packages/obspy/core/util/base.py", line 36, in
from obspy.core.util.misc import to_int_or_zero, buffered_load_entry_point
File "/home/xxx/.local/lib/python3.8/site-packages/obspy/core/util/misc.py", line 214, in
loadtxt(np.array([0]), ndmin=1)
File "/home/xxx/anaconda3/envs/slc/lib/python3.8/site-packages/numpy/lib/npyio.py", line 1086, in loadtxt
ncols = len(usecols or split_line(first_line))
File "/home/xxx/anaconda3/envs/slc/lib/python3.8/site-packages/numpy/lib/npyio.py", line 977, in split_line
line = line.split(comment, 1)[0]
AttributeError: 'numpy.int64' object has no attribute 'split'
"”"

Error loading GMT shared library

Hello,

I was trying to use the QuakeLabeler package on some data and when I tried to run it I got the following error:

pygmt.exceptions.GMTCLibNotFoundError: Error loading GMT shared library at 'libgmt.so'.
libgmt.so: cannot open shared object file: No such file or directory

I saw that there were some responses to a similar question in the past, but they all involved using conda, which I don't use at it interferes with other libraries I use.

So far I tried using:

pip install pygmt

as well as GMT:

sudo apt-get install gmt gmt-dcw gmt-gshhg
sudo apt-get install ghostscript
Unfortunately, it did not work.

Any suggestions would be appreciated

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.