Learn R Programming

gem (version 0.19)

Convert: Convert raw Gem data to segy

Description

Convert takes a directory of raw Gem data files and converts them to PASSCAL segy files, including interpolating time with GPS strings and converting from counts to pressure units.

Usage

Convert(rawpath = ".", convertedpath = "converted", metadatapath = "metadata", metadatafile = NA, gpspath = "gps", gpsfile = NA, t1 = -Inf, t2 = Inf, nums = NaN, SN = NaN, bitweight = 0.256/2^15/(4.6e-05 * 3.4/7)/23.455, time_adjustment = 0, yr = 2016, blockdays = 1)

Arguments

rawpath
Directory containing raw data to be converted.
convertedpath
Directory (to be created, if necessary) where output segy files will be saved.
metadatapath
Directory (to be created, if necessary) where output metadata file will be saved.
metadatafile
Filename for output metadata. If set, overrides metadatapath. If unset, Convert creates the next logical filename in metadatapath.
gpspath
Directory (to be created, if necessary) where output gps file will be saved.
gpsfile
Filename for output gps data. If set, overrides gpspath. If unset, Convert creates the next logical filename in gpspath.
t1
Time at which conversion should start (class POSIXct).
t2
Time at which conversion should end (class POSIXct).
nums
File numbers to convert.
SN
Serial number of Gem data files to convert (to be safe, when data from multiple Gems could be mixed).
bitweight
Conversion factor between counts and Pascals (Pa per count).
time_adjustment
Offset to add to output times (usually unnecessary, sometimes +/- 1 s).
yr
Year of data (unnecessary).
blockdays
Amount of data (measured in days) to process at a time. Normally 1, but for computers with little memory, might be necessary to make less than 1.

Value

None; writes files only.

Details

This is the usual function to use when converting data to segy files. To read data directly into R, use ReadGem.

See Also

ReadGem

Examples

Run this code
## Not run: 
# # define bitweight for 0.5 inch sensor with Rg = 2.2k
# sensitivity = 22.014e-6 # 22.014 uV/Pa
# Rg = 2.2 # gain-setting resistor value in kilo-ohms
# gain = 1 + 49.4/2.2 # amplifier gain
# A2D = 0.256/2^15 # volts per count in analog-digital converter
# bitweight = A2D / (gain * sensitivity) # conversion from counts to Pa (Pa/count)
# 
# # convert files from two Gems (SNs 000 and 001)
# Convert('raw/000', bitweight = bitweight)
# Convert('raw/001', bitweight = bitweight)
# ## End(Not run)

Run the code above in your browser using DataLab