dlpick

Phase detection and picking on waveforms.

Description

DLPick is a highly configurable SeisComP StreamApplication client that reads waveforms from recordstream and outputs picks, processed by Deep Learning (DL) models, that were created and trained using the SeisBench framework.

Installation

Install DLPick using gsm:

$ gsm install dlpick

This installs three packages:

  • dlpick - this application

  • dlbase - dependency package for deep learning applications

  • dlmodels-pick - DL models, installed to /home/data/dlmodels, by default

  • dlbase-extend - CUDA dependencies, can be omitted if already present on your system

  • dltools - collection of tools, e.g., to find the best configuration for dlpick adjusted to your data

Further dependencies: Go to your $SEISCOMP_ROOT/share/deps, descend into the subpath that matches your distribution and execute the shell script.

For example, if you are working on a Debian 13 system and you’ve installed SeisComP at /home/sysop/seiscomp:

$ seiscomp install-deps dlpick
- or -
$ sh /home/sysop/seiscomp/share/deps/debian/13/

Workflow

../_images/dlpick-arch.png

Figure 1: simplified architecture of DLPick

General information

Like any other SeisComP StreamApplication client, DLPick can read from any RecordStream, attach to a database and messaging. This also means, DLPick can operate in both real-time and non-real-time mode. There is a module configuration for DLPick and you can also override most of the parameters using DLPick binding profiles for your stations.

DLPick creates P and S picks depending on the DL model used. It also calculates the SNR and provides it as amplitude. These parameters can be sent to the messaging or used in offline playbacks in your pipeline, e.g., as input for further processing by scautoloc or scanloc.

DL models were trained on big datasets and usually work best on data that is similar to their training data. They generate confidence curves that are the lower the more unfamiliar the data is. Keep that in mind when setting up which model to use, which confidence thresholds, overlapping ratio and upstream filters. DL models don’t necessarily work “out-of-the-box” but might need a fair amount of configurational tuning like conventional pickers.

One major difference to, e.g., the STA/LTA-AIC picker chain in scautopick is that, in general, DL models need three components. Therefore DLPick will try to find a three-component based orthogonal system. Since this might not always be available, DLPick allows also to work around these restrictions.

DL models use fixed time windows as input. The input data is cut into time windows of the model’s needed length. To improve prediction quality, DLPick allows these models to overlap by a ratio of your flavour.

Configuration

There are three levels of configuration. The most specific one is a binding profile attached to a set of stations. And this is also the recommended way of configuring DLPick.

The module configuration serves as fallback for missing values in bindings or for stations without DLPick bindings. Some parameters, like general behavior should be configured here (for example, if models should be moved to the GPU), while rather data-specific parameters as model and thresholds should be configured in the bindings.

Commandline arguments surpass all other configurations. This also means that stations without DLPick but with global bindings (valid detecStream and detecLocid parameters) will be processed just by telling DLPick which model to use.

Real-time mode

Make sure to have the necessary seiscomp modules running. For example, if you provide waveforms via seedlink:

$ seiscomp start scmaster seedlink

You can run DLPick as any other seiscomp module in scconfig or on the commandline:

$ seiscomp start dlpick
  • or - to for debugging purposes:

$ dlpick --debug

Without any arguments (or with –debug flag only), DLPick will use the local configuration, connect to the local database and messaging.

If you already have global bindings attached to your streams providing detecStream and detecLocid, DLPick might use its default settings to process streams and send resulting picks to the messaging. However, since there is no default model, DLPick doesn’t know what to do and will ignore these stations unless you define it in the module configuration or on the commandline, as shown in the next section.

The DL model

In the module config and on the commandline, you can define a default DL model that is run on all stations even if they don’t have a DLPick binding. Note that this might not be what you want on a production system when you wish to restrict DL picks to a certain set of stations. For an offline playback, on the other hand, this configuration is very convenient.

As an example DL model you can use PhaseNet with its original weights. This model needs 30s input of raw three-component data with sample rate of 100 Hz. The app takes care of resampling and all pre-processing steps that are specific to the model.

Other models can be used, currently only EQTransformer and PhaseNet architectures are supported. The more flexible variant of PhaseNet, VariableLengthPhaseNet, is supported as well, although there are not many weights for it. Show a list of available models, that shipped with your installation of dlmodels-pick:

$ dlpick  --print-models

Use the Identifier as name to define which model to load.

Hint

For details on models and the data that they were trained on, take a look into the SeisBench docs. There you will find most of the datasets that were printed with –print-models in the Datasets column.

As a practical advise, you should try out different models. For local seismicity, “instance” weights are a good choice.

$ dlpick --model-weights eqtransformer-instance

Hint

Note that the model and the weights should be written in lower-case. It’s possible to use abbreviations for the weights, as well. You could also type --model-weights eq-in. These abbreviations are stored in the file dlmodels_maps.json, located at your dlmodels installation directory. The command “dlpick –print-models” also shows the short version in the column “Identifier”, which is much more convenient for complex model names.

In contrast to PhaseNet, the EQTransformer architecture needs 60s of input data.

In the configuration, use the parameter modelWeights to set or change the model applied to all stations without DLPick bindings specifying the model. For production use, prefer the same-named binding parameter!

Note

In deep learning, “model” has two meanings: the architecture of the neural network, that is its computation graph, and the weights learned in training. Both matter. The same architecture trained on different data can behave so differently that it is common to speak of different models, even though only the weights differ.

The parameter name (--model-weights on the command line, modelWeights in the configuration) therefore names both: its value selects an architecture together with a set of trained weights, for example eq-vp.

Output

Without any further configuration, DLPick will send picks to the messaging. But there are more ways to publish picks:

  1. Write to SCML files: output.xml

Picks (and amplitudes if enabled) are gathered as event parameters. When the number of picks exceeds a certain threshold a file is created. Succeeding files are enumerated. When finishing the app, all created files are merged into one. The path to this will be printed on the commandline.

  1. Write to CSV files: output.csv

Pick information condensed into simplest CSV format. Flushed to files and merged following the same principles as above.

  1. Print to terminal: output.stdout

Picks are printed on the commandline

All of these options can be combined and work well together with the messaging. If you don’t want to publish picks to the messaging, turn on output.offline. On the other hand, it is not necessary to explicitly activate the messaging, but you can define a specific server connection with the global parameter connection.server or on the commandline:

$ dlpick -H localhost
  1. Write SCML to stdout: output.ep

This option is the best used for offline playbacks. It turns off the messaging and forbids the simultaneous usage of output.stdout. Picks are output as event parameters in SCML format in the terminal on stdout. The output can then be redirected to a file.

Parameters output.ep, output.xml , output.csv and output.stdout can also be overridden with the same-named commandline arguments.

Example: offline playback

As mentioned, DLPick can process miniSEED files and work in offline playback mode completely:

$ dlpick -I waveforms.mseed --inventory-db inventory.xml --config-db config.xml --config-file dlpick.cfg \
    --ep > picks.xml

This command disconnects from the database as well as from the messaging. It uses file-based configurations. DLPick outputs event parameters in SCML format to the terminal (output.ep). The output will be redirected to a file called “picks.xml”.

Confidence thresholds

For each data sample, the DL model outputs one score for P and one for S. These scores can be read as the model’s confidence that the sample is a P or an S onset. Thresholds on these scores control how many picks are declared. Higher thresholds give fewer but more reliable picks. Lower thresholds give more picks but also more false detections.

The application’s default thresholds are low (0.1). For some models this is too permissive and results in many false picks. However, almost all models come with recommended thresholds. These replace the application defaults whenever the corresponding threshold parameters are set to -1.

Good values depend on the model and on your data, so try a few yourself to get a feeling for them, e.g.:

$ dlpick --p-threshold 0.3 --s-threshold 0.3

The P and S thresholds can be set in the module configuration as well as bindings:

Suitable thresholds depend on the chosen model. It is therefore strongly recommended to set them with the binding parameters of the same name instead, so they stay consistent with the model configured there.

Overlapping windows and pick reduction

It is advisable to process waveforms in overlapping time windows. This gives the model several chances to detect phase onsets that would otherwise fall close to a window border, where predictions tend to be less reliable. The downside is that the same onset is usually picked several times. DLPick therefore applies a reduction algorithm that groups closely spaced picks into clusters and keeps only the most confident pick of each cluster.

The overlap is given as a ratio of the window length. For example, with a window of 10 samples and an overlap ratio of 0.9, each window is shifted by one sample:

|0,1,2,3,4,5,6,7,8,9|
  |1,2,3,4,5,6,7,8,9,10|
    |2,3,4,5,6,7,8,9,10,11|
      |3,4,5,6,7,8,9,10,11,12|
      ...

On the command line, the overlap ratio is set like this:

$ dlpick --ol-ratio 0.9

In the module configuration and in the bindings, the corresponding parameter is input.traceWindowOlRatio.

Keep in mind that high overlap ratios are expensive: the number of model inferences grows with 1 / (1 - ratio), i.e. a ratio of 0.9 requires ten times as many inferences as no overlap. On older systems or with many stations, this can cause noticeable picking delays. In such cases, a moderate ratio such as 0.5 is a good compromise.

By default, the reduction is applied to P and S picks separately, so a P pick never suppresses an S pick and vice versa.

Each cluster spans less than picks.reduction.cluster.clusterSize seconds (default: 1 s), and the published picks are at least the cluster size apart. The parameter is currently only available as a binding parameter.

Unless picks.reduction.cluster.safeMinPickCount is set, a cluster is only reduced once no further overlapping window can add picks to it. This delays the output of each pick until all windows covering its onset have been processed. To publish picks earlier, set picks.reduction.cluster.safeMinPickCount: a cluster is then reduced as soon as it contains at least this number of picks. Picks closer than the cluster size to a published pick are discarded afterwards, even if they are more confident. Since each onset can be picked at most once per window, the value should be clearly smaller than the number of windows covering each sample, which is about 1 / (1 - ratio), e.g. 10 for a ratio of 0.9. Otherwise, the threshold is rarely reached and picks are released as late as without this parameter. Like the cluster size, this parameter is currently only available as a binding parameter.

Performance tuning

Most of dlpick’s processing time goes into running the deep learning models. How fast that is depends on four things: where the models run (CPU or GPU), how many windows are computed together (batch size), how many CPU threads libtorch uses, and, in real-time operation, how long dlpick waits for a batch to fill. This section summarizes the measurements made while tuning dlpick and the recommendations derived from them.

Note

All numbers come from one test machine and one dataset. The best settings depend on the hardware, in particular on the CPU caches and the number of physical cores. Use the numbers as a starting point and check them on your own system, see Measuring performance.

Test setup
  • Data: five earthquakes in California, about 300 streams, processed offline with seven pickers (one per configuration and model): 23,190 windows of 6,000 samples and 981 picks.

  • CPU: Intel hybrid CPU with 6 performance cores (12 logical CPUs, up to 4.8 GHz) and 8 efficiency cores (up to 3.7 GHz). For the measurements, the threads were pinned with taskset to one logical CPU per performance core.

  • GPU: NVIDIA GPU, libtorch 2.11 built for CUDA 12.6.

  • Runtimes are wall-clock times of single runs. Run-to-run variation is about ±3 s.

Batch size on the CPU

dlpick collects the windows of all streams of a picker and computes them together in one call of the model. On one thread, a batch size of 32 is the fastest:

Batch size

Runtime (1 thread)

vs. batch size 1

1

215 s

—

8

190 s

−12 %

16

193 s

−10 %

32

175 s

−19 %

64

183 s

−15 %

128

186 s

−13 %

256

186 s

−13 %

  • Small batches: below 32, the fixed cost of each model call dominates.

  • Large batches: above 32, the intermediate results no longer fit into the CPU cache. Batch size 128 executes the same number of instructions as batch size 32 but needs 5 % more CPU cycles.

  • Memory: each window in a batch adds 2–3 MB of intermediate results. Compared with batch size 1, batch size 32 needs about 0.1 GB more memory, batch size 256 about 0.7 GB more.

  • More threads: larger batches can be split better across threads. With four threads, the optimum moves from 32 to 64, see below.

Threads on the CPU

Threads

Batch size

Runtime

Speed-up vs. 1 thread

1

32

172 s

1.00

2

32

126 s

1.36

2

64

125 s

1.38

4

32

107 s

1.60

4

64

96 s

1.79

4

128

99 s

1.73

6

32

131 s

1.32

  • Serial part: about 72 s of the runtime at batch size 32 do not run in parallel. Threads alone cannot bring the runtime on this dataset below about 75 s.

  • All cores busy: six threads on six performance cores were slower than four. With all cores busy, the clock frequency drops and no core is left for the operating system; a briefly interrupted thread stalls the others.

  • Shared servers: two threads already save 27 % and leave cores for other modules.

GPU

On the GPU, dlpick needs 63–65 s for the dataset at batch size 16 and one thread. That is 2.7 times as fast as the CPU with one thread and 1.5 times as fast as the CPU with four threads.

Batch size

Runtime (1 thread)

GPU memory

GPU busy

1

103 s

171 MiB

33 %

8

67–69 s

251 MiB

18 %

16

63–65 s

253 MiB

—

32

67 s

1.8 GiB

18 %

64

67 s

3.4 GiB

16 %

128

66 s

2.0 GiB

14 %

256

66 s

2.2 GiB

12 %

  • Batch size: from batch size 8 up, the runtime hardly changes. Batch size 1 is about 60 % slower than batch size 16 because of the many small model calls.

  • The CPU sets the pace: the GPU computes only 12–18 % of the time (“GPU busy” is the share of time in which any GPU kernel runs). The rest is the serial part on the CPU. One GPU can therefore serve several dlpick instances.

  • GPU memory: above batch size 16, the GPU memory jumps from about 250 MiB to 1.8–3.4 GiB without making dlpick faster. Batch size 16 is the best choice, especially on small or shared GPUs.

  • Host memory: with the GPU, dlpick needs about 0.8 GB more main memory, mostly for the CUDA and cuDNN libraries.

  • Threads: two threads took as long as one but used 60 % more CPU time.

Use --torch-info to check which libtorch build and which device dlpick uses.

Memory

On the CPU, dlpick needed at most 0.9 GB of main memory for the test dataset (batch size 32, about 300 streams). As a rough estimate for other networks:

memory ≈ 0.7 GB
       + 0.4 MB × number of streams
       + 2.5 MB × batch size
       (+ 0.8 GB with the GPU)

With 1,000 streams, that is about 1.2 GB on the CPU.

  • Base: about 0.7 GB for libraries, models, inventory and buffers.

  • Per stream: dlpick keeps the last 8–9 windows of each stream to evaluate picks across overlapping windows. Their waveform data and model output are released right after classification, so each window takes only about 43 KB.

  • Per batch: intermediate results of the model, 2–3 MB per window.

dlpick tunes the memory allocator of glibc itself, so that large tensors are not returned to the operating system after every batch. Without this, about a quarter of the runtime went to page faults. Replacing the allocator is not necessary: jemalloc, for example, was slower with its default settings.

Real-time operation

In real-time operation, a batch fills only as fast as data arrive. dlpick therefore computes an incomplete batch as soon as its oldest window has waited 3 s. This adds at most about 4 s (the waiting time, plus up to 1 s timer resolution) and the computation time to the pick delay.

  • Larger batches fill more slowly. A picker with few streams relies mostly on the timer, and its batches stay small anyway.

  • On the test data at batch size 32, 92 % of all windows were computed in full batches. The timer had no measurable cost.

  • For low latency on a dedicated host, prefer more threads over larger batches.

Reproducibility of picks
  • On the CPU, the picks are identical for all batch sizes (1–256) and thread counts (1–6).

  • On the GPU, all batch sizes give the same picks, but 2–4 % of them differ in time by one sample (10 ms at 100 Hz, rarely up to 40 ms) or in confidence by ±0.01. Runs with the same batch size are identical.

  • CPU vs. GPU: 942 of 981 picks were identical. Most of the others differ by one sample, a few S picks with low confidence by up to 80 ms. Three picks with a confidence close to the threshold exist on only one of the two devices. The GPU and CPU libraries round differently. dlpick disables TF32 on the GPU to keep the differences small.

For regression tests, keep one reference per device and batch size, or compare picks with a tolerance and treat picks up to about 0.02 above the confidence threshold as borderline.

Measuring performance

To find the best settings for your hardware, run dlpick offline on a representative dataset and vary one setting at a time:

/usr/bin/time -v taskset -c 0,2,4,6 \
    dlpick -I data.mseed -d localhost --offline \
           --batch-size 32 --num-threads 4

/usr/bin/time -v reports the wall-clock time, CPU time, page faults and peak memory (“Maximum resident set size”). taskset pins the threads to the given logical CPUs; choose one logical CPU per physical core. On the GPU, record the GPU load and memory in parallel:

nvidia-smi --query-gpu=utilization.gpu,memory.used \
           --format=csv,noheader,nounits -lms 500 > gpu.csv

Points to watch:

  • Check the number of picks first. A configuration change can silently exclude stations and make dlpick faster. In one test run, stations without N and E components were skipped after cloneHorizontalsFromVertical had been lost from the bindings: dlpick ran faster and produced 603 instead of 980 picks.

  • Heat: on many machines the clock frequency drops as the CPU heats up. In a series of back-to-back runs, later runs were up to 27 % slower. Pause for about a minute between runs, or compare CPU cycles from perf stat -e cycles,instructions instead of wall-clock time for single-thread runs.

  • One change at a time: batch size and thread count interact. Measure the batch sizes for each thread count you consider.

For a closer look at memory use, dlpick can be built with diagnostics:

cmake -DDLPICK_DIAGNOSTICS=ON ...

dlpick then logs every 10 s how many windows are alive and where they are held (queued, in the window chains, referenced by picks only), the heap usage and the size of the record buffers. It also logs once how much memory the data of one window take.

Phase hints

DLPick takes the phase hint of a pick from the phase the model assigns to it. PhaseNet and EQTransformer distinguish P and S phases, so their picks are labeled P or S.

To tell DLPick picks apart from manual picks or from those of other pickers, for example in offline playbacks, add a prefix or suffix to the phase hint with picks.phaseHint. The placeholder {p} stands for the phase from the model: with picks.phaseHint = "{p}_dl" the picks are labeled P_dl and S_dl.

As another example, you could put a ‘d’ in front of the phase name and append the confidence as percentage:

dlpick --phase-hint "d{p} {c:04.1%}"
"dP (93.3%)"
"dS (01.1%)"

The corresponding module configuration parameter is picks.phaseHint. Ensure to reset this parameter, when switching back to production mode.

Custom models

Custom models can easily be added, after they have been converted by gempa into the correct format. To use them, first install dltools. Let’s say your new model is an EQTransformer trained on your own dataset called “TestDataset”. Gempa DL models follow a specific naming convention that refers to the model, the trained dataset and an optional version. To keep names simple and short there are abbreviations for models and dataset. They are stored with your dlmodels installation in a file called dlmodels_maps.json. To make your model available for DLPick or other gempa DL modules and plugins, you need to edit this file, as well, which is easily done by dltools.

The following line adds your dataset name with the abbreviation “tds” (abbreviations are always 2 or 3 letters) to the default file path /home/data/dlmodels/dlmodels-pick/dlmodels_maps.json:

$ dltools-add-ds TestDataset tds

The next step is to move your model to the custom directory and to link it to the standard directory and to merge your dlmodels_maps.jons files:

$ mv eq-tds.json eq-tds.cpu.pt eq-tds.cuda.pt /home/data/dlmodels/custom  # default directory for custom models
$ dltools-sync-models /home/data/dlmodels  # parent directory for picker, classifier and models

This adds the config file (.json) and the two checkpoints (for CPU and for CUDA) to the correct location and links them into /home/data/dlmodels/dlmodels-pick. The file /home/data/dlmodels/dlmodels-pick/dlmodels_maps.json will have all necessary information on your dataset, which allows for parsing your file name correctly, without error message:

  • “eq”-> “EQTransformer”

  • “tds” -> “TestDataset”

Note

You are not forced to use this file structure. dltools-sync-models needs a parent directory for pickers and classifiers, but the custom models directory can be provided with parameter –customPath /path/to/custom/models. In case you don’t have subdirectories in your parent directory, add –flat.

Even dltools-add-ds can be advised to read and write to specific subdirectories instead of assuming the defaults: dltools-add-ds TestDataset tds –input /path/to/custom/models/dlmodels_maps.json

Confirm the changes by listing all available models:

$ dlpick --print-models

List of available models:
-------------------------------------------------------------------------------------------------------
  Identifier          | Architecture      | Attrib. | Datasets                         | Version | C | G
-------------------------------------------------------------------------------------------------------
eq-et                 | EQTransformer     |         | ETHZ                             |         | x | x
   :                        :                          :                                           :   :
eq-tds                | EQTransformer     |         | TestDataset                      |         | x | x
   :                        :                          :                                           :   :

The list view is shortened here but should look similar. From now on, eq-tds can be used as value for DLPick parameter modelWeights.

Concepts

Reduction algorithm

With the overlapping of prediction windows, picks of two overlapping windows might refer to the same onset although might not always be exactly at the same time. Either way, this behavior produces much more picks than acceptable. Two algorithms are here to improve this situation.

Simple Reduction Algorithm

Whether two picks define the same phase onset, is currently controlled by an interval for the simple reduction algorithm. This means if two picks lie in the same interval, they will be merged and only the more confident one “survives”. The simple reduction algorithm iterates through the ordered list of picks (one direction: from past to future) and looks ahead for the interval time. The next found pick will be merged with the first one, and so on. The algorithm will be applied a second time, because the merged pick will be skipped in the first run for the next comparison, thus, it could be too dense to a neighboring pick no matter if the latter was merged as well. This two-passes strategy tickles the issue of progressively moving picks: Let’s say a bunch picks lie very close to each other with increasing confidence, but the first and the second halves of picks refer to actually different onsets. If we would use a one-pass strategy and use the last merged pick as starting point for the next comparison then we could end up in a situation where no pick for the first event is left.

Pick Cluster Reduction Algorithm (Default)

Instead of comparing neighboring picks one after another, this algorithm groups picks that lie close together into clusters and keeps only the most confident pick of each cluster. Two picks count as close if their time difference is smaller than the configured distance.

The algorithm works in four steps:

  1. For each pick, form a cluster from the pick and all picks close to it.

  2. Assign each pick to the cluster whose center is nearest. The resulting clusters can still overlap in time.

  3. Merge overlapping clusters.

  4. Reduce a cluster to its most confident pick as soon as it ends before the safe time, before which no more picks can arrive, or as soon as it holds more picks than the configured threshold.

DLPick remembers the time intervals of reduced clusters. A pick that arrives later and falls into such an interval is ignored.

Module Configuration

etc/defaults/global.cfg
etc/defaults/dlpick.cfg
etc/global.cfg
etc/dlpick.cfg
~/.seiscomp/global.cfg
~/.seiscomp/dlpick.cfg

dlpick inherits global options.

Note

Modules/plugins may require a license file. The default path to license files is @DATADIR@/licenses/ which can be overridden by global configuration of the parameter gempa.licensePath. Example:

gempa.licensePath = @CONFIGDIR@/licenses
modelsPath

Default: /home/data/dlmodels/dlmodels-pick

Type: directory

Search path for Deep Learning models. This path is also used to look up the file "dlmodels_maps.json" holding additional information on the available models.

modelWeights

Type: string

Values: eq-et,eq-ge,eq-in,eq-iq,eq-le,eq-ne,eq-or,eq-sc,eq-st,eq-vp,pn-dt,pn-et,pn-ge,pn-iq,pn-jm,pn-le,pn-ne,pn-or,pn-pi,pn-sc,pn-st,pn-vp

Name of the Deep Learning model to use. The name is a combination of the architecture, the name of the trained weights and, in some cases, a version number.

Note: The given list of supported values may be incomplete.

Example:

‘phasenet-instance’ or its short identifier ‘pn-in’ loads the Deep Learning model PhaseNet with weights trained on the Instance dataset.

gpu

Type: boolean

If set, model and data will work on the GPU if cuda is available on the machine else on CPU.

numThreads

Default: 2

Type: int

Number of CPU threads used for model inference. Increase it only if dlpick has most of the machine to itself; more threads than physical cores is usually slower. 0 lets libtorch decide, which means all logical CPUs.

leadTime

Default: 300

Unit: s

Type: int

The time interval to start picking on waveforms before current time.

Note

input.* Control the general preprocessing of data fed to the model.

input.traceWindowOlRatio

Default: 0.0

Type: double

Ratio defining how much trace windows are overlapping each other.

input.batchSize

Default: 32

Type: int

Number of data windows to process per picker at the same time.

input.filter

Type: string

The SeisComP filter to apply on the data before it is sent to the picker. This parameter overrides any model or station filter parameter.

Note

picks.* Control the workflow from the model’s output prediction to the final pick.

picks.deadMargin

Default: -1

Type: list:int

Margin as number of samples of model’s prediction output trace. Format:

samples left, samples right

If the pick falls inside this margin (left or right side), then it is discarded. This is also called "blinding".

The value is intended to be a pair of positive integers for start and end region, but when setting a single number, the same value will be applied for both.

Single empty value (=0): No blinding is applied.

Single negative value: dlpick uses values recommended by the model.

picks.phaseHint

Default: {p}

Type: string

Template string for the phase hint.

This string is interpolated similar to a Python format string. The phase represented by the placeholder "{p}" is always required. You can use "{c}" as a placeholder for the pick confidence and add format specifications.

Examples:

"{p}": phase "P", confidence 0.1234 => "P"

"{p} {c}": phase "P", confidence 0.1234567 => "P 0.1234567"

"{p} {c:06.2%}": phase "P", confidence 0.1234567 => "P 012.34%"

"conf {c:06.1} phase {p}": phase S, confidence 0.4567 => "conf 000.5 phase S"

picks.mapPhases

Default: P:P,S:S

Type: list:string

Rename phase hints. E.g., to rename P to Is and S to It: "P:Is,S:It"

picks.minGatherPicksBeforeFlush

Default: 10

Type: int

Set the number of picks that must be gathered before flushing (publishing).

This criterion is tested as well as the timeout. If one of them is true, the picks considered as safe-to-flush will be flushed.

picks.minTimeBeforeFlush

Default: 10.0

Unit: s

Type: double

The timeout for gathering picks until they are published. After publishing, the timer starts over again with the next staging of picks, in a buffer.

When the publisher process tries to pop picks from the pick buffers, this criterion is tested as well as the minimum picks number. If one of them is true, those picks considered as safe-to-flush will be published.

picks.thresholds.minPConfidence

Default: -1

Type: double

Threshold defining the minimum confidence of for a P pick.

-1: The value recommended by the model applies if available. 0.1 is considered if the model has no recommendation.

picks.thresholds.minSConfidence

Default: -1

Type: double

Threshold defining the minimum confidence of for an S pick.

-1: The value recommended by the model applies if available. 0.1 is considered if the model has no recommendation.

picks.thresholds.minPUncertainConfidence

Type: double

If set, P picks with thresholds <"picks.thresholds.minPConfidence" are also added. Their phaseHint receives the prefix ‘u’ allowing their identification. The value is overridden by bindings.

picks.thresholds.minSUncertainConfidence

Type: double

If set, S picks with thresholds <"picks.thresholds.minPConfidence" are also added. Their phaseHint receives the prefix ‘u’ allowing their identification. The value is overridden by bindings.

picks.thresholds.minSNR

Type: double

Minimum SNR value of a pick to be published.

0: Publish the pick independent of SNR.

picks.reduction.algorithm

Default: Cluster

Type: string

Values: Cluster,Simple

The picks reduction algorithm to use.

"Simple" = Simple reduction algorithm. Reduces too dense picks using a sliding time window.

"Cluster" = Cluster reduction algorithm. P and S picks are reduced separately. Picks are grouped into clusters, each spanning less than "picks.reduction.cluster.clusterSize" seconds, and each cluster is reduced to its most confident pick. Emitted picks are at least "picks.reduction.cluster.clusterSize" seconds apart. A cluster is reduced as soon as it is "safe", i.e. no future prediction window can add picks to it anymore. Until then, its picks remain staged. With "picks.reduction.cluster.safeMinPickCount", clusters that already contain enough picks can be reduced and emitted earlier.

picks.reduction.minGatherPicksBeforeReduce

Default: 10

Type: int

The number of picks that must be staged before the reduction algorithm is applied to them.

When pushing to or popping from a pick buffer, this criterion is tested as well as the timeout. If one of them is true, reduction is applied. Separate pick buffers exist for each stream.

picks.reduction.minTimeBeforeReduce

Default: 10.0

Unit: s

Type: double

The timeout for staging picks until the reduction algorithm is applied to them. After reduction, the timer starts over again.

When pushing to or popping from a pick buffer, this criterion is tested as well as the number of minimum picks. If one of them is true, reduction is applied. Separate pick buffers exist for each stream.

Note

output.* Control where and how picks written or sent to.

output.ep

Type: boolean

Dump picks to stdout in SCML format turning off the messaging connection. It implies "output.offline".

Can be combined with "output.csv" but not with "output.stdout".

output.xml

Type: boolean

Output picks periodically to files in SCML format or when the module finishes. After finishing, the files are merged into one.

Activating this parameter allows to extract intermediate picks or to feed a spooler during runtime, even in real-time application.

Combine with "output.csv" and "output.stdout".

During runtime, dlpick generates consecutively numbered files with the file name stem "picks". When the picker is about to finish, those files are merged into one big file with the stem named "picks-merged". If one or more files with the same name already exist, dlpick will also number the file name. The output path can be changed using parameter "outDir".

output.csv

Type: boolean

If set, picks will be dumped to CSV file. Can be combined with "output.xml" and "output.stdout".

For more details on how files are generated, see option "output.xml".

output.formatted

Type: boolean

Generate formatted SCML. Otherwise, SCML is unformatted.

output.stdout

Type: boolean

If set, picks will be dumped to stdout.

Output format:

"streamID phaseHint : time confidence: confidenceValue model weights"

Do not combine with "ep" since "output.stdout" would interfere with the well-formed SCML of "ep".

output.offline

Type: boolean

Disconnects from messaging. Picks won’t be published via messaging, so another output option is needed, e.g. "output.stdout".

For offline playbacks, just use "output.ep", it will turn off the messaging automatically.

output.outDir

Type: directory

Set output folder for pick SCML/CSV files.

Bindings Parameters

detecEnable

Default: true

Type: boolean

Enable or disable dlpick on a station

modelWeights

Type: string

Values: eq-et,eq-ge,eq-in,eq-iq,eq-le,eq-ne,eq-or,eq-sc,eq-st,eq-vp,pn-dt,pn-et,pn-ge,pn-in,pn-iq,pn-jm,pn-le,pn-ne,pn-or,pn-pi,pn-sc,pn-st

Name of the Deep Learning model to use. The name is a combination of the architecture, the name of the trained weights and, in some cases, a version number.

Note: The given list of supported values may be incomplete.

Example:

‘phasenet-instance’ or its short identifier ‘pn-in’ loads the Deep Learning model PhaseNet with weights trained on the Instance dataset.

Setting a value overrides the equally-named parameter in module configuration.

cloneHorizontalsFromVertical

Default: false

Type: boolean

If a single component station should be used, then this parameter decides whether the single vertical component will be cloned to the missing two horizontal components (true) or if this stream will be skipped due to missing metadata (false).

streamChannels

Type: list:string

A list of channels as input for the picker model. Overrides "detecStream". The order of channels is determined by the model’s *component_order* parameter. Therefore, the last letters must be distinct. E.g., ‘EHZ,HDF’. ‘BH’ would tell the model to try to log all three components (i.e.,BHZ, BHN, BHE), exactly as global.detecStream would do. You can further define that a channel can be neglected if no data is available by annotating it with a ‘:0’, e.g., ‘HDF:1,EHZ:0’. Another feature is the possibility to force a specific location code, even though it might not be found in the inventory: ‘DN.EHZ:1,HDF:1’. This can be useful if the record stream provides processed data via a fake location ‘DN’.

Note

input.* Control the general pre-processing of data fed to the model.

input.traceWindowOlRatio

Default: 0.0

Type: double

Ratio defining how much trace windows are overlapping each other.

input.batchSize

Default: 32

Type: int

Number of data windows to process per picker at the same time.

input.filter

Type: string

The filter applied to waveforms before phase picking.

Note

picks.* Control the workflow from the model’s output prediction to the final pick.

picks.deadMargin

Default: -1

Type: list:int

Blinding margin in count of samples of model’s prediction output trace. If the pick falls inside this margin (left or right side) then it is discarded. This is also called "blinding".

The value is intended to be a pair of positive integers for start and end region, but when setting a single number, the same value will be applied for both.

If this parameter is empty, blinding will be configured by the module config.

Negative values tell dlpick to use the model’s recommended blinding values.

picks.mapPicks

Default: P:Z,S:N

Type: list:string

Map a pick to a component. E.g., ‘P:Z,S:Z’ would output both P and S on the Z component. Ensure that the station of this binding actually has the corresponding component since this parameter is not semantically validated.

picks.minGatherPicksBeforeFlush

Default: 10

Type: int

Set the number of picks that must be gathered before publishing.

Details: Minimum-size criterion for flushing a pick buffer. When the publisher process tries to pop picks from the pick buffers, this criterion is tested as well as the timeout. If one of them is true, those picks considered as safe-to-flush will be sent to the output sinks.

This value overrides the same-named global config parameter for the corresponding set of stations.

picks.minTimeBeforeFlush

Default: 10.0

Unit: s

Type: double

Set the timeout for gathering picks until they are published. After publishing, the timer starts over again with the next staging of picks, in a buffer.

Details: Time criterion for flushing a pick buffer. When the publisher process tries to pop picks from the pick buffers, this criterion is tested as well as the minimum picks number. If one of them is true, those picks considered as safe-to-flush will be sent to the output sinks.

This value overrides the same-named global config parameter for the corresponding set of stations.

picks.thresholds.minPConfidence

Type: double

Set the confidence threshold for P picks.

* -1: Use the value recommended by the mode if there is one. 0.1 applies otherwise.

* Unset: Use the module configuration parameter.

picks.thresholds.minSConfidence

Type: double

Set the confidence threshold for S picks.

* -1: Use the value recommended by the mode if there is one. 0.1 applies otherwise.

* Unset: Use the module configuration parameter.

picks.thresholds.minPUncertainConfidence

Type: double

If set, adds additional picks with a lower threshold, marking them with the prefix ‘u’. Picks above the normal picks.thresholds.minPConfidence are not touched.

This value overrides the same-named global config parameter for the corresponding set of stations.

picks.thresholds.minSUncertainConfidence

Type: double

If set, adds additional picks with a lower threshold, marking them with the prefix ‘u’. Picks above the normal picks.thresholds.minSConfidence are not touched.

This value overrides the same-named global config parameter for the corresponding set of stations.

picks.thresholds.minSNR

Type: double

Minimum SNR value of a pick to be published.

0: Accept all picks independent of SNR.

Note

picks.reduction.* Settings for pick reduction. Pick reduction is mainly necessary with a high window overlapping ratio. But in some cases also models picking to densely.

picks.reduction.algorithm

Default: Cluster

Type: string

Values: Cluster,Simple

The picks reduction algorithm to use.

"Simple" = "Simple Reduction". Reduces too dense picks in a linear fashion.

"Cluster" = Cluster reduction algorithm. P and S picks are reduced separately. Picks are grouped into clusters, each spanning less than "picks.reduction.cluster.clusterSize" seconds, and each cluster is reduced to its most confident pick. Emitted picks are at least "picks.reduction.cluster.clusterSize" seconds apart. A cluster is reduced as soon as it is "safe", i.e. no future prediction window can add picks to it anymore. Until then, its picks remain staged. With "picks.reduction.cluster.safeMinPickCount", clusters that already contain enough picks can be reduced and emitted earlier.

This value overrides the same-named global config parameter.

picks.reduction.minGatherPicksBeforeReduce

Default: 10

Type: int

This parameter sets the number of picks that must be staged before the reduction algorithm is applied to them.

Details: Minimum-size criterion for applying the reduction algorithm to a pick buffer. When pushing to or popping from a pick buffer, this criterion is tested as well as the timeout. If one of them is true, the reduction will be applied. (There is a pick buffer for each stream.)

This value overrides the same-named global config parameter.

picks.reduction.minTimeBeforeReduce

Default: 10.0

Unit: s

Type: double

This parameter sets the timeout for staging picks until the reduction algorithm is applied to them. After reduction, the timer starts over again.

Details: Timeout criterion for applying the reduction algorithm to a pick buffer. When pushing to or popping from a pick buffer, this criterion is tested as well as the minimum picks number. If one of them is true, the reduction will be applied. (There is a pick buffer for each stream.)

This value overrides the same-named global config parameter for the corresponding set of stations.

picks.reduction.cluster.clusterSize

Default: 1.0

Unit: s

Type: double

Time span of a pick cluster and minimum distance between the resulting picks. Picks are grouped into clusters that each span less than clusterSize seconds, and each cluster is reduced to its most confident pick. Picks closer than clusterSize to an already emitted pick are discarded.

picks.reduction.cluster.safeMinPickCount

Type: int

Only used by the cluster algorithm for pick reduction.

Minimum number of picks a cluster must contain to be emitted early. Such a cluster is reduced to its most confident pick right away, without waiting for the remaining prediction windows that cover it. Picks closer than clusterSize to the emitted pick are discarded afterwards, even if they are more confident.

All other clusters are reduced only once no future prediction window can add picks to them, i.e. when the next prediction window starts after the cluster’s last pick plus the cluster size.

A value of 0 disables early emission. Choose a value clearly below the number of prediction windows covering each sample, which is about 1 / (1 - overlap ratio). Otherwise, the count is rarely reached.

picks.reduction.simple.interval

Default: 1.0

Unit: s

Type: double

The time interval for the "Simple" picks reduction algorithm.

This parameter sets the time span in seconds before and after a pick where no other pick is supposed to exist.

The algorithm leaves only those picks with the highest confidence in the interval after each reduction run.

Command-Line Options

dlpick [options]

Generic

-h, --help

Show help message.

-V, --version

Show version information.

--config-file file

The alternative module configuration file. When this option is used, the module configuration is only read from the given file and no other configuration stage is considered. Therefore, all configuration including the definition of plugins must be contained in that file or given along with other command-line options such as --plugins.

--plugins arg

Load given plugins.

-D, --daemon

Run as daemon. This means the application will fork itself and doesn’t need to be started with &.

--auto-shutdown arg

Enable/disable self-shutdown because a master module shutdown. This only works when messaging is enabled and the master module sends a shutdown message (enabled with --start-stop-msg for the master module).

--shutdown-master-module arg

Set the name of the master-module used for auto-shutdown. This is the application name of the module actually started. If symlinks are used, then it is the name of the symlinked application.

--shutdown-master-username arg

Set the name of the master-username of the messaging used for auto-shutdown. If "shutdown-master-module" is given as well, this parameter is ignored.

--print-models

Print list of available models.

Verbosity

--verbosity arg

Verbosity level [0..4]. 0:quiet, 1:error, 2:warning, 3:info, 4:debug.

-v, --v

Increase verbosity level (may be repeated, e.g., -vv).

-q, --quiet

Quiet mode: no logging output.

--component arg

Limit the logging to a certain component. This option can be given more than once.

-s, --syslog

Use syslog logging backend. The output usually goes to /var/lib/messages.

-l, --lockfile arg

Path to lock file.

--console arg

Send log output to stdout.

--debug

Execute in debug mode. Equivalent to --verbosity=4 --console=1 .

--log-file arg

Use alternative log file.

Messaging

-u, --user arg

Overrides configuration parameter connection.username.

-H, --host arg

Overrides configuration parameter connection.server.

-t, --timeout arg

Overrides configuration parameter connection.timeout.

-g, --primary-group arg

Overrides configuration parameter connection.primaryGroup.

-S, --subscribe-group arg

A group to subscribe to. This option can be given more than once.

--content-type arg

Overrides configuration parameter connection.contentType.

Default: binary

--start-stop-msg arg

Default: 0

Set sending of a start and a stop message.

Database

--db-driver-list

List all supported database drivers.

-d, --database arg

The database connection string, format: service://user:pwd@host/database. "service" is the name of the database driver which can be queried with "--db-driver-list".

--config-module arg

The config module to use.

--inventory-db arg

Load the inventory from the given database or file, format: [service://]location .

Records

--record-driver-list

List all supported record stream drivers.

-I, --record-url arg

The RecordStream source URL. Format: [service://]location[#type]. "service" is the name of the RecordStream driver which can be queried with "--record-driver-list". If "service" is not given, "file://" is used and simply the name of a miniSEED file can be given.

--record-file arg

Specify a file as record source.

--record-type arg

Specify a type for the records being read.

Misc

--lead-time

Overrides configuration parameter leadTime.

--ref-time

The time used to look up the correct inventory epoch. Set this time to process waveforms for which the inventory at current time is invalid.

Format:

Any format supported by SeisComP.

--relax-reft

If set, parameter "streams.referenceTime" is treated like a recommendation but not as a hard condition to add streams.

--ignore-bindings

Ignore station bindings read from config. Parameters from module configuration (overridden by command-line parameters) will be used for all stations.

--prefer-bindings

Ignore options set by command-line arguments, in case there is a specific station binding for the same parameter. This is useful when you want to test a certain value only on stations that have no bindings, but not on those with bindings, since they have their special settings for a good reason.

--force-channels

Load stations by config but ignore channels specified in detecStream. Force loading streams with channels as listed. E.g., ‘HDF:1,EHZ:0’, where ‘1’ means ‘necessary’ and ‘0’ means ‘negligible’. In this example, if EHZ data is missing, zeros will be passed to the model, in its place. Attention: Since this parameter is global, use it only with a consistent model architecture.

--gpu

Overrides configuration parameter gpu.

--num-threads

Overrides configuration parameter numThreads.

--log-torch-info

Log libtorch build configuration, CUDA availability and visible GPU devices.

Input

--ol-ratio

Overrides configuration parameter input.traceWindowOlRatio.

--filter

Overrides configuration parameter input.filter.

--batch-size

Overrides configuration parameter input.batchSize.

Model

--model-weights

Overrides configuration parameter model.modelWeights.

Picks

--phase-hint

Overrides configuration parameter picks.phaseHint.

--phase-map

Overrides configuration parameter picks.mapPhases.

--p-threshold

Overrides configuration parameter picks.thresholds.minPConfidence.

--s-threshold

Overrides configuration parameter picks.thresholds.minSConfidence.

--p-uncertain

Overrides configuration parameter picks.thresholds.minPUncertainConfidence.

--s-uncertain

Overrides configuration parameter picks.thresholds.minSUncertainConfidence.

--snr-threshold

Overrides configuration parameter picks.thresholds.minSNR.

Output

--offline

Overrides configuration parameter output.offline.

--ep

Overrides configuration parameter output.ep.

--xml

Overrides configuration parameter output.xml.

--csv

Overrides configuration parameter output.csv.

--stdout

Overrides configuration parameter output.stdout.

--out

Overrides configuration parameter output.outDir.

-f, --formatted

Overrides configuration parameter output.formatted.

--no-file-merging

This option prevents that, when the application finishes, all output files gathered by csv or xml are merged into one, which the app does by default.