Learn R Programming

eseis (version 0.8.0)

aux_eseisobspy: Convert eseis object to ObsPy stream object

Description

The function converts an eseis object to an ObsPy stream object. The functionality is mainly useful when running ObsPy through R using the package 'reticulate'. Currently, only single traces (i.e., single eseis objects) can be converted. Thus, to convert multiple traces, these need to be converted individually and added to the first trace using ObsPy functionalities.

Usage

aux_eseisobspy(data)

Value

ObsPy stream object as defined by the architecture of package 'reticulate'.

Arguments

data

eseis object, list element.

Author

Michael Dietze

Examples

Run this code

if (FALSE) {

## load ObsPy library with package 'reticulate'
## (requires ObsPy to be installed on the computer)
obspy <- reticulate::import("obspy")

## load example data set
data(rockfall)

## convert example eseis object to ObsPy stream object
x <- aux_eseisobspy(data = rockfall_eseis)

## filter data set using ObsPy
x_filter <- obspy$traces[[1]]$filter(type = "bandpass", 
                                     freqmin = 0.5, 
                                     freqmax = 1.0)
                                     
## plot filtered trace using ObsPy plotting routine
x$traces[[1]]$plot()

}

Run the code above in your browser using DataLab