multiplyBy {IRISSeismic} | R 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 |
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)
[Package IRISSeismic version 1.6.6 Index]