Learn R Programming

eseis (version 0.6.0)

aux_psdsummary: Generate spectrograms for seismic stations at different time periods

Description

The function generates a set of spectrograms (PSDs) for all seismic stations provided, for daily, weekly, monthly and total time periods. It depends on seismic files being organised in a coherent structure as, for example, generated by aux_Organisecubefiles.

Usage

aux_psdsummary(
  station,
  component = "BHZ",
  period,
  output = c("daily", "weekly", "monthly", "total"),
  input_dir,
  output_dir,
  aggregate = c(1, 5),
  n_dates = 2000,
  jpg_dim = c(4444, 2500, 300, 90),
  verbose = FALSE,
  ...
)

Value

A set of JPEG images wirtten to disk

Arguments

station

Character value, seismic station ID, which must correspond to the ID in the file name of the data directory structure (cf. aux_organisecubefiles()).

component

Character value, seismic component, which must correspond to the component name in the file name of the data directory structure (cf. aux_organisecubefiles()). Default is "BHZ" (vertical component of a sac file).

period

POSIXct vector of length two, time period to be processed.

output

Character vector, output PSD types. One or more out of "daily", "weekly", "monthly", "total". Default is c("daily", "weekly", "monthly", "total").

input_dir

Character value, path to directory where the seismic files are stored.

output_dir

Character value, path to directory where PSD image files are saved to.

aggregate

Numeric vector of length two, aggregation factors for the processed PSD matrics. First entry denotes time aggregation, second entry frequency aggregation. Default is c(1, 5).

n_dates

Numeric value, final number of spectra per output PSD. Default is 2000.

jpg_dim

Numeric vector of length four, JPEG image properties in the form c(width, height, resolution, quality). Default is c(4444, 2500, 300, 90).

verbose

Logical value, optional screen output of processing progress. Default is FALSE.

...

Additional arguments passed to different functions. See details section for default values.

Author

Michael Dietze

Details

The function calls a series of other functions, partly with modified default values, which can be changed by the ...-argument. By default, the seismic files are imported as eseis objects using aux_getevent(..., eseis = TRUE). The signals are deconvolved with signal_deconvolve() using the default options, i.e., sensor = "TC120s" and logger = "Cube3extBOB". Then, the signals are bandpass filtered with signal_filter, using f = c(1, 90). The PSDs are calculated with signal_spectrogram using Welch = TRUE, window = 90 and window_sub = 30.

This and all other aux-functions are primarily written for internal use amongst the GFZ Geomorphology Section group members and their usual data handling scheme. Thus, they may be of limited use when adopted for other scopes. However, many of these functions are internally consistent in usage.

Examples

Run this code

if (FALSE) {

## PSD generation with minimum input arguments
aux_psdsummary(station = c("STA01", "STA02"), 
               period = as.POSIXct(x = c("2017-04-01",
                                         "2017-04-03"), 
                                   tz = "UTC"), 
               input_dir = "~/data/seismic/sac/")

## PSD generation with some more arguments
aux_psdsummary(station = c("STA01", "STA02"), 
               component = "BHZ",
               period = as.POSIXct(x = c("2017-04-01",
                                         "2017-04-03"), 
                                   tz = "UTC"), 
               output = c("daily", "monthly"),
               input_dir = "~/data/seismic/sac/",
               aggregate = c(2, 10), 
               n_dates = 1000,
               jpg_dim = c(1600, 900, 300, 50), 
               verbose = TRUE)
}

Run the code above in your browser using DataLab