rsamtrig

Real-time Seismic-Amplitude Measurement (RSAM) trigger.

Description

RSAMTRIG (Real-time Seismic-Amplitude Measurement trigger)

Introduction

rsamtrig is a module for the continuous calculation of seismic amplitudes and the detection of time windows with high activity. The amplitude values are either written to a file or to stdout following a line-based format: “streamID filterName startTime value”. The detection and cancellation of height seismic activity is implemented trough thresholds, counters and delta values for threshold changes. Detections are signaled on stdout or through an external trigger script.

Configuration

rsamtrig comes with configurable bindings and it is mandatory to have a at least one active rsamFilter profile with rsamFilter.$name.baseLevel configured per binding profile, rsamFilter.$name.filter is optional.

_images/rsamtrig-config.png

Each stream you want to calculate Real-time Seismic-Amplitude Measurement (RSAM) values for must:

  • be enabled

  • have a gain set

  • a detecStream (and optional detecLoc) configured, see default binding

  • have a ‘rsamtrig’ binding assigned

Usage

rsamtrig can be started as any other SeisComP application, either as daemon via:

seiscomp start rsamtrig

or via the command line:

rsamtrig --debug

Outputs to stdout whenever a level is increase / decreased.

Workflow

The basic workflow is the following:
  • load inventory and configuration and search for stream fulfilling configuration criteria

  • start acquisition for requested streams

  • for each incoming record:
    • initialize record buffer if uninitialized or sampling frequency changed

    • reset buffer on gap / overlap

    • convert data to float if necessary

    • apply gain, convert to nm/s

    • apply filter (if set)

    • push record data to buffer and trigger RSAM calculation whenever time window is full

    • process RSAM
      • mean = ∑sample / sample count

      • rsam = ∑abs(sample-mean) / sample count

      • adjust inc/dec counter

      • push/pop level stack

      • generate output

Example

  • parameter: –console=1 –verbosity=3

  • stdout + stderr (sc3 log) mixed, all lines having ‘[notice]’ string are log messages sent to stderr, the rest is the application output

  • each stdout line starts with a timestamp representing the start time of the RSAM time window

_images/rsam_graph.png
...

20:27:58 [notice] number of streams: 6
20:28:09 [notice] 2015-04-10T18:27:43.049999Z: rsam value 138.282150 of GE.MORC..BHE 1 times above current level 100.000000
20:28:09 [notice] 2015-04-10T18:27:53.049999Z: rsam value 144.862946 of GE.MORC..BHE 2 times above current level 100.000000
20:28:10 [notice] 2015-04-10T18:27:47.419538Z: rsam value 124.098343 of GE.TNTI..BHE 1 times above current level 100.000000
20:28:11 [notice] 2015-04-10T18:27:45.0000Z: rsam value 148.677490 of GE.MORC..BHZ 1 times above current level 100.000000
20:28:11 [notice] 2015-04-10T18:27:55.0000Z: rsam value 146.034256 of GE.MORC..BHZ 2 times above current level 100.000000
20:28:12 [notice] 2015-04-10T18:27:50.419538Z: rsam value 101.121986 of GE.TNTI..BHN 1 times above current level 100.000000
20:28:23 [notice] 2015-04-10T18:27:53.2Z: rsam value 184.832199 of GE.MORC..BHN 1 times above current level 100.000000
20:28:28 [notice] 2015-04-10T18:27:57.419538Z: rsam value 124.363701 of GE.TNTI..BHE 2 times above current level 100.000000
20:28:28 [notice] 2015-04-10T18:28:07.419538Z: rsam value 160.741867 of GE.TNTI..BHE 3 times above current level 100.000000
2015-04-10T18:28:07.419538Z: stream GE.TNTI..BHE filter 'BW(3,1,4)' above level 100, new level 192.89
20:28:31 [notice] 2015-04-10T18:28:00.419538Z: rsam value 145.302765 of GE.TNTI..BHN 2 times above current level 100.000000
20:28:31 [notice] 2015-04-10T18:28:10.419538Z: rsam value 148.307144 of GE.TNTI..BHN 3 times above current level 100.000000
2015-04-10T18:28:10.419538Z: stream GE.TNTI..BHN filter 'BW(3,1,4)' above level 100, new level 177.969
20:28:32 [notice] 2015-04-10T18:28:03.049999Z: rsam value 150.313782 of GE.MORC..BHE 3 times above current level 100.000000
2015-04-10T18:28:03.049999Z: stream GE.MORC..BHE filter 'BW(3,1,4)' above level 100, new level 180.377
20:28:35 [notice] 2015-04-10T18:28:15.0000Z: rsam value 119.659538 of GE.MORC..BHZ 1 times above current level 100.000000
20:28:42 [notice] 2015-04-10T18:28:23.2Z: rsam value 106.586319 of GE.MORC..BHN 1 times above current level 100.000000
20:28:51 [notice] 2015-04-10T18:28:20.419538Z: rsam value 230.554642 of GE.TNTI..BHN 1 times above current level 177.968567
20:28:56 [notice] 2015-04-10T18:28:23.049999Z: rsam value 85.227608 of GE.MORC..BHE 1 times below previous level 100.000000
20:28:58 [notice] 2015-04-10T18:28:25.0000Z: rsam value 112.731125 of GE.MORC..BHZ 2 times above current level 100.000000

...

Module Configuration

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

rsamtrig 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
triggerIncCount

Default: 3

Unit: count

Type: int

Number of times the current threshold is exceeded before increasing the threshold.

triggerDecCount

Default: 1080

Unit: count

Type: int

Number of times the RSAM value falls below the previous threshold before decreasing the threshold.

levelIncrement

Default: 20

Unit: percent

Type: double

If the current threshold is exceeded ‘triggerIncCount’ times, the new threshold is calcualated by adding this percentage to the last RSAM value.

levelDecrement

Default: 20

Unit: percent

Type: double

If the current threshold is undercut ‘triggerDecCount’ times, the new threshold is calculated by subtracting this percentage from the current threshold. The stream specific base level defines the lower limit for the threshold.

timeWindow

Default: 10

Unit: s

Type: double

Length of time window to use for RSAM calculation.

minAvailability

Default: 60

Unit: percent

Type: double

Minimum percentage of data availability for RSAM calculation.

backlog

Default: 600

Unit: s

Type: int

Backlog time (in seconds) to fetch and process waveform data right after the start. Note: The Application also stores the start time of the last successfully processed time window in a state file. The start time of the data acquisition is calculated from the maximum of both values: max(startTime, NOW-backlogSeconds).

stateFile

Default: @ROOTDIR@/var/lib/rsamtrigger/state

Type: string

File to store the application state.

rsamFile

Type: string

If set the calculated RSAM value is dumped using the following line-based format: "streamID filterName startTime value". Use "-" to write the values to stdout.

triggerScript.cmd

Type: string

Script to call on level change. If empty the trigger parameters are written to stdout else the script is called with the following parameters: streamid, filterName, oldLevel, newLevel, startTime of time window

triggerScript.timeout

Default: -1.0

Unit: s

Type: double

Maximum execution time of the script. If exceeded the script is terminated. Use a negative value to indicate an infinite timeout.

rsamScript.cmd

Type: string

Script to call with calculated RSAM value. The script is called with the following parameters: streamid, filterName, startTime of time window, RSAM value

rsamScript.timeout

Default: -1.0

Unit: s

Type: double

Maximum execution time of the script. If exceeded the script is terminated. Use a negative value to indicate an infinite timeout.

Bindings Parameters

rsamFilters

Type: list:string

Defines a list of filters to apply.

Note

rsamFilter.$name.* $name is a placeholder for the name to be used and needs to be added to rsamFilters to become active.

rsamFilters = a,b
rsamFilter.a.value1 = ...
rsamFilter.b.value1 = ...
# c is not active because it has not been added
# to the list of rsamFilters
rsamFilter.c.value1 = ...
rsamFilter.$name.filter

Type: string

Waveform filter string to apply before RSAM calculation.

rsamFilter.$name.baseLevel

Type: double

Minimum amplitude level. Used as starting point and lower barrier.

rsamFilter.$name.trigger

Default: true

Type: boolean

Defines whether level changes are signaled through the configured trigger script. If disabled RSAM values are still computed and may be dumped or processed by the RSAM script.

Command-Line Options

--start arg

Record start time (ISO format, UTC, default: now)

--end arg

Record end time (ISO format, UTC, default: unset)

-p, --playback

Switch from real-time to playback mode. Do not change record state file.