Learn R Programming

eseis (version 0.7.3)

aux_organisecubefiles: Convert Omnirecs/Digos Datacube files to mseed or sac files and organise in directory structure.

Description

This function converts Omnirecs/Digos Datacube files to hourly mseed or sac files and organises these in a coherent directory structure, by year, Julian day, (station, hour and channel). It depends on the cubetools or gipptools software package (see details).

Usage

aux_organisecubefiles(
  stationfile,
  input_dir,
  output_dir,
  format = "sac",
  channel_name = "bh",
  cpu,
  fringe = "constant",
  verbose = FALSE,
  gipptools,
  heapspace,
  mseed_manual = FALSE,
  mseed_keep = FALSE
)

Value

A set of hourly seismic files written to disk.

Arguments

stationfile

Character value, file name of the station info file, with extension. See aux_stationinfofile.

input_dir

Character value, path to directory where all cube files to be processed are 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.

format

Character value, output file format. One out of "mseed" and "sac". Default is "sac".

channel_name

Character value, output file extension. One out of "bh" and "p". Default is "bh".

cpu

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

fringe

Character value, option to handle data outside the GPS-tagged time span. One out of "skip", "nominal" or "constant". Default is "constant".

verbose

Logical value, option to enable extended screen output of cubetools operations. Default is FALSE. This option might not work with Windows operating systems.

gipptools

Character value, path to gipptools or cubetools directory.

heapspace

Numeric value, heap space assigned to the Java Runtime Environment, e.g., 4096. Should be increased if the cube to mseed conversion fails (announced if verbose = TRUE). Please note that this argument fails on Windows machines, and also in other operating systems, it should only be used if the function returns an error caused by Java running out of memory.

mseed_manual

Logical value, option to convert mseed files manually. See details. Default is FALSE, i.e., the function converts cube files to mseed files using the GIPP tools.

mseed_keep

Logical value, option to keep mseed files instead of deleting them. Default is FALSE.

Author

Michael Dietze

Details

The function converts seismic data from the cube file format to either mseed (cf. read_mseed) or sac (cf. read_sac) and cuts the daily cube files to hourly files. These hourly files are organised in a coherent directory structure which is organised by year and Julian day. In each Julian day directory the hourly files are placed and named after the following scheme: STATIONID.YEAR.JULIANDAY.HOUR.MINUTE.SECOND.CHANNEL.
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.
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

With one of the latest updates of either R or Java the cache size for converting cube files to mseed files has been reduced. Thus, in several cases the conversion stops due to buffer overruns. This effect has been particularly observed when trying to convert more than about 20 consecutive days of cube files at once. In such a case, it is appropriate to set the function argument mseed_manual to TRUE. This will stop the function just at the point where the function would call the GIPPtools function cube2mseed. The user will see a confirmation command line in the R console, which asks to first copy all manually converted mseed files to the directory mseed_raw before confirming to continue with the R function. To convert all cube files to mseed files it is advised to open a terminal and run the function GIPPtools/bin/cube2mseed with the following parameters: GIPPtools/bin/cube2mseed --verbose --output-dir=./mseed_raw/ ./input_dir/ without further adjustments, except for the fringe sample option, as specified in aux_organisecubefiles. Please also see the documentation of the cube2mseed program from the gipptools for further information.

Alternatively, increasing the heap space of the Java Runtime Environment, required for converting the cube files, can solve the above mentioned issue. To increase the heap space, use the argument heapspace. By default, this argument is set to 4096.

Examples

Run this code

if (FALSE) {

## basic example with minimum effort
aux_organisecubefiles(stationfile = "output/stationinfo.txt", 
                      input_dir = "input", 
                      gipptools = "software/gipptools-2015.225/")

}
                        

Run the code above in your browser using DataLab