Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions imdb/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
else in this library composes column lists by hand.
"""

SCHEMA_VERSION = "1"
SCHEMA_VERSION = "2"

DDL = """
CREATE TABLE db_meta (key VARCHAR PRIMARY KEY, value VARCHAR NOT NULL);
Expand Down Expand Up @@ -63,6 +63,7 @@
vs30 FLOAT,
z1p0 FLOAT,
z2p5 FLOAT,
is_real BOOLEAN NOT NULL DEFAULT TRUE,
metadata VARCHAR
);

Expand Down Expand Up @@ -110,7 +111,7 @@
);
"""

COMPONENTS = ("000", "090", "ver", "geom", "rotd0", "rotd50", "rotd100")
COMPONENTS = ("000", "090", "ver", "geom", "rotd0", "rotd50", "rotd100", "eas")

SCALAR_IMS = ("PGA", "PGV", "PGD", "CAV", "AI", "Ds575", "Ds595")

Expand Down Expand Up @@ -156,9 +157,9 @@
"(rel_id, site_id, component, kind, gmm_key)."
),
"component vocabulary": (
"000, 090, ver, geom, rotd0, rotd50, rotd100, following IM_calculation. A database "
"may hold any subset; db_meta.components lists which. The writer validates against "
"that list."
"000, 090, ver, geom, rotd0, rotd50, rotd100, following IM_calculation, plus eas "
"(effective amplitude spectrum, FAS only). A database may hold any subset; "
"db_meta.components lists which. The writer validates against that list."
),
"rotd scalars are undefined": (
"scalars_ims.CAV, AI, Ds575 and Ds595 are NULL for rotd* components. PGA, PGV and "
Expand All @@ -177,6 +178,10 @@
"JSON object. Read with json_extract_string(metadata, '$.key'). Keys are free-form, "
"per-dataset; not declared or validated by the writer."
),
"is_real": (
"sites.is_real distinguishes real sites (station/grid locations, the default) from "
"virtual simulation sites."
),
"distances are event level": (
"rrup, rjb, rx and ry are measured to the rupture surface and are defined at the "
"event level, shared across all realisations of an event. Hypocentral and "
Expand Down
Loading
Loading