capstool¶
CAPS command-line interface (CLI) client.
Description¶
capstool is a CAPS client application for retrieving data and listing available streams from a CAPS server.
Input¶
The program reads requests from file or from standard input if no file is specified. The request format is defined as follows:
YYYY,MM,DD,HH,MM,SS YYYY,MM,DD,HH,MM,SS Network Station [Location] Channel
Each request line contains a start and an end time followed by a stream id. The fields Network, Station, Channel and Location support wild cards (*). The latter one is optional. For matching all locations please use the ‘*’ symbol, if empty it assumes that only empty locations are being requested.
Note
The request lines can be generated for a particular event using scevtstreams as of the SeisComP3 release Jakarta-2018.xxx.
Example:
2010,02,18,12,00,00 2010,02,18,12,10,00 GE WLF BH*
2010,02,18,12,00,00 2010,02,18,12,10,00 GE VSU 00 BH*
Output¶
The output format differs by record type. Here is an overview of the available formats:
Record type |
Output data format |
RAW |
ASCII SLIST |
MSEED |
MSEED |
ANY |
Stored data format |
Note
When retrieving miniSEED data the records are not necessarily sorted by time. However, sorting by time is required, e.g. for processing in playbacks. Use scmssort for sorting the records by time, e.g.
scmssort -E -u [input file] > [sorted output file]
Examples¶
List available streams
> capstool -H localhost:18002 -Q
Connect via secure socket layer (SSL) and supply credentials for authentication.
> capstool -H localhost:18002 -s -c user:password -Q
Request file to load miniSEED data for some GE stations:
2010,02,18,12,00,00 2010,02,18,12,10,00 GE WLF BH*
2010,02,18,12,00,00 2010,02,18,12,10,00 GE VSU BH*
Submit the request in req.txt to the CAPS server, and download miniSEED data to req.mseed.
> capstool -H localhost:18002 -o req.mseed req.txt
Request miniSEED data from a CAPS server. Provide input from standard input. Write the miniSEED data to standard output. Re-direct the output and append it to a file, e.g. data.mseed.
> echo "2015,11,08,10,47,00 2015,11,08,11,00,00 * * BH?" |\
seiscomp exec capstool -H localhost:18002 >> data.mseed
Request miniSEED data from a CAPS server for a particular event with ID <eventID>. Provide the request file using scevtstreams Write the miniSEED data to standard output. Re-direct the output to a file, e.g. <eventID>.mseed.
> scevtstreams -d mysql://sysop:sysop@localhost/seiscomp -E <eventID> --caps > req.txt
> seiscomp exec capstool -H localhost:18002 req.txt > <eventID>.mseed
Request file to load Video data for Station HILO:
2013,08,01,00,00,00 2013,08,01,00,30,00 VZ HILO WLS CAM
2013,08,01,00,00,00 2013,08,01,00,30,00 VZ HILO WLS CAM
Submit the request in req.txt to the CAPS server, and download the video data to files using the given pattern:
> capstool -H localhost:18002 -o "%H%M%S.%f" req.txt
Command-Line Options¶
capstool [options]
-
-h
,
--help
¶
show a help message and exit
-
-H
,
--host
¶
host to connect to (Default is localhost:18002)
-
-Q
¶
print formatted stream list and exit
-
--rt
¶
enable real time mode
-
-o
,
--output-file
¶
output file for downloaded data. The filename may contain the following format controls: %Y - year, %j - day of year, %H - hour, %M - minute, %S - second, %F - format. Format control currently works for data in format ‘ANY’, not MSEED’.
-
--ping
¶
ping host and exit