Skip to content

Commit

Permalink
docs: fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
Marius Isken committed Mar 7, 2024
1 parent 160f8a5 commit be42d95
Show file tree
Hide file tree
Showing 18 changed files with 157 additions and 174 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ jobs:
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install .[dev]
- run: pip install .[docs]
- run: mkdocs gh-deploy --force
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Lassie
# Qseek

*The friendly earthquake detector*

[![Build and test](https://github.com/miili/lassie-v2/actions/workflows/build.yaml/badge.svg)](https://github.com/miili/lassie-v2/actions/workflows/build.yaml)
[![Documentation](https://img.shields.io/badge/read-documentation-blue)](https://pyrocko.github.io/lassie-v2/)
[![Build and test](https://github.com/pyrocko/qseek/actions/workflows/build.yaml/badge.svg)](https://github.com/pyrocko/qseek/actions/workflows/build.yaml)
[![Documentation](https://img.shields.io/badge/read-documentation-blue)](https://pyrocko.github.io/qseek/)
![Python 3.10+](https://img.shields.io/badge/python-3.10%203.11-blue.svg)
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://pre-commit.com/)
<!-- [![PyPI](https://img.shields.io/pypi/v/lassie)](https://pypi.org/project/lassie/) -->

Lassie is an earthquake detection and localisation framework based on stacking and migration method. It combines neural network phase picks with an iterative octree localisation approach for accurate localisation of seismic events.
Qseek is an earthquake detection and localisation framework based on stacking and migration, a beamforming method. It combines neural network phase picks with an iterative octree localisation approach for accurate localisation of seismic events.

Key features are of the earthquake detection and localisation framework are:

Expand All @@ -25,32 +25,32 @@ Key features are of the earthquake detection and localisation framework are:
* Automatic extraction of modelled and picked travel times
* Calculation and application of station corrections / station delay times

Lassie is built on top of [Pyrocko](https://pyrocko.org).
Qseek is built on top of [Pyrocko](https://pyrocko.org).

For more information check out the documentation at https://pyrocko.github.io/lassie-v2/.
For more information check out the documentation at https://pyrocko.github.io/qseek/.

## Installation

Simple installation from GitHub.

```sh
pip install git+https://github.com/pyrocko/lassie-v2
pip install git+https://github.com/pyrocko/qseek
```

## Project Initialisation

Initialize a new project in a fresh directory.
Show the default config.

```sh
lassie init my-project/
qseek config
```

Edit the `my-project.json`

Start the earthquake detection with

```sh
lassie search search.json
qseek search search.json
```

## Packaging
Expand All @@ -62,7 +62,7 @@ The simplest and recommended way of installing from source:
Local development through pip.

```sh
cd lassie-v2
cd qseek
pip3 install .[dev]
```

Expand All @@ -74,12 +74,12 @@ pre-commit install

## Citation

Please cite lassie as:
Please cite Qseek as:

> TBD
> Marius Paul Isken, Peter Niemz, Jannes Münchmeyer, Sebastian Heimann, Simone Cesca, Torsten Dahm, Qseek: A data-driven Framework for Machine-Learning Earthquake Detection, Localization and Characterization, Seismica, 2024, *submitted*
## License

Contribution and merge requests by the community are welcome!

Lassie-v2 was written by Marius Paul Isken and is licensed under the GNU GENERAL PUBLIC LICENSE v3.
Qseek was written by Marius Paul Isken and is licensed under the GNU GENERAL PUBLIC LICENSE v3.
14 changes: 10 additions & 4 deletions docs/benchmark.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Computation Performance

Lassie is built for searching in large-N data sets. The implementation is leveraging Python [`asyncio`](https://docs.python.org/3/library/asyncio.html) heavily to implement threading and keeping the CPU busy. It is built on top of highly performant Pyrocko functions implemented in C language. The inference is using [PyTorch](https://pytorch.org/) which enables GPU computation of the seismic imaging functions.
Qseek is built for searching in large-N data sets. The implementation is leveraging Python [`asyncio`](https://docs.python.org/3/library/asyncio.html) heavily to implement threading and keeping the CPU busy. It is built on top of highly performant Pyrocko functions implemented in C language. The inference is using [PyTorch](https://pytorch.org/) which enables GPU computation of the seismic imaging functions.

This enables high throughput of seismic data in different scenarios.

Expand All @@ -22,15 +22,21 @@ A list of other projects using stacking and migration approach to back-project s

### Lassie-v1

Lassie - The friendly Earthquake detector in version 1. The re-writen version of Lassie utilizes the same heavy-duty functions for stacking and migration as Lassie v1.
Lassie - The friendly Earthquake detector in version 1. Qseek utilizes the same optimized heavy-duty functions for stacking and migration as Lassie v1.

[Lassie-v1 on Pyrocko Git](https://git.pyrocko.org/pyrocko/lassie)

### QuakeMigrate

QuakeMigrate uses a waveform migration and stacking algorithm to search for coherent seismic phase arrivals across a network of instruments. It produces—from raw data—catalogues of earthquakes with locations, origin times, phase arrival picks, and local magnitude estimates, as well as rigorous estimates of the associated uncertainties.

[QuakeMigrate on GitHub](https://git.pyrocko.org/pyrocko/lassie)
[QuakeMigrate on GitHub](https://github.com/QuakeMigrate/QuakeMigrate)

### BPMF

Complete framework for earthquake detection and location: Backprojection and matched-filtering (BPMF), with methods for automatic picking, relocation and efficient waveform stacking.

[BPMF on GitHub](https://github.com/ebeauce/Seismic_BPMF)

### Loki

Expand All @@ -40,6 +46,6 @@ LOKI (LOcation of seismic events through traveltime staKIng) is a code that perf

### MALMI

MALMI (MAchine Learning aided earthquake MIgration location).
MALMI (MAchine Learning aided earthquake MIgration location), variant of Loki for detecting and locating earthquakes using ML image functions provided by SeisBench.

[MALMI on GitHub](https://github.com/speedshi/MALMI)
73 changes: 30 additions & 43 deletions docs/components/configuration.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Lassie Configuration
# Qseek Configuration

At center is a JSON configuration file which is parsed by [Pydantic](https://docs.pydantic.dev/). The following pages will detail how to setup this JSON file for the search.

Expand All @@ -12,17 +12,17 @@ The search configuration. **This is the entrypoint for the EQ detection and loca
More information on the submodules (e.g. Octree, Data Provider and other) can be found on subpages in the navigation.

```python exec='on'
from lassie.utils import generate_docs
from lassie.search import Search
from qseek.utils import generate_docs
from qseek.search import Search

print(generate_docs(Search()))
```

## Minimal Config

This is a minimal config which can used to start a Lassie search.
This is a minimal config which can used to start a Qseek search.

```json title="Minimal Lassie Config"
```json title="Minimal Qseek Config"
{
"project_dir": ".",
"stations": {
Expand Down Expand Up @@ -94,44 +94,31 @@ This is a minimal config which can used to start a Lassie search.
Structure of the search and optimisation of the octree, which is focusing in on seismic energy.

```mermaid
flowchart TD
subgraph Data Input
waveforms(["Seismic Waveforms"])
image["
Phase Image Function
PhaseNet, EQTransformer, ...
"]
end
subgraph Migration
quadtree["Quadtree"]
travelTimes["
Seismic Travel Time Model
1D Raytracer, ...
"]
end
subgraph Detection
search["Stacking Image Functions"]
detection["EQ Event Detection & Localisation"]
end
featureExtraction["
Feature Extraction
Local Magnitude, Ground Motion, ...
"]
stationCorrections["
Traveltime residuals from Image
→ Station Corrections
"]
waveforms --> image
image --> search
quadtree --> travelTimes
travelTimes -->search
detection -- Refine Quadtree --> search
search --> detection
detection --> featureExtraction
detection --> stationCorrections
%%{init: {'theme': 'neutral', 'themeVariables': { 'fontSize': '14pt'}}}%%
flowchart LR
subgraph Seismic Data
waveforms(["fa:fa-water Seismic\nWaveforms"])
image{{"fa:fa-bolt Waveform Image Function\nPhaseNet / EQTransformer / ..."}}
waveforms --> image
end
subgraph Travel Time Model
travelTimes(["fa:fa-layer-group Seismic\nTravel Time Model"])
stationCorrections{{"fab:fa-arrows-to-dot Station Corrections\nSST / SSST"}}
travelTimes -->|add| stationCorrections
end
subgraph Stacking and Migration
octree["fa:fa-cubes\nOctree Grid"]
detection["fa:fa-bullseye Detection\nand Localisation"]
end
featureExtraction("fa:fa-info Extract Event Features\nMagnitudes, Ground Motion, ...")
correctionExtraction("fa:fa-stopwatch Extract\nStation Corrections")
image --> octree
stationCorrections --> octree
detection -.->|"fa:fa-cube\nRefine"| octree
octree --> detection
detection --> featureExtraction & correctionExtraction
```

*Building blocks of the specific stacking and migration method for earthquake detection, localisation and characterisation.*
11 changes: 8 additions & 3 deletions docs/components/general.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ Paths can be relative to the location of the config file or absolute. **File pat

## Date and Time

Serialisation of time, dates and date times and durations follow [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format with timezone information. E.g. `2023-10-28T01:21:21.003+00:00`.
Serialisation of time, dates and date times and durations follow [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format with timezone information. E.g. `2023-10-28T01:21:21.003Z`.

Duration are serialized like `PT600S`, this example shows a duration of 600 seconds, 10 minutes.


!!!+ note Timezone Info
All datetimes are timezone aware! For UTC this is the `Z` or `+00:00` suffix.
Also other offsets can be defined according to [ISO8601](https://en.wikipedia.org/wiki/ISO_8601).

```json title="Example of datetimes and durations"
{
"start_time": "2023-10-28T01:21:21.003+00:00",
Expand All @@ -25,8 +30,8 @@ Geographic locations have a geographic reference and a relative shift in meters.
All **distances, depths and elevations are given in meters**.

```python exec='on'
from lassie.utils import generate_docs
from lassie.models.location import Location
from qseek.utils import generate_docs
from qseek.models.location import Location

print(generate_docs(Location(lat= 52.3825, lon=13.0644)))
```
6 changes: 3 additions & 3 deletions docs/components/image_function.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Image Function

For image functions this version of Lassie relies heavily on machine learning pickers delivered by [SeisBench](https://github.com/seisbench/seisbench).
For image functions this version of Qseek relies heavily on machine learning pickers delivered by [SeisBench](https://github.com/seisbench/seisbench).

## PhaseNet Image Function

!!! abstract "Citation PhaseNet"
*Zhu, Weiqiang, and Gregory C. Beroza. "PhaseNet: A Deep-Neural-Network-Based Seismic Arrival Time Picking Method." arXiv preprint arXiv:1803.03211 (2018).*

```python exec='on'
from lassie.utils import generate_docs
from lassie.images.phase_net import PhaseNet
from qseek.utils import generate_docs
from qseek.images.phase_net import PhaseNet

print(generate_docs(PhaseNet()))
```
6 changes: 3 additions & 3 deletions docs/components/octree.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Octree

A 3D space is searched for sources of seismic energy. Lassie created an octree structure which is iteratively refined when energy is detected, to focus on the source' location. This speeds up the search and improves the resolution of the localisations.
A 3D space is searched for sources of seismic energy. Qseek created an octree structure which is iteratively refined when energy is detected, to focus on the source' location. This speeds up the search and improves the resolution of the localisations.

![Octree Concept](../images/octree-concept.webp)

*Surface projection of the refined octree focusing on the seismic source region. In this example four levels of refinement are can be seen, refining the 3D octree from the initial 4000 nodes to 8823 nodes.*

```python exec='on'
from lassie.utils import generate_docs
from lassie.octree import Octree
from qseek.utils import generate_docs
from qseek.octree import Octree

print(generate_docs(Octree()))
```
14 changes: 7 additions & 7 deletions docs/components/ray_tracer.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ray Tracers

The calculation of seismic travel times is a cornerstone for the migration and stacking approach. Lassie supports different ray tracers for travel time calculation, which can be adapted for different geological settings.
The calculation of seismic travel times is a cornerstone for the migration and stacking approach. Qseek supports different ray tracers for travel time calculation, which can be adapted for different geological settings.

## Constant Velocity

Expand All @@ -13,8 +13,8 @@ $$
This module is used for simple use cases and cross-referencing testing.

```python exec='on'
from lassie.utils import generate_docs
from lassie.tracers.constant_velocity import ConstantVelocityTracer
from qseek.utils import generate_docs
from qseek.tracers.constant_velocity import ConstantVelocityTracer

print(generate_docs(ConstantVelocityTracer()))
```
Expand All @@ -27,8 +27,8 @@ Calculation of travel times in 1D layered media is based on the [Pyrocko Cake](h
*Pyrocko Cake 1D ray tracer for travel time calculation in 1D layered media*

```python exec='on'
from lassie.utils import generate_docs
from lassie.tracers.cake import CakeTracer
from qseek.utils import generate_docs
from qseek.tracers.cake import CakeTracer

print(generate_docs(CakeTracer(), exclude={'earthmodel': {'raw_file_data'}}))
```
Expand All @@ -45,8 +45,8 @@ We implement the fast marching method for calculating first arrivals of waves in
*Conceptual 2D visualisation for seismic traveltimes calculation in heterogenous media using the fast-marching method for the Eikonal solution is presented. Traveltimes from the receiving station at the surface (indicated by a yellow triangle) towards the subsurface grid are calculated, resulting in station-specifig traveltimes for all potential source locations simultaneously.*

```python exec='on'
from lassie.utils import generate_docs
from lassie.insights.tracers.fast_marching import FastMarchingTracer
from qseek.utils import generate_docs
from qseek.insights.tracers.fast_marching import FastMarchingTracer

print(generate_docs(FastMarchingTracer()))
```
Expand Down
10 changes: 5 additions & 5 deletions docs/components/seismic_data.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

## Waveform Data

The seismic can be delivered in MiniSeed or any other format compatible with Pyrocko. Lassie utilizes the Pyrocko Squirrel for fast and asynchronous data access.
The seismic can be delivered in MiniSeed or any other format compatible with Pyrocko. Qseek utilizes the Pyrocko Squirrel for fast and asynchronous data access.

To prepare your data for EQ detection and localisation, **organize it in a MiniSeed file or an [SDS structure](https://www.seiscomp.de/doc/base/concepts/waveformarchives.html)**.

```python exec='on'
from lassie.utils import generate_docs
from lassie.waveforms import PyrockoSquirrel
from qseek.utils import generate_docs
from qseek.waveforms.squirrel import PyrockoSquirrel

print(generate_docs(PyrockoSquirrel()))
```
Expand All @@ -25,8 +25,8 @@ Supported data formats are:
Metadata does not need to include response information for pure detection and localisation. If local magnitudes M~L~ are extracted, response information is required.

```python exec='on'
from lassie.utils import generate_docs
from lassie.models.station import Stations
from qseek.utils import generate_docs
from qseek.models.station import Stations

print(generate_docs(Stations()))
```
12 changes: 10 additions & 2 deletions docs/components/station_corrections.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@
Station corrections can be extract from previous runs to refine the localisation accuracy. The corrections can also help to improve the semblance find more events in a dataset.

```python exec='on'
from lassie.utils import generate_docs
from lassie.station_corrections import StationCorrections
from qseek.utils import generate_docs
from qseek.insights import StationCorrections

print(generate_docs(StationCorrections()))
```


```python exec='on'
from qseek.utils import generate_docs
from qseek.insights import SourceSpecificStationCorrections

print(generate_docs(SourceSpecificStationCorrections()))
```
Loading

0 comments on commit be42d95

Please sign in to comment.