libdata-strong-motion  1.0.1
Macros | Enumerations | Functions
Tag interpretation.

Macros

#define STRONG_MOTION_HORIZONTAL_RESULTANT   'h'
 Special component: 2D (horizontal) resultant.
 
#define STRONG_MOTION_3D_RESULTANT   'a'
 Special component: 3D resultant.
 

Enumerations

enum  strong_motion_tag_t {
  strong_motion_tag_windowed_mma, strong_motion_tag_pga, strong_motion_tag_rms, strong_motion_tag_correlation,
  strong_motion_tag_si
}
 Tag type. More...
 
enum  strong_motion_inst_t { strong_motion_inst_0, strong_motion_inst_1, strong_motion_inst_both }
 Source instrument. More...
 

Functions

int strong_motion_read_tag (const char *st, enum strong_motion_tag_t *type, enum strong_motion_inst_t *inst, char *component, int *nwords)
 Interpret a 32-bit strong motion packet tag. More...
 

Detailed Description

Strong motion blocks contain tagged packets. Each packet has a 32-bit tag which gives details of the packet type, the component or components it is from, and the number of data words. This mechanism allows for forward compatibility and allows unknown packets to be skipped.

Enumeration Type Documentation

Tag type.

Enumerator
strong_motion_tag_windowed_mma 

Windowed minimum, maximum and average.

strong_motion_tag_pga 

Peak ground acceleration.

strong_motion_tag_rms 

Root mean square.

strong_motion_tag_correlation 

Cross-correlation.

strong_motion_tag_si 

Spectral intensity.

Source instrument.

Enumerator
strong_motion_inst_0 

Instrument 0.

strong_motion_inst_1 

Instrument 1.

strong_motion_inst_both 

Both instruments (i.e. cross-correlation).

Function Documentation

int strong_motion_read_tag ( const char *  st,
enum strong_motion_tag_t type,
enum strong_motion_inst_t inst,
char *  component,
int *  nwords 
)

Interpret a 32-bit strong motion packet tag.

Parameters
stStrong motion packet data.
[out]typePacket type represented by the tag is written here. May be 0.
[out]instWhich instrument the result comes from is written here. May be 0.
[out]componentWhich component the result comes from is written here, as a single character. May be 0.
[out]nwordsNumber of data words is written here.
Return values
0on success.
-1on error (but nwords still valid).

Interprets a 32-bit tag at st, writing the results into type, inst, component and nwords (if they are not 0), returning 0 on success or -1 on error.

An error will occur if the tag type or component code is unrecognised, or if the tag type is recognised but the number of data words is not what is expected. In this case, the correct value will nevertheless be written to nwords (if it is not null). This allows unrecognised tags to be skipped.

The component code will only be set if inst is not strong_motion_inst_both. It is a pointer to a single character, which will be set to '0'–'9' or 'A'–'Z' for the corresponding digitiser component (usually 'Z'/'N'/'E'), or to the special values 'h' or 'a' (STRONG_MOTION_HORIZONTAL_RESULTANT and STRONG_MOTION_3D_RESULTANT respectively) for resolved values.