orbwfmeas - make waveform measurments from an ORB
orbwfmeas [-select_wf expr] [-start {pktid|time|OLDEST|NEWEST}]
[-number number] [-nowait] [-state statefile]
[-p parameter_file] [-dbsift_expr dbsift_expr]
{detection|arrival} orbwf orbdb dbname
orbwfmeas is a program that continuously looks for either
/db/detection or /db/arrival
packets on an ORB and computes various waveform measurements whenever a packet
is read. The waveform measurements are normally written back to the ORB as
/db/wfmeas packets.
-
-select_wf expr
ORB select expression for waveforms. This argument is optional.
If this is not specified, then no waveform selection will be
done.
-
-start {pktid|time|OLDEST|NEWEST}
Where to start in the ORB that contains the detection/arrival packets.
This argument is optional.
If this is not specified, then the start will be at the
next newest packet.
-
-number number
How many detection/arrival pakets to process. This argument is optional.
If this is not specified, then there will be no limit on
the number of detection/arrival packets processed.
-
-nowait
If this is specified, then orbwfmeas will exit when
the ORB read pointer gets to the most recent packet. If
not specifed, then orbwfmeas will wait for new packets
to arrive indefinitely.
-
-state statefile
A file for storing start/stop state information.
This argument is optional.
-
-p parameter_file
Name of program parameter file. This argument is optional.
The actual parameter file name is parameter_file.pf.
The default value of parameter_file is orbwfmeas.
-
-dbsift_expr dbsift_expr
A Datascope expression that is applied as a sifter to the input
arrival/detection database rows. Only packets which pass this
expression will be processed. If not specified, then all
packets will be processed.
-
detection|arrival
This must be specified as either detection or arrival
and specifies whether /db/detection or /db/arrival
input packets are to be used to trigger the waveform processing.
The SEED net_sta_chan[_loc] codes for identifying the associated
waveform packets are determined using the foreign keys tables,
snetsta and schanloc, from the input database row packet CSS3.0 station
and channel codes.
Waveform processing time windows are anchored by the time fields
in the input data packets. For detection packets, only packets with
the state field corresponding to pick times are used.
-
orbwf
The input orb that will contain all of the waveform data.
This argument is required.
-
orbdb
The input/output orb that will contain all of the database rows.
/db/detection or /db/arrival packets are read and output database
packets are written, usually /db/wfmeas.
This argument is required.
-
dbname
The name of the database that contains calib and instrument
information. This database must also contain the foreign keys tables.
The tables used are sensor,
instrument, calibration, snetsta and schanloc.
The orbwfmeas parameter file contains information that
defines the particular measurements to be made.
Currently there are six recognized measurement types;
-
peak
for making peak waveform amplitude measurements
-
peaka
for making peak ground acceleration measurements
-
peakv
for making peak ground velocity measurements
-
peakd
for making peak ground displacement measurements
-
peakwa
for making peak equivalent Wood-Anderson measurements
An example orbwfmeas parameter file is as follows:
#
# orbwfmeas.pf contains the parameters for making waveform
# measurements
#
global_defaults &Arr{
remove_mean yes # Remove mean from waveform data
# after filtering before making
# measurements
use_det_filter yes # Use filter parameters from input
# detection packets instead of
# from this parameter file
latency 20.0 # Maximum allowed waveform data packet
# latency in seconds. If there are
# gaps in the requested waveform time
# window, then will continue reading
# waveform packets until the time
# is greater than latency seconds
# past the end of the requested time
# window in order to fill the gaps.
timeout 120.0 # Maximum wall-clock time in seconds
# to wait for waveform data packets.
ptype single # This determoines how multi-channel
# processing is done:
# single - Process and output each
# channel independently
# biggest - Process all channels and
# output only the largest or best
# value from all of the channels
# vector - Process only the absolute vector
# amplitude composed from the
# individual channels
calib_from_calibration no # Should calib values come
# from the database calibration
# table (yes) or directly from
# the data ORB packets (no)?
}
measurements &Tbl{
&Arr{
type peakd # peak displacement measurements
tlead 10.0 # lead time window in seconds
tlag 10.0 # lag time window in seconds
tpad 10.0 # time pad in seconds to remove
# filter transients
use_det_filter yes # Use filter parameters from input
# detection packets
filter BW 1. 5 0 0 # pre-filter, used only if use_det_filter
# is set to no
channels &Tbl{ # channels to process
# sta_expr chan_expr [wfchan_expr]
.* HL.
&Arr{ # over-ride filter parameter for
# sta AZ_PFO
sta_expr AZ_PFO
chan_expr .*
filter BW 0.1 5 0 0
}
}
&Arr{
type peakv # peak ground velocity measurement
lead 10.0 # lead time window in seconds
lag 20.0 # lag time window in seconds
pad 10.0 # time pad in seconds to remove
# filter transients
ptype vector
otype wfmgme # write output to wfgme rows
channels &Tbl{ # channels to process
# sta_expr chan_expr wfchan_expr
.* HGZ HG.
}
}
&Arr{
type peaka # peak ground acceleration measurement
lead 10.0 # lead time window in seconds
lag 20.0 # lag time window in seconds
pad 10.0 # time pad in seconds to remove
# filter transients
ptype vector
otype wfmgme # write output to wfgme rows
channels &Tbl{ # channels to process
# sta_expr chan_expr wfchan_expr
.* HGZ HG.
}
}
&Arr{
type peakwa # peak Wood-Anderson measurement
lead 10.0 # lead time window in seconds
lag 20.0 # lag time window in seconds
pad 10.0 # time pad in seconds to remove
# filter transients
ptype biggest
otype wfmgme_flush # write output to wfgme rows and flush
channels &Tbl{ # channels to process
# sta_expr chan_expr wfchan_expr
.* HGZ HG[NE]
}
}
}
The parameter file is broken into two main sections; the
global_defaults array, which is used to define the
values of parameters to be used as global default values,
and the measurements table, which contains unnamed parameter
arrays corresponding to the different measurements that are
to be made. The particular measurements are made in the order in which they
are specified in the measurements table. Each of the
measurement arrays contain parameters for that measurement
and a table of channels to be processed. Any missing parameters
from a measurement array will be taken from the global
defaults array. Each of the measurement arrays must
contain a type parameter, which defines the measurement
type, and a channels table, which lists the station-channels
to be processed. Each row in the channels table must contain
either a simple character string with two or three fields, the first
a sta expression, the second a chan expression and the third an optional waveform chan expression, or
another unnamed parameter array which must contain at least
a sta_expr parameter and a chan_expr parameter.
These unnamed arrays within the channels table may also
contain any of the other parameters for that measurement type,
and any such parameters over-ride the measurement
parameters for the stations and channels that match that sta_expr
and chan_expr. When input channels match more than one row
in the channels table, then the last row which matches
is used.
peak measurement arrays are used to set up data channels and parameters
for making peak waveform amplitude measurements. The peak measurements
are made in units that are natural to the data, nm/sec for velocity
sensor data, milli-Gs (mg) for acceleration sensor data (where g is defined
to be 9.80665 m/s^2). The sensor
type is obtained either directly from the input waveform data packets
or from the database, as specified through the dbname command
line argument. Peak waveform measurements are made for both a
time window immediately after the detection/arrival time, refered
to as a signal peak value, and for a time window immediately prior to
the detection/arrival time, refered to as a noise peak value.
The signal peak value is written into the val1 field of the
output wfmeas packet and the noise peak value is written into the
val2 field. The time corresponding to the signal peak value
is written into the tmeas field.
The parameters for peak measurements are defined below.
-
sta_expr
-
chan_expr
These are regular UNIX expressions that are matched against the
actual CSS3.0 sta and chan codes in the input detection/arrival packets, as specified in a typical
CSS3.0 arrival database table. If a match occurs for both,
then the data channel is used with the remaining processing parameters.
-
wfchan_expr
This is an optional expression that is matched against the waveform
channels for determining which waveform channels to process. If this is
not specified, then the waveform channel will be set to the same as the
detection/arrival channel.
-
tlead
The time window in seconds immediately prior to the detection/arrival
time that is used to compute a mean value and to determine a noise peak value.
The noise peak value is actually computed only in the first half of this
window in order to avoid spurious signal that may precede the
detection/arrival pick time.
-
tlag
The time window in seconds immediately after the detection/arrival
time that is used to determine a signal peak value.
-
remove_mean
If set to yes (or true or 1) then the waveform mean value
after filtering is removed from the waveform data before
the peak values are measured. The mean value is determined
from the tlead time window.
-
use_det_filter
If set to yes (or true or 1) then the filter field
from the input detection packet is used to specify the
waveform data pre-filter and the filter parameter in this
parameter file is ignored. This parameter is ignored
when input arrival packets are used.
-
latency
Maximum allowed waveform data packet latency in seconds. If there are
gaps in the requested waveform time window, then orbwfmeas will continue reading
waveform packets until the time is greater than latency seconds
past the end of the requested time window in order to fill the gaps.
-
timeout
Maximum wall-clock time in seconds to wait for waveform data packets.
If the timeout expires and the waveform segments have not finished,
then the measurement for that channel will be skipped. This is
needed in order to prevent the program from hanging indefinitely
on a particular channel of data that has gone down for some reason.
-
ptype
this determines how multi-channel processing is performed and should
be one of single, biggest, or vector. If set to single
(the default value), then each channel is processed and the results are output independently.
If set to biggest, then each channel is processed independently, but only the
largest/best resulting measurement is output for the channel that produced the
measurement. If set to vector, then it is assumed that the input channels are
mutually orthogonal and can be reduced into a single vector amplitude trace that is
then used to make the measurement.
-
otype
This is the output type of the output database row used only for the peak measurements. If not specified, then it
defaults to a wfmeas row for each measurement type. If set to wfmgme,
then that particular measurement is added to a wfmgme database row
(see dbgme(1)). The row is accumulated across measurements in a scratch record
until a measurement with otype set to wfmgme_flush which indicates
that the sratch record should be flushed to the output database table and
re-initialized. Note that a single wfmgme row contains peaka, peakv and peakwa
measurements.
-
calib_from_calibration
This should be set to yes or no according to whether or not
the calib, calper and segtype values should be taken from the calibration
and instrument tables instead of directly from the ORB waveform packets. The calib, calper and segtype values
are necessary to determine the type of waveform sensor (velocity, acceleration, etc.) and how to convert waveform count values into
physical units. If this is set to yes, then the calibration, sensor, site and instrument
tables must be populated in the database specified in the dbname command line argument.
-
tpad
This is a time window pad in seconds that is used immediately
prior to the tlead time window for removing the
pre-filter transients.
-
filter
A pre-filter specification. The input waveform data is first
filtered with this filter before mean value and peak value
measurements are made. Note that this parameter is ignored
when the use_det_filter parameter is set to yes and the
input packets are detection packets.
peaka measurements are used to set up data channels and parameters
for making peak ground acceleration measurements. The peak acceleration measurements
are made in milli-Gs (mg) for all sensor types. Data from velocity sensors
are automatically differentiated to convert to acceleration. All other information
and processing are as for the peak measurement type. Note that instrument
deconvolution is not performed here, only simple differentiation.
peakv measurements are used to set up data channels and parameters
for making peak ground velocity measurements. The peak velocity measurements
are made in nm/sec for all sensor types. Data from acceleration sensors
are automatically integrated to convert to velocity. All other information
and processing are as for the peak measurement type. Note that instrument
deconvolution is not performed here, only simple integration.
peakd measurements are used to set up data channels and parameters
for making peak ground displacement measurements. The peak displacement measurements
are made in nm for all sensor types. Data from acceleration sensors
are automatically integrated twice to convert to displacement.
Data from velocity sensors
are automatically integrated once to convert to displacement. All other information
and processing are as for the peak measurement type. Note that instrument
deconvolution is not performed here, only simple integration.
peakwa measurements are used to set up data channels and parameters
for making peak equivalent Wood-Anderson measurements. The peak Wood-Anderson measurements
are made in equivalent mm of Wood-Anderson drum recorder for all sensor types. Data from sensors
are automatically integrated to convert to displacement and then forward filtered
with a Wood-Anderson instrument filter. All other information
and processing are as for the peak measurement type. Note that instrument
deconvolution is not performed here, only simple integration and Wood-Anderson filtering.
Danny Harvey
Boulder Real Time Technologies, Inc.
Table of Contents
Antelope Release 4.7 Linux 2.4.19-4GB 2005-12-21
Boulder Real Time Technologies, Inc
For more information, contact support@brtt.com