Build the canonical RawRecordTable for one or more owners.
buildRawRecordTable.RdScans <path.records>/<OwnerID>/<EventID>/<StationID>/raw/AT.*.json and
emits one row per RecordID to <path.index>/RawRecordTable.<OwnerID>.csv.
Details
Schema:
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.
Examples
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"))
#> RecordID EventID StationID OwnerID NP Fs pad
#> <char> <char> <char> <char> <int> <int> <int>
#> 1: R1 E1 S1 AAA 4 100 0