scart¶
Import/export MiniSEED data to/from SDS archives.
Description¶
The archive tool scart reads and writes SDS archives and files in miniSEED format and checks miniSEED archives or prints stream information.
Dump mode: Create miniSEED files (multiplexed), e.g. for playbacks, from SDS structured data (e.g. created by slarchive) or from data passed from another record source such as Arclink.
Dump mode: Play back records directly out of an SDS structure.
Import mode: Import multiplexed miniSEED files into a local SDS waveform archive.
Check mode: Check an archive of miniSEED files for out-of-order records in files.
Warning
When creating SDS archives, scart simply appends the new records to existing ones. Multiple imports of the same data result in duplication.
Out-of-order imports of waveforms into a SDS archive result in out-of-order records which may not be processed. Clean your archive using scmssort.
The new input data for an SDS archive must be sorted by time. Otherwise, the SDS archive may not be correctly readable. Combine scart with scmssort for multiplexing and removal of duplicates.
Hint
In dump mode output streams may be controlled by
Time window - stream lists (
--list
, dump mode) generated by scevtstreams for particular eventsNSLC lists (
--nslc
) created, e.g., with scinv from inventories.
Configuration¶
scart can make use of RecordStream
implementations which are provided by additional plugins.
For loading additional plugins, e.g. the xyz plugin create and configure scart.cfg
:
plugins = xyz
Examples¶
Extract data from the default SDS archive in
$SEISCOMP_ROOT/var/lib/archive
or from a local SDS archive [SDS archive] into a miniSEED filefile.mseed
and sort by end time of the records:scart -dsvE -t '[start-time]~[end-time]' > file.mseed scart -dsvE -t '[start-time]~[end-time]' [SDS archive] > [file.mseed]
Note
Sorting data is computational expensive but required for waveform playbacks.
Push miniSEED data from file
file.mseed
into a local SDS archive. Additionally, you may check if the records of the created files are correctly ordered:scart -I [file.mseed] [SDS archive] scart -I [file.mseed] --with-filecheck [SDS archive]
Collect data from an FDSNWS server using the RecordStream interface and write to a miniSEED file. The data streams and the time spans are defined in a list file using the option
list
. The list can be generated e.g. by scevtstreams.scart -I fdsnws://[server]:80 --list list.file --stdout > file.mseed
Check all files of an SDS archive or other directory structure for miniSEED files with out-of-order records:
scart --check [archive]
Print stream information from miniSEED files in archives or from RecordStream without actually writing miniSEED data:
scart -I [miniSEED file] --print-streams scart -d -t [time span] [SDS archive] --print-streams scart --check [archive] --print-streams
The output looks like this:
# streamID start end records samples samplingRate GE.RGN..BHZ 2022-12-08T15:34:41.895Z 2022-12-08T15:52:19.145Z 58 21145 20.0
where the header and the text body are printed to stdout.
Command-Line Options¶
scart [options] {archive-dir}
The last option has to be the archive directory when dump mode is enabled. When no archive directory is explicitly given, $SEISCOMP_ROOT/var/lib/archive or the current directory is used depending on whether $SEISCOMP_ROOT has been set or not. The default operation mode is import. That means that a multiplexed MiniSEED file or another record source such as ArcLink is used to import records into a SDS structure.
Mode¶
-
--check
¶
Check mode. Check all files in the given directory for erroneous miniSEED records. All sub-directories are included. If no directory is given, the default SDS archive is scanned.
-
-d
,
--dump
¶
Set export (dump) mode. Records are retrieved from an archive and written to standard output.
Output¶
-
-c
channels
¶ Specify the channel filter for the dumped streams as regular expression. Default: (B|S|M|H)(L|H)(Z|N|E). To dump only BHZ, BHN and BHE streams use BH(Z|N|E).
-
-E
¶
Sort records according to their end time. Default: start time.
-
--files
count
¶ Specify the number of file handles to cache. Default: 100.
-
-l
,
--list
file
¶ Uses a stream list file instead of defined networks and channels (-n and -c are ignored). The list can be generated from events by scevetstreams. One line per stream. Line format: starttime;endtime;streamID. The time format is the same as described in option ‘-t’.
Example:
2019-07-17 02:00:00;2019-07-17 02:10:00;GR.CLL..BH?
-
--nslc
file
¶ Uses a stream list file instead of defined networks and channels (-n and -c are ignored). In dump mode only. The time window must be provided separately. Wild cards may be used. The list can be generated from bindings by scdumpcfg or from inventory by scinv. Use one line per stream. Line format: NET.STA.LOC.CHA.
Example:
GR.CLL..BH?
-
-m
,
--modify
¶
Modify the record time for real time playback when in export mode. The first record time is NOW. The relative time of successive records to the first one are kept.
-
-n
networks
¶ List of network codes to dump (comma separated). Default: *.
-
-s
,
--sort
¶
Sort records by [start-]time. To sort records by their endtime use -E.
-
--speed
¶
Specify the speed to dump the records. A value of 0 means no delay otherwise speed is a multiplier of the real time difference between the records. When feeding the records directly into the replay pipe a value of 1 (real time) is recommended.
-
--stdout
¶
Write to stdout if import mode is used instead of creating a SDS archive.
-
--print-streams
¶
Print stream information only and exit. Works in import, dump and check mode. Output: NET.STA.LOC.CHA StartTime EndTime.
-
--test
¶
Test only, no record output. This switch is useful for debugging.
-
-t
timeWindow
¶ Specify the time window (as one properly quoted string) to dump records for. Times are UTC and separated by a tilde “~”. To dump one hour of waveform data between 2008/01/01 00:00:00 and 2008/01/01 01:00:00 use <-t “2008-01-01 00:00:00~2008-01-01 01:00:00”>.
-
--with-filecheck
¶
Check all accessed files after import. Unsorted or unreadable files are reported to stderr.
-
--with-filename
¶
Print all accessed files to stdout after import.