Note:
RGPR
RGPR
You need first to install R (R Cran website). Then, RGPR can be installed within R with the following commands:
# install "devtools" if not already done
if(!require("devtools")) install.packages("devtools")
devtools::install_github("emanuelhuber/RGPR")
# load RGPR in the current R session
library(RGPR)
Use the function readGPR()
to import GPR data into R. While the filepath (given to the argument dsn
) is case sensitive, the extension is not. That means that you can write: XLINE00.DT1
or XLINE00.dt1
. Note that the filepath must correspond to the binary data (not to the ASCII header file data)
Currently the coordinates collected with GPS in the same time as the GPR data and stored in a specific file are not directly imported by the function readGPR()
. You must add the coordinates separatly following the explanations of the tutorial ‘Adding coordinates to GPR data’. But I am working on that…
To suppress any message or warning, set the argument verbose = FALSE
, e.g.,
x <- readGPR(dsn = "myData.ext", verbose = FALSE)
plot(x)
Manufacturer | Mandatory | optional: GPS | optional: others |
---|---|---|---|
Sensors & software | .DT1,.HD | .GPS | |
MALA 16 bits | .rd3,.rad | .cor | |
MALA 32 bits | .rd7,.rad | .cor | |
ImpulseRadar | .iprb,.iprh | .cor | .time1 (,.mrk2*) |
GSSI | .dzt | .dzg | |
IDS | .dt | .gec | |
Geomatrix Earth Science Ltd | .dat,.hdr | .gps,.gpt3 | |
Transient Technologies | .sgpr | ||
US Radar | .RA1/.RA2/.RAD | ||
Radar Systems, Inc. | .sgy/.segy | ||
SEG-Y | .sgy/.segy | ||
SEG-2 | .sg2 | ||
R internal file format | .rds | ||
serialized Python object | .pkl | ||
ENVI band sequential | .dat,.hdr | ||
ASCII / text-file | .txt |
* not yet implemented
1 date and time recording for each traces
2 markers
3 markers associated to the GPS data (.gps)
Indirectly supported file format:
.dt1
)Each GPR data consists at least of
.hd
) that can be opened with a normal text editor.DT1
, 16-bit).To read the GPR data, enter
x <- readGPR(dsn = "XLINE00.DT1")
plot(x)
.dzt
)To read the GPR data, enter
x <- readGPR(dsn = "XLINE00.dzt")
plot(x)
To read multi-channel data, simply specify the channel number you want to read by using the argument ch
in the function readGPR()
:
read channel 1:
x <- readGPR(dsn = "YLINE00.dzt", ch = 1)
plot(x)
read channel 2:
x <- readGPR(dsn = "YLINE00.dzt", ch = 2)
plot(x)
.rd3
, .dr7
)Each GPR data consists at least of
.rad
) that can be opened with a normal text editor.rd3
, 16-bit).To read the GPR data, enter
x <- readGPR(dsn = "XLINE00.rd3")
plot(x)
.iprb
)Each GPR data consists at least of
.iprh
) that can be opened with a normal text editor.iprb
, 16-bit or 32-bit).To read the GPR data, enter
x <- readGPR(dsn = "XLINE00.iprb")
plot(x)
.sgy
)Binary data file with the SEG-Y Sounding Data Format (extension .sgy
or .segy
, 16-bit or 32-bit).
Still experimental!
To read the GPR data, enter
x <- readGPR(dsn = "XLINE00.sgy")
# or
x <- readGPR(dsn = "XLINE00.segy")
plot(x)
.sgy
)Although the RadSys Zond GPR data files have the ‘.sgy’ extension, they are not a version of the SEG-Y file format. RGPR will detect the file format and read correctly the data.
To read the GPR data, enter
x <- readGPR(dsn = "XLINE00.sgy")
# or
x <- readGPR(dsn = "XLINE00.segy")
plot(x)
.dat
)Currently, on the file formats for the GroundVue 3, GroundVue 7, and TriVue devices are supported. The file formats for the GroundVue 100, 250 and 400 will be soon supported.
Each GPR data consists at least of
.hdr
) that can be opened with a normal text editor.data
).To read the GPR data, enter
x <- readGPR(dsn = "XLINE00.dat")
# or
x <- readGPR(dsn = "XLINE00.dat")
plot(x)
.txt
)Either 3-column format (x, t, amplitude) or matrix-format (without header/rownames). readGPR()
should be able to detect the format as well as the separator.
To read the GPR data, enter
x <- readGPR(dsn = "XLINE00.txt")
plot(x)
.dat
, .hdr
)Read the ENVI file
library(caTools)
mydata <- read.ENVI("LINE001.dat",
headerfile = "LINE001.dat.hdr")
class(mydata)
Convert this matrix into a GPR object according to the Section Convert a matrix object into a GPR data. Create a list (minimum list format below) and convert it into a GPR object:
x <- list(data = mydata,
freq = 250, # MHz (antenna frequency)
dx = 0.025, # metres (spatial sampling)
dz = 0.1000, # ns (vertical sampling)
antsep = 1 # antenna separation 1 m
)
# convert this list into a GPR object
gprdata <- as(x, "GPR")
.pkl
, serialized Python object)Read the pickle file
# install package reticulare if necessary
if(!require("reticulate")) install.packages("reticulate")
mydata <- reticulate::py_load_object("sim.pkl")
class(mydata)
Convert this matrix into a GPR object according to the Section Convert a matrix object into a GPR data. Create a list (minimum list format below) and convert it into a GPR object:
x <- list(data = t(mydata), # transpose the data if necessary
freq = 250, # MHz (antenna frequency)
dx = 0.025, # metres (spatial sampling)
dz = 0.1000, # ns (vertical sampling)
antsep = 1 # antenna separation 1 m
)
# convert this list into a GPR object
gprdata <- as(x, "GPR")
We create a matrix data object:
mydata <- as.matrix(frenkeLine00)
Create a list (minimum list format below)
x <- list(data = mydata,
freq = 250, # MHz (antenna frequency)
dx = 0.025, # metres (spatial sampling)
dz = 0.1000, # ns (vertical sampling)
antsep = 1 # antenna separation 1 m
)
Convert this list into a GPR object
gprdata <- as(x, "GPR")
# plot to check
plot(gprdata, main = "test")
# get an overview of the slots (attributes) of the object
str(gprdata)
You can also define some additional attributes, see examples below:
x2 <- list(data = mydata,
freq = 250,
dx = 0.025,
dz = 0.1000,
antsep = 1,
# either 'reflection', 'CMP' or 'WARR'
surveymode = "reflection",
date = "25/12/2017",
# date of the survey: dd/mm/yyyy
name = "XLINE00",
description = "A nice survey",
depthunit = "ns",
posunit = "m",
# GPR wave velocity in m/ns, must be a list
# for the moment, only constant wave velocity
# are implemented.
vel = list(0.1)
)
gprdata2 <- as(x2, "GPR")
plot(gprdata2, main = "test2")
Instead of giving the spatial (dx
) and vertical (dz
) sampling, you can directly give the trace positions (pos
) and the sample time (depth
). Example:
x3 <- list(data = mydata,
freq = 250,
# trace position
pos = seq(from = 0, by = 0.025,
length.out = ncol(mydata)),
# sample position
depth = seq(from = 0, by = 0.1,
length.out = nrow(mydata)),
antsep = 1
)
gprdata3 <- as(x3, "GPR")
plot(gprdata3, main = "test3")