Learn R Programming

gemlog (version 0.41)

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 = character(), bitweight = NaN, units = 'Pa', time_adjustment = 0, 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 output units (e.g., Pa per count). Leave as NaN to use default value (for logger version, configuration, and 'units').

units

Units for output: can be 'Pa', 'V', or 'counts'. Only used when bitweight is left unset and default bitweight is calculated.

time_adjustment

Offset to add to output times (usually unnecessary, sometimes +/- 1 s).

blockdays

Amount of data (measured in days) to process at a time. This can be decreased to 0.5 or 0.25 in case of memory problems.

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)
# }

Run the code above in your browser using DataLab