Last data update: 2014.03.03

R: Classes and methods for seismic data analysis
IRISSeismic-packageR Documentation

Classes and methods for seismic data analysis

Description

This package provides S4 classes for downloading and processing seismological data available from the IRIS Data Management Center (DMC) (http://www.iris.edu/dms/nodes/dmc/). Core classes Trace, Stream and IrisClient and their associated methods are inspired by the functionality available in the python ObsPy package (http://obspy.org/).

Introduction

The "IRISSeismic-intro" vignette gives introductory examples on using the package.

History

version 1.0.6 – CRAN updates required

  • Removed "mode" argument form Trace.as.vector() signature.

version 1.0.4 – name change to IRISSeismic

  • Name change required because 'seismic' was recently taken.

  • Using explicit references for 'utils' and 'stats' package functions as this is now required for CRAN.

version 1.0.3 – cleanup for submission to CRAN

  • Updated libmseed to version 2.16

version 0.2.8.0 – minor tweaks to 0.2.7

  • Updated links to IRIS web services in the documentation.

  • McNamaraBins() ignores bin #0 (~= DC)

  • McNamaraPSD() conversion to dB occurs after binning, not before

version 0.2.7.0 – hilbert transform

  • New hilbertFFT() function.

  • New hilbert() trace method.

version 0.2.6.0 – cross correlation

  • Added surfaceDistance() function.

  • Added rotate2D() function.

version 0.2.5.0 – channel orientation

  • Jumping to version 0.2.5 to match project milestone names.

  • Added getSNCL() convenience wrapper for getDataselect() method.

  • Added getDistaz() method of IrisClient.

  • Added miniseed2Stream() and readMiniseedFile() functions.

  • Added getRotation() method of IrisClient.

version 0.2.3.0 – cross spectrum

  • Moved McNamaraPSD() from trace method to spectral utility function.

  • Added spectral utility functions:

    • crossSpectrum()

    • McNamaraBins()

  • All get~ methods that return dataframes now guarantee a default ordering of rows.

version 0.2.2.0 – PSD and friends

  • Add dependency on pracma package.

  • Use pracma::detrend() function in DDT.Trace().

  • Added "increment" parameter to STALTA.Trace().

  • Removed STALTA.Trace() algorithm "classic_LR2".

  • Fixed URL generation for getEvalresp() when location="".

  • Added NamaraPSD.Trace() method.

  • Added PSD/PDF utility functions:

    • noiseMatrix2PdfMatrix()

    • noiseModels()

    • psdDF2NoiseMatrix()

    • psdList()

    • psdList2NoiseMatrix()

    • psdStatistics()

    • psdPlot()

version 0.2.1.1 – Bug fix release

  • Removed dependcy on signal, XML packages.

version 0.2.1.0 – FDSN web services

  • Conversion to FDSN web services including the following new/rewritten methods: getNetwork, getStation, getChannel, getAvailability, getUnavailability

  • Updated version of getEvent to return a dataframe with columns named "latitude" and "longitude" for consistency with all other web services

  • Updated documentation and Rscripts to match the API changes in the conversion to FDSN web services.

  • Removal of all StationXML classes in favor of storing that information in slots of the Trace class.

  • Updates to Trace object slots @Sensor, @InstrumentSensitivity and @InputUnits to store information as character, numeric and character instead of StationXML classes.

  • The TraceHeader@quality slot now reflects the data quality returned in the miniSEED record rather than the quality that was requested by getDataselect. (Requests with quality=B for "Best" typically return quality=M.)

  • Improved STALTA.Trace() method removes experimental algorithms and now uses C++ code from package rollSeismic to calculate rolling means.

  • Updated IrisClient now uses web services from http://service.iris.edu for the following methods: getDataselect, getEvalresp, getEvent

version 0.2.0.0

  • Removed PSD methods of Stream and Trace. PSD algorithms are now part of the PSD metric.

  • Improved mergeTraces.Stream() method now accepts fillMethod="fillZero".

version 0.1.9.0

  • New rollSeismic package for fast rolling algorithms implemented in C++/Rcpp.

  • New num_spikes metric based on seismicRoll::roll_hampel outlier detection.

  • New correlation metric.

  • New scripts glitchMetrics.Rscript, correlationMetric.Rscript, pressureCorrelation.Rscript

  • New trace@stats@processing slot for data processing information.

  • New Stream methods: mergeTraces, plot

  • Improved getGaps.Stream() method properly handles initial and final gaps.

  • Improved MCR error messing.

version 0.1.8.0 – IrisClient methods getEvent and getTraveltime, improved SNR metric

version 0.1.7.0 – PSD

version 0.1.6.0 – improved errors, miniSEED parser

version 0.1.5.0 – code cleanup, improved errors, package vignette

version 0.1.4.0 – STA/LTA, upDownTimes, basic plotting

version 0.1.3.0 – SNR, memory profiling

version 0.1.2.0 – ...

version 0.1.1.0 – ...

Author(s)

Jonathan Callahan jonathan.s.callahan@gmail.com

References

ObsPy: http://obspy.org/

IRIS DMC web services: http://service.iris.edu/

See Also

IrisClient-class, Trace-class, Stream-class,

Examples

# Open a connection to IRIS DMC webservices
iris <- new("IrisClient", debug=TRUE)

starttime <- as.POSIXct("2010-02-27 06:45:00", tz="GMT")
endtime <- as.POSIXct("2010-02-27 07:45:00", tz="GMT")

# Get the seismic data
st <- getDataselect(iris,"IU","ANMO","00","BHZ",starttime,endtime)

# Extract the first trace, display the metadata and plot it
tr1 <- st@traces[[1]]
show(tr1@stats)
plot(tr1)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(IRISSeismic)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/IRISSeismic/IRISSeismic-package.Rd_%03d_medium.png", width=480, height=480)
> ### Name: IRISSeismic-package
> ### Title: Classes and methods for seismic data analysis
> ### Aliases: IRISSeismic-package IRISSeismic
> 
> ### ** Examples
> 
> # Open a connection to IRIS DMC webservices
> iris <- new("IrisClient", debug=TRUE)
> 
> starttime <- as.POSIXct("2010-02-27 06:45:00", tz="GMT")
> endtime <- as.POSIXct("2010-02-27 07:45:00", tz="GMT")
> 
> # Get the seismic data
> st <- getDataselect(iris,"IU","ANMO","00","BHZ",starttime,endtime)
<debug>URL = http://service.iris.edu/fdsnws/dataselect/1/query?net=IU&sta=ANMO&loc=00&cha=BHZ&start=2010-02-27T06:45:00&end=2010-02-27T07:45:00&quality=B
<debug>URL = http://service.iris.edu/fdsnws/station/1/query?net=IU&sta=ANMO&loc=00&cha=BHZ&starttime=2010-02-27T06:45:00&endtime=2010-02-27T07:45:00&includerestricted=false&output=text&level=channel
> 
> # Extract the first trace, display the metadata and plot it
> tr1 <- st@traces[[1]]
> show(tr1@stats)
Seismic Trace TraceHeader 
 Network:        IU 
 Station:        ANMO 
 Location:       00 
 Channel:        BHZ 
 Quality:        M 
 calib:          1 
 npts:           72000 
 sampling rate:  20 
 delta:          0.05 
 starttime:      2010-02-27 06:45:00 
 endtime:        2010-02-27 07:44:59 
 processing:      
> plot(tr1)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>