View source: R/aux_obspyeseis.R
aux_obspyeseis | R Documentation |
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'.
aux_obspyeseis(data, simplify = TRUE)
data |
|
simplify |
|
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)
eseis
object.
Michael Dietze
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.