Synopsis
datalinkclient [-vV] [--help] [-h=<host>] [-m=<match>] [--max=<maxRecords>] [-o=<outputFile>] [-p=<port>] [--timeout=<timeoutSec>]
Description
Datalinkclient is an example client that can connect to a datalink service and stream miniseed to a file. View source code here.
The datalink protocol is specified here:
Options
- -h, --host=<host>
-
host to connect to, defaults to IRIS, rtserve.iris.washington.edu
- --help
-
display a help message
- -m, --match=<match>
-
match pattern, as a regular expression. For miniseed the conventions is NN_SSS_LL_CCC/MSEED
- --max=<maxRecords>
-
number of packets to receive before ending the connection, defaults to 10
- -o, --out=<outputFile>
-
Output file (default: print to console)
- -p, --port=<port>
-
port to connect to, defaults to IRIS, 18000
- --timeout=<timeoutSec>
-
timeout seconds, defaults to 120
- -v, --verbose
-
Verbose
- -V, --version
-
Print version and exit
Examples
Ask for a few packets of HH. data from station CO.BIRD, and output to a file.
> datalinkclient -m CO_BIRD_00_HH./MSEED --max 3 -o bird.mseed -v
initConnection to rtserve.iris.washington.edu:18000
Connection made
sendId
send 'ID seisFile:unknown:42:java | '
not bytes available 0
readPacket
readPacket(): blocking read for 3 bytes, available=53
Server ID: ID DataLink 2018.078 :: DLPROTO:1.0 PACKETSIZE:512
send 'MATCH | CO_BIRD_00_HH./MSEED'
send 'STREAM | '
readPacket(): blocking read for 3 bytes, available=0
Response: OK
readPacket(): blocking read for 3 bytes, available=0
D CO.BIRD.00.HHZ 2023,038,17:31:07.0900 3.47 347
readPacket(): blocking read for 3 bytes, available=5454
D CO.BIRD.00.HHZ 2023,038,17:31:10.5600 3.47 347
send 'ENDSTREAM | '
readPacket(): blocking read for 3 bytes, available=4848
D CO.BIRD.00.HHZ 2023,038,17:31:14.0300 3.39 339
readPacket(): blocking read for 3 bytes, available=4242
D CO.BIRD.00.HHZ 2023,038,17:31:17.4200 3.34 334
readPacket(): blocking read for 3 bytes, available=3636
D CO.BIRD.00.HHZ 2023,038,17:31:20.7600 3.39 339
readPacket(): blocking read for 3 bytes, available=3030
D CO.BIRD.00.HHZ 2023,038,17:31:24.1500 3.3 330
readPacket(): blocking read for 3 bytes, available=2424
D CO.BIRD.00.HHZ 2023,038,17:31:27.4500 3.43 343
readPacket(): blocking read for 3 bytes, available=1818
D CO.BIRD.00.HHZ 2023,038,17:31:30.8800 3.57 357
readPacket(): blocking read for 3 bytes, available=1212
D CO.BIRD.00.HHZ 2023,038,17:31:34.4500 3.4 340
readPacket(): blocking read for 3 bytes, available=606
D CO.BIRD.00.HHZ 2023,038,17:31:37.8500 3.48 348
readPacket(): blocking read for 3 bytes, available=0