multiplyBy: Multiplication by a constant

multiplyByR Documentation

Multiplication by a constant

Description

The multiplyBy methods of Trace and Stream objects return like objects where all @data slots have been multiplied by a constant.

Usage

multiplyBy(x, y)

Arguments

x

a Trace or Stream object

y

a numeric multiplier

Value

A new Trace or Stream object is returned.

Author(s)

Jonathan Callahan jonathan@mazamascience.com

Examples

## Not run: 
# Open a connection to IRIS DMC webservices
iris <- new("IrisClient")

starttime <- as.POSIXct("2011-01-24", tz="GMT")
endtime <- as.POSIXct("2011-01-25", tz="GMT")

# Get the waveform
stRaw <- getDataselect(iris,"AK","PIN","","BHZ",starttime,endtime)

# obtain an instrument sensitivity value with getChannel metadata)
c <- getChannel(iris, "AK","PIN","","BHZ",starttime, endtime)
sensitivityValue <- c$scale

# convert raw data
st <- multiplyBy(stRaw, 1/sensitivityValue)
rmsVariance(st)

# plot trace
plot(st, ylab=c$scaleunits)

## End(Not run)

IRISSeismic documentation built on Oct. 16, 2022, 1:09 a.m.