A Ground Motion database (gmdb) is a set of seismic records stored in a tabular model as horizontal rows, where the model vertical columns represent each record field.

A selection expression on a gmdb is just a string containing a Python expression that will be evaluated for each record, returning matching rows only (i.e., rows for which the expression is true). The expression involves at least one column, a comparison operator (==, !=, <, <=, >, >=) and any value (or algebraic expression) consistent with the column type. E.g.:

pga <= 0.01
pga != nan             # select records where PGA is not missing
station_name == "ASD"  # note quotes around string-column values

Several simple expressions can be wrapped in parenthesis and combined with logical operators (& for logical and, | for logical or, and ~ for negation), e.g.:

(pga != nan) & ((magnitude > 5) | ~(event_time <= "2016-08-30"))

The gmdb columns which can be used in a selection expression are listed below

{% for key, values in gmt.items %} {% for value in values %} {% endfor %} {% endfor %}
Column name: Column type: Missing values are stored as (empty cell: no missing value available):
{{ key }}{{ value | safe }}

Note: all GSIMs are implemented in OpenQuake with set of required columns. In all computations involving a gmdb, for any given GSIM the gmdb is first filtered by selecting only valid records, i.e. records with non missing values in all GSIM's required columns. Any selection expression, if provided, is then applied on valid records only.