Waveform Data
Waveforms in the GeoNet CWB (Common Waveform Buffer) data repository can be accessed using a Java client on your computer. The client processes these data on your computer and produces files in MiniSEED, SAC or plain text formats.
Runtime environment for the CWB client
Your computer requires a Sun Java Runtime Environment (JRE) version 1.5 or higher. You can use ‘java -version’ to check the installed version or get the latest from the Java website.
Installation of the CWB client
Current version: 2.2.4 - last updated 8 August 2011
Save the GeoNetCWBQuery client to your computer.
Network connections to the CWB client
The client makes out-going TCP connections to:
- cwb.geonet.org.nz on port 2061 for waveform data
- cwb.geonet.org.nz on port 2052 for the station metadata
You will need to ensure that your firewall permits connections to these ports.
Using the CWB client
Note: All date and times are UTC (GMT).
Output formats
Output from the CWB client can be in MiniSEED, SAC or plain text formats:
- The Standard for the Exchange of Earthquake Data (SEED) is an international standard format for the exchange of digital seismological data. MiniSEED files are data-only SEED volumes. A description of the
MiniSEED format is available from
IRIS or you can download the full manual (PDF, 8.7 Mb). Tools for
reading SEED volumes, enabling conversion of SEED to SAC (binary or ASCII), AH, SEGY, CSS, MiniSEED or SEED are also available from IRIS.
-
Full Seed Manual (8.68Mb)
-
- Seismic Analysis Code (SAC) is a general purpose interactive program designed for the study of sequential signals, especially timeseries data. A description of the software and information on how to obtain it are available from IRIS.
- Plain text output shows the time of the data reading in epoch milliseconds since 1 January 1970, a space, and then the data value.
Client switches (options)
The complete list of switches may be viewed after downloading the jar. Print the usage message using the command:
java -jar GeoNetCWBQuery-2.2.4-bin.jar
SEED channel naming codes
The '-s' switch includes a channel naming specification of 3 characters. Please read IRIS's excellent summary of channel codes and their explanation. The examples below feature the more commonly-used channel codes used by GeoNet data streams.
Seismic data stream codes
- HH*, BH*: broadband instruments
- EH*, SH*: short-period instruments
- HN*, BN*: strong-motion (accelerometer) instruments
Tsunami data stream codes
- BTZ: 10 Hz (ten samples/second), raw counts
- BTH: 10 Hz, relative height, millimetres * 10
- BTT: 10 Hz, de-tided relative height, millimetres * 10; limited to latest six months
- LTZ: 1 Hz (one sample/second), raw counts
- LTH: 1 Hz, relative height, millimetres * 10
- LTT: 1 Hz, de-tided relative height, millimetres * 10; limited to latest six months
Instrument response files
Instrument responses are available via FTP:
Stream name specification
The query tool needs to know the data stream as a SEED name in network-station-channel-location (NSCL) order. An example of a full NSCL is ‘NZAPZ..LHN00’. The NSCL is fixed length with each sub-field left justified (and blank padded).
Note: With many GeoNet stations having 3 character codes, when specifying the station part of the NNSSSSSCCCLL string you must right pad with 2 fullstops ‘..’ if you then go on to specify channel or location information.
The fullstop ‘.’ matches any character; the NSCL string is automatically right padded with ‘.’:
- For example, -s "NZA" would return all NZ stations starting with A (eg., ABAZ, ALRZ, APZ, AUCT)
The string ‘[ABC]’ means one character which is A or B or C:
- For example, -s "NZAPZ..LH[ZN].." returns the vertical and north component for LH channels at station(s) starting with APZ.
The argument for a NSCL can shortened and will select all channels matching the portion given:
- For example, -s "NZAPZ..L" would match all channels starting with L for all location codes.
The expression ‘.*’ means match zero or more of any characters following. The query tool adds this expression to the end of any incomplete NSCL string:
- For example, -s "NZ…..L[HN]Z.*" matches everything in the NZ network for LHZ and LNZ with any location code.
The pipe ‘|’ can be used to create "logical or" between multiple regular expressions:
- For example, -s "NZA.*|NZB.*" returns any data from stations beginning with A or B on the NZ network.
Event specification and picks
The hypocentre event-ID may be specified to the client, and picks, both manual ('m', picked by a human) and automatic ('a', picked by an algorithm), will be placed into the SAC headers. Picks that have not been used in the calculation of the hypocentre will have a status of 'r', so will display as 'P mr' or 'P ar', say.
java -jar GeoNetCWBQuery-2.2.4-bin.jar -event geonet:3272673
It is also possible to use the event-ID to extract data for an event but not write the picks into the SAC header by using '-nopicks':
java -jar GeoNetCWBQuery-2.2.4-bin.jar -event geonet:3272673 -nopicks
Location specification and synthetic picks
The event origin details may be added on the command line. This allows extraction of GeoNet data for global events, e.g.:
java -jar GeoNetCWBQuery-2.2.4-bin.jar -s "NZ.....HH..." -d 3600 -event:time "2008/07/05 02:12:05" -event:lat "53.88" -event:lon "152.89" -event:depth "632"
Note: Depth is in kilometres. All times can be optionally defined to msec accuracy using .SSS in the time string.
Synthetic phases
Manual setting of of the event is probably of most interest when combined with the addition of calculated phases into the SAC header.
We have used TauP to calculate arrival times for phases in the standard 1-D velocity models (iasp91, PREM, ak135). The calculation is made per channel and uses the metadata in the header for station location, event location and channel orientation to determine which class of phases to calculate. Consequently this won't work with the '-nometa' option, if the metadata server is down, nor if the metadata for a station is incomplete.
Use '-synthetic' to add phases calculated on iasp91. To calculate on ak135 or PREM use '-synthetic:ak135' or '-synthetic:prem'.
By default a basic set of phases is calculated; this can be extended using '-extended-phases'.
Phase Groups
- Vertical components are: p, P, Pn, Pdiff, PKP, PKiKP, PKIKP
- Vertical components extended: p, P, Pn, Pdiff, PKP, PKiKP, PKIKP, PcP, pP, pPdiff, pPKP, pPKIKP, pPKiKP, sP, sPdiff, sPKP, sPKIKP, sPKiKP
- Horizontal components: s, S, Sn, Sdiff, SKS, SKIKS
- Horizontal components extended: s, S, Sn, Sdiff, SKS, SKIKS, sS, sSdiff, sSKS, sSKIKS, ScS, pS, pSdiff, pSKS, pSKIKS
If the component orientation can't be determined but the other metadata are present then a basic set of P and S phases is added.
The phases in the SAC header are labeled with their name. The name of the velocity model that the arrival times are calculated on is written into the SAC header field KUSER0.
So to add extended synthetic phases to the above event selection on the iasp91 model use:
java -jar GeoNetCWBQuery-2.2.4-bin.jar -s "NZ.....HH..." -d 3600 -event:time "2008/07/05 02:12:05" -event:lat '53.88' -event:lon '152.89' -event:depth '632' -synthetic -extended-phases
and then to replicate the accompanying plot:
SAC> r NZCTZ__HHN10.sac NZCTZ__HHE10.sac
SAC> rotate
SAC> r more NZCTZ__HHZ10.sac
SAC> qdp off
SAC> ylim -100000 100000
SAC> xlim 1300 1800
SAC> p1
It is also possible to add synthetic picks to events specified using '-event geonet:#' and to add only synthetic picks by using '-nopicks' but given that the velocity models are 1-D global ones this may not be useful.
Performance
Users may need to set a higher upper limit on the memory available to the JVM running the client. The value for this depends on the environment and query size:
java -Xmx128M (or more) -jar ...
If processing speed is the main concern, and memory availability well understood, then it is worth letting the JVM assign the memory on start up so that it doesn't have to pause to grow the heap during processing:
java -Xmx128M -Xms128M -jar...
Further CWB client examples
Download 1800 seconds of all HH components for the "Dusky Sound" event into the default SAC format (with the ‘_’s removed from the file name):
java -jar GeoNetCWBQuery-2.2.4-bin.jar -b "2009/07/15 09:10:00" -s "NZ.....HH" -d 1800 -o %z%y%M%D%h%m.%s.%c.%l.%n.sac
Download one day of tsunami gauge data in text format for the "Dusky Sound" event:
java -jar GeoNetCWBQuery-2.2.4-bin.jar -t text -b "2009/07/15 09:10:00" -s "NZ.....BTZ" -d 1d -o %z%y%M%D%h%m.%s.%c.%l.%n.txt
Download one day's worth of L band channel data in MiniSEED format:
java -jar GeoNetCWBQuery-2.2.4-bin.jar -d 1d -b "2008,001 00:00:00" -s ".......L.[ENZ].." -t ms
A simple Unix shell script to fetch the client, download some data, and remove the client could be like:
#!/bin/sh
wget http://codegeo.org/archiva/repository/publish/nz/org/geonet/GeoNetCWBQuery/2.2.4/GeoNetCWBQuery-2.2.4-bin.jar
java -jar GeoNetCWBQuery-2.2.4-bin.jar -t sac -b "2009/07/15 09:10:00" -s "NZ.....HH" -d 1800 -o %z%y%M%D%h%m.%s.%c.%l.%n.sac
rm GeoNetCWBQuery-2.2.4-bin.jar
Feedback on the CWB client
Please use the Contact Us page to report any issues, bugs or documentation deficiencies with the CWB client. Include as much information as you can to assist with our response.

