Skip to contents

AT2 has a 4-line header ending with NPTS=/DT=. Line 2 holds the direction as the last comma-separated token (e.g., Helena Montana-01, 10/31/1935, Carroll College, 180). Body has up to 8 values per row in scientific notation; "stuck" negatives (1.234-5.678) are split before parsing. Truncated at NPTS.

Usage

readAT2(file)

Arguments

file

Path to the .AT2 file.

Value

LONG data.table(t, OCID, s).

Examples

file <- tempfile(fileext = ".AT2")
writeLines(c(
  "header",
  "Event, date, station, H1",
  "units",
  "NPTS= 4, DT= 0.01 SEC",
  "1.0 2.0 3.0 4.0"
), file)
readAT2(file)
#>        t   OCID     s
#>    <num> <char> <num>
#> 1:  0.00     H1     1
#> 2:  0.01     H1     2
#> 3:  0.02     H1     3
#> 4:  0.03     H1     4