Learn R Programming

eseis (version 0.7.3)

aux_stationinfofile: Create station info file from cube files.

Description

This function reads GPS tags from Omnirecs/Digos Datacube files and creates a station info file from additional input data. It depends on the cubetools or gipptools software package (see details).

Usage

aux_stationinfofile(
  name,
  input_dir,
  output_dir,
  station_ID,
  station_name,
  station_z,
  station_d,
  sensor_type,
  logger_type,
  sensor_ID,
  logger_ID,
  unit = "dd",
  n,
  quantile = 0.95,
  random = TRUE,
  cpu,
  gipptools,
  write_file = TRUE,
  write_raw = FALSE,
  write_data = FALSE
)

Value

A set of files written to disk and a data frame with seismic station information.

Arguments

name

Character value, file name of the output station info file, without extention (will be added as *.txt).

input_dir

Character value, path to directory where all cube files to be processed as stored. Each set of files from one logger must be stored in a separate sub-directory named after the cube ID.

output_dir

Character value, path to directory where output data is written to.

station_ID

Character vector, seismic station ID. Each value must not contain more than 5 characters. Longer entries will be clipped. If omitted, a default ID will be created.

station_name

Character vector, seismic station name. If omitted, the station ID is used as name.

station_z

Numeric vector, elevation of the seismic stations.

station_d

Numeric vector, deployment depth of the seismic sensor.

sensor_type

Character vector, sensor type.

logger_type

Character vector, logger type.

sensor_ID

Character vector, sensor ID.

logger_ID

Character vector, logger ID.

unit

Character value, coordinates unit of the location. One out of "dd" (decimal degrees) and "utm" (metric in UTM zone). Default is "dd".

n

Numeric value, number of cube file to process for GPS coordinate extraction. If omitted, all files are processed.

quantile

Numeric value, quantile size to which the extracted coordinate sample size is restricted. This is mainly used to remove coordinate outliers, due to spurious GPS signals. Default is 0.95. Set to 1 to omit any sample rejection.

random

Logical value, option to draw n cube files randomly instead of ordered by date. Default is TRUE.

cpu

Numeric value, fraction of CPUs to use for parallel processing. If omitted, one CPU is used.

gipptools

Character value, path to gipptools or cubetools directory.

write_file

Logical value, option to write station info file to disk. Default is TRUE.

write_raw

Logical value, option to write (keep) raw ASCII GPS data. Default is FALSE.

write_data

Logical value, option to write gps raw data as rda-file. File name will be the same as for file. Default is FALSE.

Author

Michael Dietze

Details

A station info file is an ASCII file that contains all relevant information about the individual stations of a seismic network. The variables contain a station ID (containing not more than 5 characters), station name, latitude, longitude, elevation, deployment depth, sensor type, logger type, sensor ID and logger ID.
The function requires that the software cubetools (http://www.omnirecs.de/documents.html) or gipptools (http://www.gfz-potsdam.de/en/section/geophysical-deep-sounding/infrastructure/geophysical-instrument-pool-potsdam-gipp/software/gipptools/) are installed. Note that GPS tag extraction may take several minutes per cube file. Hence, depending on the number of files and utilised CPUs the processing may take a while.
Specifying an input directory (input_dir) is mandatory. This input directory must only contain the subdirectories with the cube files to process, each set of cube files must be located in a separate subdirectory and these subdiretories must have the same name as specified by the logger IDs (logger_ID). An appropriate structure would be something like:

  1. input

    1. A1A

      1. file1.A1A

      2. file2.A1A

    2. A1B

      1. file1.A1B

      2. file2.A1B

Examples

Run this code

if (FALSE) {

## basic example with minimum effort
aux_stationinfofile(name = "stationinfo", 
                    input_dir = "input", 
                    logger_ID = c("864", "876", "AB1"),
                    gipptools = "software/gipptools-2015.225")

## example with more adjustments
aux_stationinfofile(name = "stationinfo",
                    input_dir = "input",
                    logger_ID = c("864", "876", "AB1"),
                    station_name = c("KTZ01", "KTZ02", "KTZ03"), 
                    station_z = c(30, 28, 29), 
                    station_d = rep(0.5, 3), 
                    sensor_type = rep("TC120s", 3), 
                    logger_type = rep("Cube3ext", 3), 
                    unit = "utm", 
                    n = 1, 
                    cpu = 0.9,
                    gipptools = "software/gipptools-2015.225", 
                    write_raw = TRUE, 
                    write_data = TRUE)

}

Run the code above in your browser using DataLab