# msrtsimul — SeisComP Release documentation

6.9.0

# msrtsimul

MiniSEED real time playback and simulation

## Description

msrtsimul simulates a real-time data acquisition by injecting miniSEED data from a file into the seedlink buffer via the mseedfifo plugin for seedlink. It can be used for simulating real-time conditions in playbacks for whole-system demonstrations, user training, etc.

The data is played back as if they were recorded at current time. Therefore, creation times and the actual data times including pick times, event times etc. will be obscured. Historic playbacks allow keeping the actual data times.

Hint

- Playbacks on production systems are normally not recommended.

- For real-time playbacks, the data must be sorted by end time. This requirement may be violated. Use scmssort for sorting the data by (end) time.

- Stop slarchive before running msrtsimul for avoiding that data with wrong times are archived.

- Normally, seedlink assumes that the data is provided in records of 512 bytes. msrtsimul issues a warning when detecting a record of other size.

- Data available in other record sizes can be repacked to 512 bytes by external software such as msrepack available with libmseed - The miniSEED data format library [32].

- Applications other than standard seedlink in SeisComP or seedlink compiled specifically may accept other record sizes. For accepting these records use msrtsimul with `--unlimited`.

### Non-default seedlink pipes

By default, msrtsimul writes the data into the mseedfifo pipe $SEISCOMP_ROOT/var/run/seedlink/mseedfifo. If the data is to be written into the pipe of a seedlink alias or into any other pipe, the pipe name must be adjusted. Use the option

- `--seedlink` to replace seedlink by another name, e.g. a seedlink instance created as an alias, seedlink-test. This would write into $SEISCOMP_ROOT/var/run/seedlink-test/mseedfifo.

- `--stdout` to write to standard output and then redirect to any other location.

### Historic playbacks

You may use msrtsimul with the `-m` historic option to maintain the time of the records, thus the times of picks, amplitudes, origins, etc. but not the creation times. Applying `-m` historic will feed the data into the seedlink buffer at the time of the records. The time of the system is untouched. GUI, processing modules, logging, etc. will run with current system time. The historic mode allows to process waveforms with the stream inventory valid at the time when the data were recorded including streams closed at current time.

Warning

When repeating historic playbacks, the waveforms are fed multiple times to the seedlink buffer and the resulting picks are also repeated with the same pick times. This may confuse the real-time system. Therefore, seedlink and other modules creating or processing picks should be stopped, the seedlink buffer should be cleared and the processing modules should be restarted to clear the buffers before starting the historic playbacks. Make sure scautopick is configured or started with the `--playback` option. Example:

    seiscomp stop
    rm -rf $SEISCOMP_ROOT/var/lib/seedlink/buffer
    seiscomp start
    msrtsimul ...

### seedlink setup

For supporting msrtsimul activate the `msrtsimul` parameter in the seedlink module configuration (`seedlink.cfg`), update the configuration and restart seedlink before running msrtsimul:

    seiscomp update-config seedlink
    seiscomp restart seedlink
    msrtsimul ...

### Examples

1. Playback miniSEED waveforms in real time with verbose output:

       $ msrtsimul -v miniSEED-file

2. Playback miniSEED waveforms in historic mode. This may require scautopick to be started with the option playback:

       msrtsimul -v -m historic miniSEED-file

3. Feed the data into the buffer of a specific seedlink instance, e.g. seedlink-test:

       msrtsimul -v --seedlink seedlink-test miniSEED-file

## Module Configuration

`etc/defaults/global.cfg`
`etc/defaults/msrtsimul.cfg`
`etc/global.cfg`
`etc/msrtsimul.cfg`
`~/.seiscomp/global.cfg`
`~/.seiscomp/msrtsimul.cfg`

msrtsimul inherits global options.

## Command-Line Options

msrtsimul [OPTION] miniSEED-file

### Verbosity

-h, --help

  Display this help message.

-v, --verbose

  Verbose mode.

### Playback

-c, --stdout

  Write on standard output. The output my be redirected to a specific mseedfifo path.

-d, --delays

  Add artificial delays.

-j, --jump float

  Minutes to skip at the beginning.

-m, --mode string

  Playback mode: choose between ‘realtime’ and ‘historic’

--seedlink string

  The seedlink module name. Useful if a seedlink alias or non-standard names are used. Replaces ‘seedlink’ in the standard mseedfifo path.

-s, --speed float

  Speed factor. 1 is normal speed.

--test

  Test mode.

-u, --unlimited

  Allow miniSEED records which are not 512 bytes.