Intro to jeepr with gprMax data

jeepr is a set of utilities for handling GPR data, especially gprMax models and synthetics, and real data from USRadar instruments.


In [1]:
import numpy as np
import matplotlib.pyplot as plt
% matplotlib inline

In [2]:
import jeepr
jeepr.__version__


Out[2]:
'0.1.2'

Make Scan from a gprMax simulation .out file


In [6]:
from jeepr import Scan

g = Scan.from_gprmax('../tests/test_2D_merged.out')

In [7]:
g.__dict__


Out[7]:
{'domain': 'time',
 'dt': 1.1793271683748419e-11,
 'dx': 0.01,
 'dz': 0,
 'freq': 500000000.0,
 'log': ['loaded from out'],
 'meta': {'nrx': 1},
 'name': '',
 't0': 0.0,
 'x0': 0.1}

In [8]:
g.plot()



In [9]:
t0 = np.sqrt(2) / float(g.freq)
h = g.crop(t=t0)
h.plot()



In [10]:
h.shape


Out[10]:
(1118, 85)

In [11]:
h.log


Out[11]:
['loaded from out', 'crop at t = 2.83 ns']

Note, however, that the t0 of the section has been reset to 0 ns.


In [12]:
h.t0


Out[12]:
0.0

Let's look at a spectrum; it looks quite different from real data.


In [13]:
f, p = g.get_spectrum()

plt.plot(f, p)


Out[13]:
[<matplotlib.lines.Line2D at 0x1222a2cc0>]

Make Model from gprMax VTI file


In [14]:
from jeepr import Model

In [15]:
m = Model.from_gprMax('../tests/test_2D.in')

In [16]:
m.plot()



In [17]:
m.__dict__


Out[17]:
{'domain': 'depth',
 'dt': 0,
 'dx': 0.005,
 'dx_dy_dz': (0.005, 0.002, 0.005),
 'dz': 0.005,
 'materials': [{'name': 'pec', 'perm': 1.0, 'value': 0},
  {'name': 'free_space', 'perm': 1.000536, 'value': 1},
  {'name': 'soil', 'perm': 3.0, 'value': 2},
  {'name': 'concrete', 'perm': 7.0, 'value': 3}],
 'name': '',
 'npml': 10,
 'rx': {'name': 'Rx(20,200,0)', 'position': array([ 0.1,  0.4,  0. ])},
 'rx_steps': [0.01, 0.0, 0.0],
 't0': {},
 'tx': {'name': 'HertzianDipole(0,200,0)',
  'position': array([ 0. ,  0.4,  0. ]),
  'type': 'HertzianDipole'},
 'tx_steps': [0.01, 0.0, 0.0]}

In [18]:
ground = m.rx['position'][0]
n = m.crop(z=ground)
n.plot()


Plot Model and Scan together in time domain


In [19]:
n_time, _ = n.to_time(dt=5e-11)
n_time.plot()



In [20]:
fig = plt.figure(figsize=(16, 9))

ax0 = fig.add_subplot(111)
ax0 = h.plot(ax=ax0)
ax0 = n_time.plot(ax=ax0, alpha=0.5)

plt.show()


Plot Model and Scan together in depth

This doesn't make sense on an unmigrated gather.