## Continuous Waveform Buffer

Seismic, acoustic and tsunami time series data may be retrieved from GeoNet's Continuous Waveform Buffer. The data are recorded by seismometers, microphones and pressure sensors since digital recording in New Zealand commenced in September 1986.

### Access

Waveforms in the GeoNet CWB (Continuous 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.

Current client version: 4.2.0 - last updated 5 March 2014

This release adds to the ability to refer to all quakes via the event flag using an earthquake's Public Id by now including picks in SAC files.

Note: Please limit your use to one connection at a time (per source IP address). If you require data from multiple stations you can collapse them into a single request or at least a single connection. Another alternative is to try our FDSN webservice

For example:

java -jar GeoNetCWBQuery-4.2.0-bin.jar -event geonet:2014p139747


or:

java -jar GeoNetCWBQuery-4.2.0-bin.jar -event geonet:3272673

##### Runtime environment for CWB client

Your computer requires an Oracle 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 CWB client

Save the GeoNetCWBQuery client to your computer.

##### Network connections to 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 CWB

Note: All date and times are in Co-ordinated Universal Time (UTC).

### Client switches (options)

Some of the more common switches are described below, and the examples on this page will help with understanding their usage and effect. The complete list of switches may be viewed after downloading the jar. Print the usage message using the command:

java -jar GeoNetCWBQuery-4.2.0-bin.jar


#### -t : output formats

Output from the CWB client can be in MiniSEED, SAC or plain text formats:

• ms : MiniSEED files are data-only SEED volumes. The Standard for the Exchange of Earthquake Data (SEED) is an international standard format for the exchange of digital seismological data. A description of the MiniSEED format is available from IRIS or you can download the full manual (PDF, 4.3 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.
• sac (default) : Seismic Analysis Code (SAC) is a general purpose interactive program designed for the study of sequential signals, especially time series data. A description of the software and information on how to obtain it are available from IRIS.
• text : Plain text output shows the time of the data reading in epoch milliseconds since 1 January 1970, a space, and then the data value.

#### -s : stream name specification

To specify particular data streams, the query tool needs to know the stream in network-station-channel-location (NSCL) order, using the format NNSSSSSCCCLL. An example of a full NSCL is NZAPZ..LHN00. The NSCL is fixed length with each sub-field left justified (and blank padded).

The fullstop ‘.’ matches any character; the NSCL string is automatically right padded with ‘.’:

• For example, -s "NZA" would return all NZ network 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.
##### NN : network code

All GeoNet-operated stations have the code NZ.

##### SSSSS : station code

The seismograph station code, which allows up to five characters.

With GeoNet stations having either 3 or 4 character codes, when specifying the station part of the NSCL string you must right pad with 2 (..) or 1 (.) fullstops respectively if you then go on to specify channel or location information.

##### CCC : SEED channel code

The channel naming specification of 3 characters. Please read Appendix A of the SEED Manual for more detail. The examples below feature the more commonly-used channel codes used by GeoNet data streams.

Seismic data stream codes

• 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
##### LL : location code

GeoNet typically uses 10 for short-period and broadband instruments, and 20 for accelerometers. The definitive list of location codes (also known as site codes) may be viewed by querying the DELTA database.

#### -event : event specification

##### by Public Id

The hypocentre Public 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-4.2.0-bin.jar -event geonet:3272673


It is also possible to use the Public Id to extract data for an event but not write the picks into the SAC header by using -nopicks:

java -jar GeoNetCWBQuery-4.2.0-bin.jar -event geonet:3272673 -nopicks

##### by location specification

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-4.2.0-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"


Depth is in kilometres. All times can be optionally defined to msec accuracy using .SSS in the time string.

#### -synthetic : 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. Use -synthetic to add phases calculated on iasp91. To calculate on ak135 or PREM use -synthetic:ak135 or -synthetic:prem.

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.

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-4.2.0-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 NZCTZHHN10.sac NZCTZHHE10.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.

### Further 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-4.2.0-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 2009" event:

java -jar GeoNetCWBQuery-4.2.0-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-4.2.0-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 https://static.geonet.org.nz/cwb/GeoNetCWBQuery-4.2.0-bin.jar
java -jar GeoNetCWBQuery-4.2.0-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-4.2.0-bin.jar


## Instrument response files

Instrument responses are available via FTP:

## 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...