Import GPR data


Note:

Table of Contents

Install/load 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)

Read/import GPR data

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)

Overview

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:

Sensors and software data (.dt1)

Each GPR data consists at least of

To read the GPR data, enter

x <- readGPR(dsn = "XLINE00.DT1")
plot(x)

GSSI data (.dzt)

To read the GPR data, enter

x <- readGPR(dsn = "XLINE00.dzt")
plot(x)

Multi-channel data

To read multi-channel data, simply specify the channel number you want to read by using the argument ch in the function readGPR():

MALA data (.rd3, .dr7)

Each GPR data consists at least of

To read the GPR data, enter

x <- readGPR(dsn = "XLINE00.rd3")
plot(x)

ImpulseRadar data (.iprb)

Each GPR data consists at least of

To read the GPR data, enter

x <- readGPR(dsn = "XLINE00.iprb")
plot(x)

SEG-Y data (.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)

RadSys Zond GPR data (.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)

Geomatrix Earth Science data (.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

To read the GPR data, enter

x <- readGPR(dsn = "XLINE00.dat")
# or
x <- readGPR(dsn = "XLINE00.dat")
plot(x)

ASCII data (.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)

ENVI band-sequential files (.dat, .hdr)

  1. Read the ENVI file

    library(caTools)
    
    mydata <- read.ENVI("LINE001.dat",
                        headerfile = "LINE001.dat.hdr")
    class(mydata)
    
  2. 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")
    

Pickle files (.pkl, serialized Python object)

  1. Read the pickle file

    # install package reticulare if necessary
    if(!require("reticulate")) install.packages("reticulate")
    
    mydata <- reticulate::py_load_object("sim.pkl")
    class(mydata)
    
  2. 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")
    

Convert a matrix object into a GPR data

  1. We create a matrix data object:

    mydata <- as.matrix(frenkeLine00)
    
  2. 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
    )
    
  3. 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")