Learn R Programming

IRISSeismic (version 1.0.5)

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)

Arguments

x
a Trace or Stream object
y
a numeric multiplier

Value

  • A new Trace or Stream object is returned.

Examples

Run this code
# Open a connection to IRIS DMC webservices
iris <- new("IrisClient")

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

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

# obtain an instrument sensitivity value with getChannelMetadata)
# ...

sensitivityValue <- 10.0

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

rmsVariance(st)

Run the code above in your browser using DataLab