rs2caps¶
Recordstream data acquisition plugin
Description¶
rs2caps uses the SeisComP RecordStream [4] to feed data into caps of to stdout.
Examples¶
Inject data into the CAPS server:
seiscomp start caps rs2caps -I data.mseed --passthrough
Read the examples section to learn how to use rs2caps to input data into the CAPS server.
Read data from the file data.mseed resample to 10 Hz sample rate by the RecordStream and write the resulting data to stdout:
rs2caps -I resample://file?rate=10/data.mseed --passthrough --dump-packets --mseed > test.mseed
You may join the command with capstool [8] and scmssort [14]:
echo "2024,01,01,00,00,00 2024,01,01,00,10,00 * * * *" | capstool -H localhost |\ rs2caps -I resample://file?rate=10/- --passthrough --dump-packets --mseed |\ scmssort -E > test.mseed
Note
A similar action with additional data processing may be executed using sproc2caps.
Module Configuration¶
etc/defaults/global.cfg
etc/defaults/rs2caps.cfg
etc/global.cfg
etc/rs2caps.cfg
~/.seiscomp/global.cfg
~/.seiscomp/rs2caps.cfg
rs2caps 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
- output.address¶
Default:
localhost:18003
Type: string
Data output URL [[caps|capss]://][user:pass@]host[:port]. This parameter superseds the host and port parameter of previous versions and takes precedence.
- output.host¶
Default:
localhost
Type: string
Data output host. Deprecated: Use output.address instead.
- output.port¶
Default:
18003
Type: int
Data output port. Deprecated: Use output.address instead.
- output.timeout¶
Default:
60
Unit: s
Type: int
Timeout when sending a packet. If the timeout expires the connection will be closed and re-established.
- output.maxFutureEndTime¶
Default:
120
Unit: s
Type: int
Maximum allowed relative end time for packets. If the packet end time is greater than the current time plus this value, the packet will be discarded. By default this value is set to 120 seconds.
- output.bufferSize¶
Default:
1048576
Unit: bytes
Type: uint
Size (bytes) of the packet buffer.
- output.backFillingBufferSize¶
Default:
0
Unit: s
Type: int
Length of backfilling buffer. Whenever a gap is detected, records will be held in a buffer and not sent out. Records are flushed from front to back if the buffer size is exceeded.
- output.mseed.enable¶
Default:
false
Type: boolean
Enable on-the-fly miniSEED encoding. If the encoder does not support the input type of a packet it will be forwarded. Re-encoding of miniSEED packets is not supported.
- output.mseed.encoding¶
Default:
Steim2
Type: string
miniSEED encoding to use. (Uncompressed, Steim1 or Steim2)
- streams.begin¶
Type: string
Start time of data time window, default ‘GMT’
- streams.end¶
Type: string
End time of data time window
- streams.passthrough¶
Default:
false
Type: boolean
Do not subscribe to any stream and accept everything a record source is passing. This is useful in combination with files.
- journal.file¶
Default:
@ROOTDIR@/var/run/rs2caps/journal
Type: string
File to store stream states
- journal.flush¶
Default:
10
Unit: s
Type: uint
Flush stream states to disk every n seconds
- journal.waitForAck¶
Default:
60
Unit: s
Type: uint
Wait when a sync has been forced, up to n seconds
- journal.waitForLastAck¶
Default:
5
Unit: s
Type: uint
Wait on shutdown to receive acknownledgement messages, up to n seconds
- journal.syncWithBindings¶
Default:
false
Type: boolean
Whether to synchronize the journal file with bindings. If enabled then each time update-config is called, the bound stations will be synchronized with the current journal file. Unbound stations will be removed from the journal. Synchronizing with bindings will disable reading the inventory.
- statusLog.enable¶
Default:
false
Type: boolean
Log information status information e.g. max bytes buffered
- statusLog.flush¶
Default:
10
Type: uint
Flush status every n seconds to disk
Bindings Parameters¶
- selectors¶
Type: list:string
List of stream selectors in format LOC.CHA. If left empty all available streams will be requested.
Command-Line Options¶
Generic¶
- -h, --help¶
Show help message.
- -V, --version¶
Show version information.
- -D, --daemon¶
Run as daemon. This means the application will fork itself and doesn’t need to be started with &.
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, eg. -vv).
- -q, --quiet¶
Quiet mode: no logging output.
- -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 .
- --trace¶
Execute in trace mode. Equivalent to --verbosity=4 --console=1 --print-component=1 --print-context=1 .
- --log-file arg¶
Use alternative log file.
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.
- --record-file arg¶
Specify a file as record source.
- --record-type arg¶
Specify a type for the records being read.
Output¶
- -O, --output arg¶
Overrides configuration parameter
output.address
.This is the CAPS server which shall receive the data.
- --agent arg¶
Sets the agent string. Allows the server to identify the application that sends data.
- -b, --buffer-size arg¶
Size (bytes) of the journal buffer. If the value ist exceeded, a synchronization of the journal is forced.
- --backfilling arg¶
Default:
0
Buffer size in seconds for backfilling gaps.
- --mseed¶
Enable on-the-fly miniSEED encoding. If the encoder does not support the input type of a packet, it will be forwarded. Re-encoding of miniSEED packets is not supported.
- --encoding arg¶
miniSEED encoding to use: Uncompressed, Steim1 or Steim2.
- --rec-len arg¶
miniSEED record length expressed as a power of 2. A 512 byte record would be 9.
- --max-future-endtime arg¶
Maximum allowed relative end time for packets. If the packet end time is greater than the current time plus this value, the packet will be discarded. By default this value is set to 120 seconds.
- --dump-packets¶
Dump packets to stdout.
- --test¶
Disable socket communication.
- --dump¶
Dump all received data to stdout and don’t use the input port.
Journal¶
- -j, --journal arg¶
File to store stream states. Use an empty string to log to stdout.
- -f, --flush arg¶
Flush stream states to disk every n seconds.
- --wait-for-ack arg arg¶
Wait when a sync has been forced, up to n seconds.
- -w, --wait-for-last-ack arg¶
Wait on shutdown to receive acknownledgement messages, up to the given number of seconds.
Status¶
- --status-log¶
Log information status information, e.g., max bytes buffered.
- --status-flush arg¶
Flush status every n seconds to disk.
Streams¶
- -A, --add-stream arg¶
StreamID [net.sta.loc.cha] to add.
- --id-file arg¶
File to read stream IDs from.
- --passthrough¶
Do not subscribe to any stream and accept everything a record source is passing. This is useful in combination with files.
- --begin arg¶
Start time of data time window.
- --end arg¶
End time of data time window.
Polling¶
- --poll¶
For non-streaming inputs polling can be used to simulate real-time streaming.
- --poll-window arg¶
Time window in seconds to be used with polling.
- --poll-interval arg¶
Time interval in seconds used for polling.
- --poll-serial¶
Will request each channel seperately rather all channels in one request.