TSL2AI: Arias-intensity ratio history from canonical acceleration...

View source: R/intensityRatios.R

TSL2AIR Documentation

Arias-intensity ratio history from canonical acceleration time series.

Description

TSL2AI() computes the cumulative Arias-intensity history from acceleration rows in a canonical TSL table and returns the relative value AI(t) / max(AI).

Usage

TSL2AI(.x, units.source, units.target = "mm", output = c("wide", "long"))

Arguments

.x

data.table. Long-format TSL with at least OCID, ID, t, and s columns plus optional metadata columns. Only rows with ID == "AT" are used.

units.source

character. Source length units of the s column ("mm", "cm", or "m"). Canonical TSL acceleration is interpreted as length units per second squared.

units.target

character. Target length units used for intermediate calculations. Default "mm".

output

character. "wide" returns one row per metadata and t, with one ratio column per OCID; "long" returns columns ⁠<metadata>, OCID, t, ratio⁠.

Value

A data.table. Values are ratios in ⁠[0, 1]⁠ when the final cumulative value is positive; otherwise ratios are NA_real_.

Examples

t <- seq(0, 1, by = 0.01)
tsl <- data.table::data.table(RecordID = "R1", OCID = "H1",
                              ID = "AT", t = t,
                              s = 1000 * sin(2 * pi * t))
TSL2AI(tsl, units.source = "mm")


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