buildRawRecordTable: Build the canonical RawRecordTable for one or more owners.

View source: R/buildRawRecordTable.R

buildRawRecordTableR Documentation

Build the canonical RawRecordTable for one or more owners.

Description

Scans ⁠<path.records>/<OwnerID>/<EventID>/<StationID>/raw/AT.*.json⁠ and emits one row per RecordID to ⁠<path.index>/RawRecordTable.<OwnerID>.csv⁠.

Usage

buildRawRecordTable(path.records, path.index, owners = NULL)

Arguments

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 OwnerIDs. NULL = scan all subdirs of path.records.

Details

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⁠.

Value

Invisibly, the per-owner row counts.

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"))


gmsp documentation built on July 18, 2026, 5:07 p.m.