View source: R/buildRawRecordTable.R
| buildRawRecordTable | R Documentation |
Scans <path.records>/<OwnerID>/<EventID>/<StationID>/raw/AT.*.json and
emits one row per RecordID to <path.index>/RawRecordTable.<OwnerID>.csv.
buildRawRecordTable(path.records, path.index, owners = NULL)
path.records |
Absolute path to the records root. Required – no default. |
path.index |
Absolute path to the index root where per-owner CSVs are written. Required – no default. |
owners |
Character vector of |
Schema:
RecordID, EventID, StationID, OwnerID, NP, Fs, pad
where NP = max(json$NP) (post-align) and
pad = max(json$NP) - min(json$NP).
This table carries zero per-direction metadata: directional detail
(PGA, AI, ARMS, ...) lives in RawIntensityTable.<Owner>.csv. The
per-layer Raw* prefix leaves room for downstream processors to
emit their own <ProcessID>RecordTable.<Owner>.csv.
Invisibly, the per-owner row counts.
root <- file.path(tempdir(), "gmsp-raw-record-example")
index <- file.path(tempdir(), "gmsp-raw-record-index")
unlink(c(root, index), recursive = TRUE)
raw <- file.path(root, "AAA", "E1", "S1", "raw")
dir.create(raw, recursive = TRUE)
dir.create(index)
jsonlite::write_json(
list(RecordID = "R1", OwnerID = "AAA", EventID = "E1",
StationID = "S1", NP = c(4, 4, 4), Fs = 100),
file.path(raw, "AT.R1.json"), auto_unbox = TRUE
)
suppressMessages(buildRawRecordTable(root, index, owners = "AAA"))
data.table::fread(file.path(index, "RawRecordTable.AAA.csv"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.