hfbsm: Assemble high-frequency strain data

View source: R/bsm.R

hfbsmR Documentation

Assemble high-frequency strain data

Description

Assemble high-frequency strain data

Usage

hfbsm(sta, year, jday, ...)

## Default S3 method:
hfbsm(
  sta,
  year,
  jday,
  st,
  duration,
  sampling = 1,
  verbose = TRUE,
  check.first = TRUE,
  ...
)

check_for_hfbsm(sta4, starttime, endtime)

load_hfbsm(object, ...)

## S3 method for class 'hfbsm.nfo'
load_hfbsm(
  object,
  file.type = c("lin", "raw"),
  loc = ".",
  stop.on.empty = TRUE,
  ...
)

## S3 method for class 'hfbsm'
plot(
  x,
  sc = 1,
  main = NULL,
  xlab = NULL,
  note = NULL,
  v.markers = NULL,
  frame.plot = FALSE,
  ...
)

update_file_location(object, new.location, ...)

## S3 method for class 'hfbsm.nfo'
update_file_location(object, new.location, verbose = TRUE, ...)

Arguments

sta

character; the station code. This can be either the 4-character code (e.g., 'B084') of the 16-character code (e.g., 'pinyon084bcs2006') because it uses station_data with use.regexp=TRUE

year

numeric; the year of the start time of the desired dataset

jday

numeric; the Julian day (day of year) of the start time

...

additional parameters

st

character; the hour:minute:second of the start time. Defaults to '00:00:00' if missing.

duration

numeric; the relative end-time, represented as the number of seconds from the start time. Defaults to a reasonable length that won't cause too much processing time to elapse, which depends on sampling.

sampling

numeric; the sampling rate, in Hz, of the data to be downloaded; can be either 1 or 20

verbose

logical; should messages and warnings be given?

check.first

logical; should an attempt be made to check if the data exists prior to assembly? This assumes data lie below http://ds.iris.edu/pbo/raw/bsm

object

an object having class 'hfbsm.nfo'

file.type

character; the type of strain data to load: 'lin' for linearized data in units of linear uncorrected strain, or 'raw' for raw data in units of nonlinear counts. See [1] for more information.

loc

(unused)

x

an object of class 'hfbsm'

sc

numeric; a value to scale the strains by

main

character; the plot title

xlab

character; the x-axis label

note

character; a note to place in the bottom left corner

v.markers

numeric; dashed, red, vertical lines are drawn at these times

frame.plot

logical; should boxes be drawn around each frame?

new.location

the new path to set for the source-data files in object; can be any list-coercible object (i.e., with as.list) to specify multiple sub-directories while ensuring the path is constructed correctly (i.e., with file.path)

Details

This uses a set of scripts included with the package, namely hfbsm, and the python scripts bottlefile.py and bottlefile_merge.py, to create (from the raw source files) high frequency PBO strain records for each channel at a station.

Value

hfbsm: A list with information about the results, having class 'hfbsm.nfo'.

Author(s)

A.J. Barbour. bottlefile.py and bottlefile_merge.py were modified from those written by Jim Wright (previously at UNAVCO).

References

[1] Barbour, A. J., and Agnew, D. C. (2011). Noise levels on plate boundary observatory borehole strainmeters in southern California. Bulletin of the Seismological Society of America. 101(5), 2453-2466. doi: 10.1785/0120110062

See Also

strain-package

Examples

## Not run: 
# Download and assemble
# 1-Hz
res   <- hfbsm("B084", 2009, 215, "01:01:00", duration=1800, 1)
# 20-Hz (takes much longer)
res20 <- hfbsm("B084", 2009, 215, "01:01:00", duration=180, 20)
#
# Load data
dat <- load_hfbsm(res)
dat20 <- load_hfbsm(res20)
#
# Plot
plot(dat)
plot(dat20)
#
# Find out where the scripts live:
file.path(find.package('strain'), "hfbsm")

## End(Not run)


abarbour/strain documentation built on Oct. 13, 2023, 11:44 p.m.