Learn R Programming

IRISSeismic (version 1.6.6)

multiplyBy: 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)

Value

A new Trace or Stream object is returned.

Arguments

x

a Trace or Stream object

y

a numeric multiplier

Author

Jonathan Callahan jonathan@mazamascience.com

Examples

Run this code
if (FALSE) {
# 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)
}

Run the code above in your browser using DataLab