aux_obspyeseis {eseis} | R Documentation |
Convert ObsPy object to eseis object
Description
The function converts an ObsPy stream object to an eseis object. The functionality is mainly useful when running ObsPy through R using the package 'reticulate'.
Usage
aux_obspyeseis(data, simplify = TRUE)
Arguments
data |
|
simplify |
|
Details
Initiation of the reticulate-based python toolbox support can be cumbersome. The following suggestions from Guthub (https://github.com/rstudio/reticulate/issues/578) helped in a case study:
library(reticulate)
use_condaenv("r-reticulate")
py_install("obspy", pip = TRUE)
Value
eseis
object.
Author(s)
Michael Dietze
Examples
## Not run:
## load ObsPy library with package 'reticulate'
## (requires ObsPy to be installed on the computer)
obspy <- reticulate::import("obspy")
## set seismic data directory
dir_data <- paste0(system.file("extdata", package="eseis"), "/")
## read miniseed file to stream object via ObsPy
x <- obspy$read(pathname_or_url = "dir_data/2017/99/RUEG1.17.99.00.00.00.BHZ.SAC")
## convert ObsPy stream object to eseis object
y <- aux_obspyeseis(data = x)
## plot eseis object
plot_signal(y)
## End(Not run)