Giter VIP home page Giter VIP logo

rgpr's Introduction

RGPR: a free and open-source software package for ground-penetrating radar (GPR) data processing

If you have any questions, comments or suggestions, feel free to contact me (in english, french or german): [email protected]

I am developing this package on my free time as a gift to the GPR community. Any support will be appreciated!

RGPR is a free and open-source software package to read, export, analyse, process and visualise ground-penetrating radar (GPR) data. RGPR is written in R, a high-level programming language for statistical computing and graphics that is freely available under the GNU General Public License and runs on Linux, Windows and MacOS. R is a interpreted scripting language (not compiled) in the same veine as python or matlab.

RGPR was initially developed to compensate for shortcomings of commercial GPR data processing applications. The ultimate goal of RGPR is to promote GPR related research by providing access to the flexible and rich R environment. RGPR has also a didactic vocation by encouraging students and researchers to learn about GPR signal processing through various tutorials available on the RGPR GitHub repository and the R documentation (companion website with tutorials: http://emanuelhuber.github.io/RGPR).

Table of content

How to cite

E. Huber and G. Hans (2018) RGPR — An open-source package to process and visualize GPR data. 17th International Conference on Ground Penetrating Radar (GPR), Switzerland, Rapperswil, 18-21 June 2018, pp. 1-4. doi: 10.1109/ICGPR.2018.8441658

PDF Poster

Bibtex format

@INPROCEEDINGS{huber&hans:2018,
author    = {Emanuel Huber and Guillaume Hans},
booktitle = {2018 17th International Conference on Ground Penetrating Radar (GPR)},
title     = {RGPR — An open-source package to process and visualize GPR data},
year      = {2018},
pages     = {1--4},
doi       = {10.1109/ICGPR.2018.8441658},
ISSN      = {2474-3844}}

My current affiliation:

Emanuel Huber,
GEOTEST AG
Bernstrasse 165
3052 Zollikofen 
Switzerland

Notes

Faster plot function

Instead of plot(x) use plotFast(x)!

Supported file formats (read only):

  • Sensors & Software file format (*.dt1, *.hd, *.gps).
  • MALA file format (*.rd3, *.rd7, *.rad, *.cor).
  • ImpulseRadar file format (*.iprb, *.iprh, *.cor, *.time, *.mrk).
  • GSSI file format (*.dzt, *.dzx).
  • Geomatrix Earth Science Ltd file format (Utsi Electronics format) for the GroundVue 3, 7, 100, 250 and 400 as well as for the TriVue devices (*.dat, *.hdr, *.gpt, *.gps).
  • Radar Systems, Inc. Zond file format (*.sgy). WARNING: it is not a version of the SEG-Y file format.
  • IDS file format (*.dt, *.gec).
  • Transient Technologies file format (*.sgpr).
  • US Radar file format (*.RA1, *.RA2 or *.RAD)
  • SEG-Y file format developed by the Society of Exploration Geophysicists (SEG) for storing geophysical data (*.sgy), also used by Easy Radar USA
  • SEG-2 Pullan, S.E., 1990, Recommended standard for seismic (/radar) files in the personal computer environment: Geophysics, 55, no. 9, 1260–1271(*.sg2). Also used by US Radar with extensions *.RA1, *.RA2, *. RAD.
  • GPRmax: hdf5 file format with extension *.out (not well tested)
  • 3dradar: the manufacturer does not want to reveal the binary file format *.3dra. Workaround: export the GPR data in binary VOL format (*.vol) with the examiner software -> still experimental
  • R internal format (*.rds).
  • serialized Python object (*.pkl).
  • ENVI band sequential file format (*.dat, *.hdr).
  • ASCII (*.txt):
    • either 3-column format (x, t, amplitude)
    • or matrix-format (without header/rownames)
  • Terra Zond binary file format (*.trz) -> we are working on it

See tutorial Import GPR data.

Do you miss your preferred file format? Send me the file format description with a test file and I will adapt the RGPR-package to support this file format.

Supported export file formats

  • Sensors & Software file format (*.dt1, *.hd).
  • R internal format (*.rds).
  • ASCII (*.txt):
  • SEG-Y file format (*.sgy)

Yes, you can contribute

This is an ongoing project.

To report bugs and contribute to the development of RGPR, see how to contribute.

If you have any questions, comments or suggestions, feel free to contact me (in english, french or german):

[email protected]

Thank you!

Online tutorials

Check the companion website for more info, tutorials, etc.

http://emanuelhuber.github.io/RGPR

How to install

You must first install R. Then, in R console, enter the following:

if(!require("devtools")) install.packages("devtools")
devtools::install_github("emanuelhuber/RGPR")
library(RGPR)

frenkeLine00  # data from the package

plot(frenkeLine00)

Alternatively, you can download the package as a zip file and install it in R following these instructions:

https://riptutorial.com/r/example/5556/install-package-from-local-source

Function overview

NOTE: this overview is not up to date!! More functions than those listed below are available!

The documentation is still incomplete (but check the tutorials, http://emanuelhuber.github.io/RGPR and do not hesitate to contact me if you need addtional informations)

Input/output functions

  • readGPR(): reads various GPR file formats (Sensors & Software, MALA, SEG-Y, ImpulseRadar, GSSI, Utsi Electronic, IDS, Tansient technology, serialized Python object, ENVI band sequential file format, ASCII, etc.)
  • writeGPR(): writes various GPR file format (Sensors & Software, R-format, ASCII, 'xyz')
  • exportPDF(): exports high quality pdf graphic
  • exportDelineations(): exports delineations
  • exportFID(): exports fiducial markers as ASCII-file
  • exportCoord(): exports coordinates as SpatialLines, SpatialPoints or ASCII-file
  • exportProc(): exports the processing steps as ASCII-file

Plot functions

  • GPR data
    • 1D/2D: plot(), contour(), lines(), points()
    • 3D (plot in openGL): plot3DRGL()
    • superposition of all traces: trPlot()
  • Amplitude: plotAmpl()
  • Envelope: plotEnvelope()
  • Spectrum:
    • 1D frequency spectrum: spec()
    • 2D frequency spectrum (frequency-wavenumber): spec(x, type = "f-k")
  • Delineations
    • 2D: plotDelineations()
    • 3D: plot3DDelineations()
  • Velocity layers: plotVelocityLayers()
  • Structure tensor: plotTensor()
  • Color palette: plotPal()

GPR data positioning and referencing

  • Trace position reversal: reverse()
  • Vertical trace shift: traceShift()
  • Georeference coordinates (based on center and rotation angle): georef()
  • Interpolate trace position (x, y, z) from known positions: interpPos()
  • Estimate shift between two parallel profiles: shiftEst()

GPR data analysis and processing

GPR data analysis and transforms

  • Trace amplitude: ampl(), plot trace amplitude: plotAmpl()
  • Average trace: traceAverage()
  • Spectrum (f-x and f-k): spec(x, type = c("f-x", "f-k"))
  • Structure tensor: strTensor(), plot structure tensor: plotTensor()

GPR data interpolation

  • Trace interpolation at regularly spaced positions: regInterpPos()
  • Upsampling (time and position): upsample()
  • Relative position on the radargramm: relPos()

GPR signal correction

  • DC-shift correction: dcshift()
  • Low-frequency ('wow') component removal: dewow() (type = "MAD", "Gaussian")
  • First-break picking: firstBreak() (method = "coppens", "threshold", "MER")
  • Shift the traces vertically such that they start at time zero: time0Cor()
  • Constant offset time correction: timeCorOffset()

GPR signal attenuation compensation (gain)

  • Linear, power, exponential, ang agc gain: gain() (type = "power", "exp", "agc")

GPR signal enhancement

  • Clip the GPR signal values: clip()
  • Gamma correction of the GPR signal values: gammaCorrection()
  • Trace scaling: traceScaling()
  • Trace filters (1D): filter1D(): type = "median", "hampel", "Gaussian"
  • Radargramm filters (2D): filter2D(): type = "median3x3", "adimpro"
  • Trace frequency filter (1D): fFilter(): freqency filter, type = 'low','high','bandpass'
  • Frequency-wavenumber filter (2D): fkFilter()
  • Trace (1D) and radargramm (2D) convolution: conv1D() and conv2D()
  • Deconvolution: deconv() (type = "spiking", "wavelet", "min-phase", "mixed-phase")
  • Phase rotation rotatePhase()

GPR signal velocity

  • Common-mid point analysis (CMP): CMPAnalysis() (method = "semblance", "winsemblance", "wincoherence")
  • Normal Move-Out correction (NMO): NMOCor()

GPR data topographic correction and migration

  • Topography correction and topographic Kirchhoff migration: migration() (type = "static", "kirchhoff")

Generic processing functions

  • Apply many processing steps: papply()

GPR data delineation and mapping

  • delineate()
  • rmDelineations()<-
  • delineations()
  • addDelineation()
  • plotDelineations3D()
  • plotDelineations()
  • identifyDelineation()

Miscellaneous

  • Operators: +, -, *, /, ^
  • Mathematical functions: max(), min(), mean(), median(), summary(), range(), abs(), sign(), sqrt(), ceiling(), ...
  • Matrix functions: length(), nrow(), ncol(), dim()
  • Coercion: as.matrix(), as.numeric(), as.double(), as.list(), as.SpatialLines(), as.SpatialPoints()

Setter/getter functions

  • depthunit() & depthunit()<-
  • description() & description()<-
  • ann() & ann()<-
  • coord() & coord()<-
  • crs() & crs()<-
  • fid() & fid()<-
  • filepath() & filepath()<-
  • pos() & pos()<-
  • posunit() & posunit()<-
  • proc<-() & processing
  • name() & name()<-
  • values() & values()<-
  • vel() & vel()<-
  • gethd()
  • svDate() & svDate()<-

List of the functions from the class GPR

library(RGPR)
mtext <-  showMethods(class="GPR", printTo =FALSE )
i <- grepl('Function', mtext) & grepl('package RGPR', mtext) 
fvec <- gsub( "Function(\\:\\s|\\s\\\")(.+)(\\s\\(|\\\")(.+$)", "\\2", mtext[i] )
fvec

List of the functions from the class GPRsurvey

library(RGPR)
mtext <-  showMethods(class="GPRsurvey", printTo =FALSE )
i <- grepl('Function', mtext) & grepl('package RGPR', mtext) 
gvec <- gsub( "Function(\\:\\s|\\s\\\")(.+)(\\s\\(|\\\")(.+$)", "\\2", mtext[i] )
gvec

Incomplete overview of the RGPR-package

?RGPR

Contributions

Thanks to:

  • @jmerc13

rgpr's People

Contributors

emanuelhuber avatar guifh avatar jlasky avatar pmlefeuvre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rgpr's Issues

White line in the plot

Hi everybody,

I'm trying to understand what the white line on the plot means.

[url=https://imgbb.com/][img]https://i.ibb.co/5xFvhMD/Bildschirmfoto.png[/img][/url]

I put a red arrow at about 3 ns on the left side of the plot.
There is any explanation about the meaning of the white line? I couldn't find anything on github.

Another question: it seems that the speed of light is going to be calculated every time I plot something. How it is calculated?

Many thanks

`timeCorOffset()`

  1. Replace "You must first define the antenna separation" by "You must first define the velocity model":

    if(is.null(x@vel) || length(x@vel)==0){
      stop("You must first define the antenna separation",
            "with `vel(x)<-...`!")
    }
  2. Set antsep to zero because the traces were "virtually recorded without offset".

Error While Reading .DZT File

Dear Mr. Emanuel Huber,

While reading the .dzt file using your RGPR codes, I received the below error:

Error in UseMethod("xmlValue") :
no applicable method for 'xmlValue' applied to an object of class "list"

I would appreciate if you could help to debug this.

Thank you very much!

RD3 data not properly imported

First, thanks for the package!

I am trying to import Mala data (.rd3), but have found that the resulting data (650 stacks) are just the same stack repeated over and over again. I've tried looking at the underlying code via: getMethod("readGPR", signature = c(fPath="character")) and RGPR:::readRD3. I get stuck debugging on lines 17 and 18: nTr <- .getHD(hRAD, "LAST TRACE") and nPt <- .getHD(hRAD, "SAMPLES"). I don't know enough about the details of R (or the S4 method) to know what the dot in front of the function getHD() means, or how to access its behavior. If you have suggestions I might be able to figure out how to do pull request and suggest a change to the code.

Cheers!

Reading Sensors & Software GPZ files

So pleased to see an open-source alternative to GPR data processing. I was just curious if you have thought about adding the ability to read Sensors and Software files with a .GPZ extension? I'm familiar with their .hd and .DT1 files, but wasn't sure if it would be possible to read the newer GPZ files.

migration without coordinates

To apply the Kirchhoff migration, you need to set coordinates to your GPR data. Here is how you can do that:

#------------------------------------------------------#

read GPR data

x <- readGPR("myfile.rd3")

#------------------------------------------------------#

define the coordinates

xCoords <- pos(x)
yCoords <- rep(0, ncol(x)) # set to zero
zCoords <- rep(0, ncol(x)) # set to zero

#------------------------------------------------------#

set the coordinates

coord(x) <- cbind(xCoords, yCoords, zCoords) # that creates a nx3 matrix

#------------------------------------------------------#

run the Kirchhoff migration

...

Function firstBreakToTime0() not clear

In the website about the time correction is reported that:

Here we define
t0=tfb−a/c0(1)

where a is the distance between the transmitter and receiver and c0 is the wave velocity in the media between the transmitter and receiver (in our case, air)

but then the function firstBreakToTime0() is called using the data x :

t0 <- firstBreakToTime0(tfb, x)

So now the question. Is x passed as argument the distance a between Tx and Rx? Or is x the scan data read using the function readGPR() ?

I tried both and I found out that:
putting the distance between Tx and Rx (in my case 0.08 m), I get:

Fehler in firstBreakToTime0(tfb, 0.08) :
versuche einen Slot "antsep" von einem Objekt der einfachen Klasse ("numeric") ohne Slots anzufordern

putting the scan data read by readGPR() I get an useful t0 but to me it doesn't make the explanation above any sense

Thanks!

Hope to know more about the algorithm behind the hyperbola fitting

Dear Mr. Emanuel Huber,

Thanks so much for creating this! It helps me a lot.

I desperately want to know the math / algorithm behind the hyperbola fitting. Cuz I've been doing research on hyperbolic fitting. Is it the hough transform, neural networks or algorithm based on orthogonal distance? Could you please explain me the details of how this function( hyperbolaFit() ) is implemented? Or could you please tell me what books or literature referred to this function?

Hoping to hear from you soon!
Best wishes!

Sincerely,
hhhhappyyyy

Antenna separation GSSI Structure Scan XT device

Anyway I have some real data files from a GSSI Structure Scan XT device
(here attached). To me the antenna separation should be about 80 mm in that
device.
But importing datas I get 0:

 str(x1)
 Formal class 'GPR' [package "RGPR"] with 29 slots
   ..@ version     : chr "0.2"
   ..@ data        : num [1:510, 1:903] 0.00041 0.000358 0.00031 0.000349
 0.000295 ...
   ..@ traces      : int [1:903] 1 2 3 4 5 6 7 8 9 10 ...
   ..@ depth       : num [1:510] 0 0.00803 0.01607 0.0241 0.03214 ...
   ..@ pos         : num [1:903] 0 0.00125 0.0025 0.00375 0.005 ...
   ..@ time0       : num [1:903] 0 0 0 0 0 0 0 0 0 0 ...
   ..@ time        : num [1:903] 1.43e+09 1.43e+09 1.43e+09 1.43e+09
 1.43e+09 ...
   ..@ fid         : chr [1:903] "" "" "" "" ...
   ..@ ann         : chr(0)
   ..@ coord       : logi[0 , 0 ]
   ..@ rec         : logi[0 , 0 ]
   ..@ trans       : logi[0 , 0 ]
   ..@ coordref    : num(0)
   ..@ freq        : num 0
   ..@ dz          : num 0.00803
   ..@ dx          : num 0.00125
   ..@ antsep      : num 0
   ..@ name        : chr "FILE__008"
   ..@ description : chr ""
   ..@ filepath    : chr "rawGPR/FILE__008.DZT"
   ..@ depthunit   : chr "ns"
   ..@ posunit     : chr "cm"
   ..@ surveymode  : chr "reflection"
   ..@ date        : chr "2015-03-05"
   ..@ crs         : chr(0)
   ..@ proc        : chr(0)
   ..@ vel         :List of 1
   .. ..$ : num 0.12
   ..@ delineations: list()
   ..@ hd          :List of 24
   .. ..$ TAG       : int 2047
   .. ..$ OFFSETDATA: num 131072
   .. ..$ NSAMP     : int 512
   .. ..$ BITS      : int 32
   .. ..$ ZERO      : int 3
   .. ..$ SPS       : num 250
   .. ..$ SPM       : num 800
   .. ..$ MPM       : num 5
   .. ..$ POSITION  : num -0.411
   .. ..$ RANGE     : num 4.11
   .. ..$ NPASS     : int 0
   .. ..$ DATE      : chr "2015-03-05"
   .. ..$ TIME      : chr "27:01:00"
   .. ..$ OFFSETTEXT: int 512
   .. ..$ NTEXT     : int 0
   .. ..$ PROC      : int 128
   .. ..$ NPROC     : int 13
   .. ..$ NCHAN     : int 1
   .. ..$ EPSR      : num 6
   .. ..$ TOP       : num 0.0246
   .. ..$ DEPTH     : num 0.246
   .. ..$ ANT       : chr "none"
   .. ..$ VSBYTE    : int 28672
   .. ..$ MRKS      : int [1:903] 0 0 0 0 0 0 0 0 0 0 ..
```.
could be that not every device is going to write that parameter into the
file?
Which measure unit has that parameter? Meter [m] or millimeter [mm]. In
other words: should I put there 0.08 or 80 if the antenna separation 80 mm
is?

Thank you very much.
Davide

Error on bits2volt function: using argument "nbits" while it says it was supposed to be "nBytes"

Hello Emanuel!

First of all, thank you so much for putting this library together. I am pretty sure that all the community appreciates it. A round of applause to you and contributors. 👏 👏 👏

It is my first time trying this library though. I have been using python for reading GSSI files, but I believe that few of the functions available here might be very useful to me. So I decided to give it a try. However, I experienced a couple of very interesting issues. I installed the library using devtools as suggested. First issue I found was a problem similar to what was reported HERE, but restarting R fixed it. I do not believe it is an issue related to your library.

The other issue happened after installation when I was trying to open a GSSI DZT file. R produced the following error:

Error in bits2volt(Vmax = Vmax, nbits = x$hd$BITS) : unused argument (nbits = x$hd$BITS)

I found it kinda interesting so I did some digging. It seems that that instead of nbits the function should use nBytes. But what is weird the most is that in the global.R file you have in the repo, it does say 'nbits' (which is also stated on the function Description). On the other hand, when I do '?bits2volt' in my machine it list this specific argument as 'nBytes'.

It might be an issue with GitHub. The easiest solution I found was to I download the zip and follow THIS stack overflow answer, which ends up being:

unzip("path to zip")
file.rename("RGPR-master", "RGPR")
shell("R CMD build RGPR")
install.packages("RGPR_0.0.7.tar.gz", repos = NULL)

It worked for me. This might be a one time thing. But just in case you want to look into or if anyone else encounters the same problems, I am leaving this here!

Cheers!

Possible misunderstranding in the tutorial

Thank for your reply. That's clear the question.

But I found another possible misunderstanding regarding the function dewow()
In the wiki it is reported that:

Dewow

Remove the low-frequency components (the so-called “wow”) of the GPR record using:

a running median filter (type = "runnmed")
a running mean filter (type = "runmean")
a Gaussian filter (type = "Gaussian")

For the two first cases, the argument w is the length of the filter in time units.

But looking at the help

?dewow

I get:

w [numeric(1)] If type = runmed, MAD or runmean, window length of the filter in trace unit; If type = Gaussian, standard deviation in trace unit. If w = NULL, w is estimated as five times the wavelength corresponding to the maximum frequency of x (estimated with spec)

Now it is not clear to me what w should be.

Let's say I have in my function w = 5 (time unit [ns]).
Does it mean that the window length of the filter goes from 0 ns to 5 ns all over the traces?
Or does it mean, that the window length of the filter for every n trace [n-5, n-4, n-3, ...0, n+1, n+2,.., n+5] goes from 0 ns till the end of the vertical time windows?

Regards

Originally posted by @wilhem in #33 (comment)

Possible misunderstanding in the tutorial

Hi Emanuel,

according to the output of the function str(), you should get the parameter dz, which is the sampling rate of the radar

> str(A)
Formal class 'GPR' [package "RGPR"] with 29 slots
  
  ..@ dz          : num 0.00893   # Sampling rate

But in the migration section dz is the vertical resolution and its unit is "m"

Topographic Kirchhoff migration.
Vertical resolution of the migrated data, we set dz = 0.01m.

Is it just a coincidence and dz means two different things? Or they are the same thing and dz is the sampling rate even in the second case?

GPRsurvey::reverse()

TODO:
reverse data according to

  • their names: XLINE / YLINE / XYLINE
  • id (reverse(x, id = c(2, 5, 9))
  • arg. "zigzag" (equivalent to reverse(x, id = c(seq(1, length.out = length(x), by = 2))
  • orientation of the data

interger or integer

Possible coding error in readIDS.R

lines 78 through 88 refer to "interger" rather than "integer" which is throwing an error when run.

Object 'fdo' not found

Trying to estimate the fresnel zone I get the following error:

spec2D(x4):fdo
Fehler: Objekt 'fdo' nicht gefunden
spec(x4):fdo
Fehler: Objekt 'fdo' nicht gefunden

The issue arises even using the method spec2D() instead of spec().
Any idea, how to fix it?
Thanks

Taking the firstBreak() function inspect

Dear Emanuel,

I was taking a look to the function:firstBreak()
and found something "strange".

Let's say I have the following signal (1D plot) from my device:

Test_plot

As you can see the signal is going to cross the +/- 0.005 mV lines (just image them parallel to the time axis ;) ) in the time window from 0 to 1 ns.

Running the function firstBreak() as following:

firstBreak(x1, w = 1.5, method = "threshold", thr = 0.005 )

I would expect that, since thr = 0.005, the output of this function should be something like (for the trace on the picture):
t1 ~= 0.3 ns (for +0.005 mV)
t2 ~= 0.6 ns (for -0.005 mV)

But I get only a vector with all Zeros (for all traces)....

Rising the value of thr up to 0.5:

firstBreak(x1, w = 1.5, method = "threshold", thr = 0.5 )

I get a vector like [0.423, 0.441, 0.448 ..] anyway... not Zero.

That's really strange to me, since, as the 1D plot shows, the signal is never crossing the +/-0.5mV lines....

Why rising the threshold I get useful values from the function?

Many many thanks

code cleanup recommendation

At the top of fitHyperbola, you do a check on the dimensions of x. (when y= NULL). May I suggest instead using the function grDevices::xy.coords instead? It's a bit cleaner.

Problem installing RGPR

Hi guys,

I need to install the tool on my ubuntu 18.10 system. But I get the following error:

> devtools::install_github("emanuelhuber/RGPR")
Downloading GitHub repo emanuelhuber/RGPR@master
Skipping 1 packages not available: XML
Installing 41 packages: sp, rgdal, rgeos, signal, colorspace, Cairo, rgl, mmand, e1071, plot3D, adimpro, raster, fields, MBA, geojsonsf, sf, XML, checkmate, RConics, robfilter, httpuv, xtable, sourcetools, fastmap, shiny, miniUI, webshot, dotCall64, rapidjsonr, DEoptimR, manipulateWidget, misc3d, awsMethods, spam, maps, jsonify, sfheaders, classInt, DBI, units, robustbase
Installing packages into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
Fehler: Failed to install 'RGPR' from GitHub:
  (converted from Warning) package ‘XML’ is not available (for R version 3.6.3)

What did I do wrong?

Changing axes from time to distance

Is there an official way to change the axes from time to distance? The input format is GSSI. Each of my dzt files has an accompanying dzx file, which contains information like this:

<?xml version="1.0" encoding="UTF-8"?>
<DZX xmlns="www.geophysical.com/DZX/1.02">
<GlobalProperties>
   <verticalUnit>in</verticalUnit>
   <horizontalUnit>in</horizontalUnit>
   <dielectric>6.500000</dielectric>
</GlobalProperties>
<DataCollection>
   <system>SS_MINI</system>
   <antennaType>HiRes</antennaType>
   <WheelSize>NORMAL</WheelSize>
   <softwareVersion>1 4 4 0</softwareVersion>
   <collectionMode>2D</collectionMode>
   <sLastUpdateDate>MAR_7_2023</sLastUpdateDate>
   <sLastUpdateTime>10:42:12</sLastUpdateTime>
   <BaseGain>13.500000</BaseGain>
   <BaseGainAdj>0.100000</BaseGainAdj>
   <TrOffset>36757</TrOffset>
   <dielectricMethod>0</dielectricMethod>
   <Ctable>3</Ctable>
   <Xtable>2</Xtable>
</DataCollection>
</DZX>

It says the vertical and horizontal units are in, but I think the time units in the default plot are correct. I can't find an API in RGPR that helps with unit conversion.

Import GPR data link is broken

On the Readme.md file the Import GPR data link is broken

See tutorial [Import GPR data](http://emanuelhuber.github.io/RGPR/00_RGPR_import_data/).

Thanks!

TC

Plot contrast settings

Is there a way to change the contrast of the data points? It is difficult to see some of the lines in the plot using the RGPR library, but I don't have the same issue with commercial software. I'm not sure if there are other factors at play or what I could be doing differently. Here is an example of the RGPR output:

image

Request for Support: Adding Support for Easy Radar USA's .gpr Format

Dear Mr. Emanuel,

I hope this message finds you well. I am writing to request your assistance in implementing support for the .gpr format radar files generated by Easy Radar USA, a company specializing in radar solutions.

Our team is currently working on a project that involves analyzing radar data, and we have recently started using Easy Radar USA's equipment. However, we have encountered a challenge as our existing tools and software do not have built-in support for the .gpr format.

Best regards,

fengzireng
2023214173934.zip

I can't import data

I am trying to import MALA GPR data (*.rd3 format) through

library(RGPR)
x <- readGPR(dsn = "erickprueba250mhz10.rd3")

but I got

Error in matrix(NA, nrow = npt, ncol = ntr) :
invalid 'ncol' value (too large or NA)
In addition: Warning message:
In strsplit(headRAD[i], ":") : input string 1 is invalid in this locale

I dont know what is wrong with that. I am sending the files, if you can help me with that.

erickprueba250mhz10.zip

Marcel

Horizontal resolution

Hello, I'm having difficulty setting the display of files, especially the horizontal resolution. The file opens well but it is stretched over the entire length of the window whereas I would like the scan density, for example 4 scans/cm or 8 scans/cm (indicated in the GSSI's DZX files for an XT for example) to be respected. I don't know if RGPR is capable of displaying a file of several meters (30m)? I would like the display to be 6 meters long and if the file is larger then it will need to be scrolled with the mouse or click on a scroll bar. I have been stuck on this issue for a long time and I have not found any information. Thank in advance..

Can't read .dt1 files

I'm having issues reading some Sensors and Software dt1 files. They were extracted from the newer GPZ format (just a renamed zip file). The profiles look fine in pulseEKKO so the data is ok. The HD file looks normal, as far as I can tell. RGPR, GPRpy and RADAN (version 6 so quite old) will open the file with no problem but the plots are nonsense. I've attached an example line for investigation.
liney47.zip

Typo: ascci2num should be ascii2num

hd$sweep_marker_1 <- ascci2num(dsn, 6)

I write mostly in python so I'm not 100% sure if I'm reading this correctly, but I believe that there is an error in the function call ascci2num which appears on lines 38 and 90 in the readIDS.R code.

It is referenced elsewhere as ascii2num

package ‘rgpr’ is not available for this version of R (4.0.x)

Hi,
I have just found out that the master version of rgpr is not available on R v4.04. The link below hints that parts of the compiled code is tied to R 3.6.x and not R 4.0.x. The dev version can be installed with:

library(devtools)
dev_mode(on=T)
install_github("emanuelhuber/RGPR")

On my newly 11.2.2 OSX the dev version first failed to install the library e1071 and sf, which got fixed by updating my xcode and gdal (due to my recent upgrade):
xcode-select --install
brew update gdal

Cheers,
PiM

Master version warnings

> install.packages('rgpr')
Warning in install.packages :
  package ‘rgpr’ is not available for this version of R

A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages

Dev version: error library e1071

> library(devtools)
Loading required package: usethis
> dev_mode(on=T)
Dev mode: ON
d> install_github("emanuelhuber/RGPR")
Downloading GitHub repo emanuelhuber/RGPR@HEAD
Installing 41 packages: tidyselect, generics, cpp11, dplyr, isoband, gtable, DEoptimR, proxy, e1071, geometries, rapidjsonr, dotCall64, data.table, tidyr, ggplot2, robustbase, backports, units, DBI, classInt, sfheaders, jsonify, maps, spam, awsMethods, misc3d, plotly, robfilter, RConics, checkmate, XML, sf, geojsonsf, MBA, fields, adimpro, plot3D, mmand, Cairo, signal, rgeos
Installing packages into ‘/Users/pmlefeuv/R-dev’
(as ‘lib’ is unspecified)

  There are binary versions available but the source versions are later:
      binary source needs_compilation
e1071  1.7-5  1.7-6              TRUE
sf     0.9-7  0.9-8              TRUE

Do you want to install from sources the packages which need compilation? (Yes/no/cancel) Yes
[...]
installing the source packages ‘e1071’, ‘sf’
[...]
* installing *source* package ‘e1071’ ...
** package ‘e1071’ successfully unpacked and MD5 sums checked
** using staged installation
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
checking for g++... g++
checking for C++ compiler default output file name... configure: error: C++ compiler cannot create executables
See `config.log' for more details.
ERROR: configuration failed for package ‘e1071’
* removing ‘/Users/pmlefeuv/R-dev/e1071’
Error: Failed to install 'RGPR' from GitHub:
  (converted from warning) installation of package ‘e1071’ had non-zero exit status

2nd attempt: gdal error

[...]
* installing *source* package ‘sf’ ...
** package ‘sf’ successfully unpacked and MD5 sums checked
** using staged installation
configure: CC: clang
configure: CXX: clang++ -mmacosx-version-min=10.13 -std=gnu++11
checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘sf’
* removing ‘/Users/pmlefeuv/R-dev/sf’
Error: Failed to install 'RGPR' from GitHub:
  (converted from warning) installation of package ‘sf’ had non-zero exit status

Plateform OSX 11.2.2 and
R version 4.0.4 (2021-02-15) -- "Lost Library Book"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin17.0 (64-bit)

Is the dielectric value in dzx files used?

I see how the dzx/dzt files are parsed, especially the global properties, at this line. It doesn't look like the dielectric value is used in RGPR, but I figured I should ask just in case I am missing it. If it is not used, is there a reason why? Perhaps it is assumed the user will do something with the dielectric value before or after the data has been processed by RGPR. Any help would be appreciated.

Error While Fitting Hyperbola

Dear Mr. Emanuel Huber,
While fitting hyperbola using your RGPR codes, I received the below error:

hyp <- hyperbolaFit(xy)
Warning message:
In sqrt(1/coef1[2]) : NaNs produced

I would appreciate if you could help to debug this.
Thank you very much!

Best wish,
hhhhappyyyy

Can't read .rd7 files.

Whenever I try to read .rd7 files, I get this error.

Error in if (ntr * npt != fileLength) { : argument is of length zero In addition: Warning message: In scan(dsn, what = character(), strip.white = TRUE, quiet = TRUE, : embedded nul(s) found in input

RGPR has been really helpful for some older .rd3 files, kudos to you for that Emanuel.

However, as of now, some rd3 files give this error.

Error in if (ntr * npt != fileLength) { : argument is of length zero
In addition: Warning message:
In scan(dsn, what = character(), strip.white = TRUE, quiet = TRUE, :
embedded nul(s) found in input

Header definition problem in readIDS.r

Thanks for the quick attension to the interger typo bug I noted.

Seems to be another issue in the actual routine however as I am now getting a header error.

x <- readGPR(dsn = "LID10001.dt", verbose = TRUE)
'R' not yet implemented!
Error in DDhd1[i] <- readBin(dsn, what = integer(), n = 1, size = 2) :
replacement has length zero.

I have attached the IDS file I am reading in as my guess is there is a formatting difference between the IDS file and what the routine is expecting.

Regards

Neil

LID10001.dt.zip

Read/import GPR data in DT1 format

Hi there, what is the main steps to read my own GPR data in DT1 format?
I have using the function "readGPR()" to import GPR data into R, but I cann't clearly understand what I should do.
Can you please provides me the main steps to importing and reading my data?
Also, it is says: Error in readGPR(line1.DT1) : could not find function "readGPR" when I am typing (readGPR(line1.dt1)
Thank you.

Topography and time to depth conversion

Hi @emanuelhuber ,

thanks for such needed package.
I have a question regarding coordinates addition and time to depth conversion.
1- It is possible to use another velocity, other than 0.1 m/ns, to convert to depth? if yes, how? if not, will this tool be available soon?
2- I have some GPR lines with GPS measurements each ~5m. I understand that I have to add this coordinates using readFID and then interpPos. I managed to do this steps but I can not plot the data with its corresponding topography, the following message appears:

plot(DCGh3, addTopo = TRUE)
Trace vertical position set to zero!
time to depth conversion with constant velocity (0.1 m/ns)
Error in v^2 : non-numeric argument for binary operator

Any thoughts on how to fix it?

Thanks! #

Slice Interpolation Issue

I'm having an issue interpolating horizontal GPR slices where no matter what value I use for 'h' I get identical results. I admit that I don't know R and have no idea how mba.surf() uses 'h', but I think this line in the GPRcube class may be the problem:

h = 6

getArgs() in traceShift()

Looks like there might be an issue with the function getArgs() in traceShift(). This error message only occurs when the traceShift() function is wrapped in another function. Everything is fine when I run the function alone. I couldn't figure out what is the exact problem...

Error in FUN(X[[i]], ...) : object 't0' not found
FUN(X[[i]], ...) 
FUN(X[[i]], ...) 
lapply(X = X, FUN = FUN, ...) 
sapply(arg[3:narg], eval) 
getArgs() 
traceShift(A2, ts = (-t0), method = "cubic", crop = FALSE) 

rgdal and cairo error

ERROR: dependencies ‘rgdal’, ‘Cairo’ are not available for package ‘RGPR’

  • removing ‘/usr/local/lib/R/site-library/RGPR’
    Installation failed: Command failed (1)

plot `SGY` error

Today I used the same approach and found that drawing the image reported an error

input

library(RGPR)
search()
x <- readGPR(dsn = "~/Recordings/3.sgy")

print(x)
plot(x)

output

Don't hesitate to contact me if you have any question:
[email protected]

Attaching package: ‘RGPR’

The following object is masked from ‘package:graphics’:

    clip

Antenna frequency set to 0 MHz. Set it with 'antfreq(x) <- ... '
Antenna separation set to 0 m. Set it with 'antsep(x) <- ... '
*** Class GPR ***
 name        = 3
 filepath    = ~/Recordings/3.sgy
 description = 
 survey date = 2023-01-25
 reflection, 0 MHz, Window length = 49.64 ns, dz = 0.085 ns
 4559 traces, 4558 m
 ****************
Error in base::rowSums(x, na.rm = na.rm, dims = dims, ...) : 
  'x' must be an array of at least two dimensions

However, when I use plotFast it draws the image successfully!

I was able to use plot plotting normally on the day 2023-9-24, I didn't do anything during this period, I don't know what happened, please tell me what to do, thanks!
3.zip

Error in initialize(value, ...) : object 'velocity' not found

I am trying to read in .dt1 files from Sensors and Software that worked fine just a week or so ago, and I am getting the error message in the title. I have tried several different files, in RStudio, Colab, and Visual Studio code and got the same issue.
Here is the line of code that is throwing up the error

rawGPRData <- readGPR(dsn = gprPath)

I also tried it with the sample frenke data and had the same issue.

coords()<-

Bug in

coords(mySurvey) <- TOPOList

There is no check that the number of coordinates in TOPOList[[1]] is equal to the number of traces in mySurvey[[1]] !!! In other words:

if( nrow(TOPOList[[1]]) != ncol(mySurvey[[1]]) ) stop("error!")

Possible bug in the function spec()

Dear guys,

I recognize something that to me doesn't make any sense. Perhaps the function spec() needs to be checked again.

The problem is the following:
I load a dataset using:

A1 <- readGPR( dsn = filename, verbose = TRUE )

and then I apply the DCshift removal, dewow, and time zero correction. So I'm now at this step:

A4 <- time0Cor( A3, method = "linear" )

doing:

spec(A4)

I get the following spectrum:

Plot_1

As you can see the spectrum starts from 0 Hz, which is correct. The peak frequency is about 1500-2000 MHz, which is also correct.

Now let's do another step:

A5 <- timeCorOffset(A4)

which shifts all the traces to the zero.

Doing again the same command as before:

spec(A5)

I get the following spectrum:

Plot_2

Please note that in the second plot the frequency was shifted to zero! Now is the peak around 0 Hz, which doesn't make any sense. A time zero correction should move the time axis to 0, but the frequency should stay the same and not be changed through the time zero correction.
To me there should be a difference plotting:

plot(A4)
plot(A5)

but not plotting:


spec(A4)
spec(A5)

Am I wrong? Or the function spec() should be rechecked?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.