Updates to get antenna models working with revised antenna library.

这个提交包含在:
Craig Warren
2019-10-31 14:27:22 +00:00
父节点 818d0e7866
当前提交 a0e7ff1fa1
共有 22 个文件被更改,包括 214 次插入323 次删除

查看文件

@@ -1,9 +0,0 @@
#title: GSSI 1.5GHz 'like' antenna in free-space
#domain: 0.250 0.188 0.220
#dx_dy_dz: 0.001 0.001 0.001
#time_window: 6e-9
#python:
from user_libs.antennas.GSSI import antenna_like_GSSI_1500
antenna_like_GSSI_1500(0.125, 0.094, 0.100, resolution=0.001)
#end_python:

查看文件

@@ -0,0 +1,35 @@
from pathlib import Path
import gprMax
from user_libs.antennas.GSSI import antenna_like_GSSI_1500
# File path for output
fn = Path(__file__)
# Discretisation
dl = 0.002
# Domain
x = 0.250
y = 0.188
z = 0.220
scene = gprMax.Scene()
title = gprMax.Title(name=fn.with_suffix('').name)
domain = gprMax.Domain(p1=(x, y, z))
dxdydz = gprMax.Discretisation(p1=(dl, dl, dl))
time_window = gprMax.TimeWindow(time=6e-9)
scene.add(title)
scene.add(domain)
scene.add(dxdydz)
scene.add(time_window)
# Import antenna model and add to model
gssi_objects = antenna_like_GSSI_1500(0.125, 0.094, 0.100, resolution=dl)
for obj in gssi_objects:
scene.add(obj)
# Run model
gprMax.run(scenes=[scene], geometry_only=False, outputfile=fn)

查看文件

@@ -1,48 +0,0 @@
#title: GSSI 1.5GHz antenna field patterns
#dx_dy_dz: 0.001 0.001 0.001
#pml_cells: 14
#python:
import os
import numpy as np
from gprMax.input_cmd_funcs import *
from user_libs.antennas.GSSI import antenna_like_GSSI_1500
filename = os.path.splitext(os.path.split(inputfile)[1])[0]
timewindows = np.array([4.5e-9]) # For 0.3m max
radii = np.linspace(0.1, 0.3, 20)
theta = np.linspace(3, 357, 60)
materials = ['5 0 1 0 er5'] # Can add more to list and use selector integer to choose
selector = 0
fs = np.array([0.040, 0.040, 0.040])
domain = np.array([2 * fs[0] + 0.170, 2 * fs[1] + 2 * radii[-1], 2 * fs[2] + 2 * radii[-1]])
antennaposition = np.array([domain[0] / 2, fs[1] + radii[-1], fs[2] + radii[-1]])
antenna_like_GSSI_1500(antennaposition[0], antennaposition[1], antennaposition[2])
print('#domain: {:.3f} {:.3f} {:.3f}'.format(domain[0], domain[1], domain[2]))
print('#time_window: {:.3e}'.format(timewindows[selector]))
## Can introduce soil model
#print('#soil_peplinski: 0.5 0.5 2.0 2.66 0.001 0.25 mySoil')
#print('#fractal_box: 0 0 0 {} {} {} 1.5 1 1 1 50 mySoil mySoilBox 1'.format(domain[0], domain[1], fs[2] + radii[-1]))
print('#material: {}'.format(materials[selector]))
print('#box: 0 0 0 {} {} {} {} n'.format(domain[0], domain[1], fs[2] + radii[-1], materials[selector].split()[-1]))
## Save the position of the antenna to file for use when processing results
np.savetxt(os.path.join(os.path.dirname(inputfile), filename + '_rxsorigin.txt'), antennaposition, fmt="%f")
## Generate receiver points for pattern
for radius in range(len(radii)):
## E-plane circle (yz plane, x=0, phi=pi/2,3pi/2)
x = radii[radius] * np.sin(theta * np.pi /180) * np.cos(90 * np.pi / 180)
y = radii[radius] * np.sin(theta * np.pi /180) * np.sin(90 * np.pi / 180)
z = radii[radius] * np.cos(theta * np.pi /180)
for rxpt in range(len(theta)):
print('#rx: {:.3f} {:.3f} {:.3f}'.format(x[rxpt] + antennaposition[0], y[rxpt] + antennaposition[1], z[rxpt] + antennaposition[2]))
geometry_view(0, 0, 0, domain[0], domain[1], domain[2], 0.001, 0.001, 0.001, filename, 'n')
#end_python:

查看文件

@@ -1,48 +0,0 @@
#title: GSSI 1.5GHz antenna field patterns
#dx_dy_dz: 0.001 0.001 0.001
#pml_cells: 14
#python:
import os
import numpy as np
from gprMax.input_cmd_funcs import *
from user_libs.antennas.GSSI import antenna_like_GSSI_1500
filename = os.path.splitext(os.path.split(inputfile)[1])[0]
timewindows = np.array([4.5e-9]) # For 0.3m max
radii = np.linspace(0.1, 0.3, 20)
theta = np.linspace(3, 357, 60)
materials = ['5 0 1 0 er5'] # Can add more to list and use selector integer to choose
selector = 0
fs = np.array([0.040, 0.040, 0.040])
domain = np.array([2 * fs[0] + 2 * radii[-1], 2 * fs[1] + 0.107, 2 * fs[2] + 2 * radii[-1]])
antennaposition = np.array([fs[0] + radii[-1], domain[1] / 2, fs[2] + radii[-1]])
antenna_like_GSSI_1500(antennaposition[0], antennaposition[1], antennaposition[2])
print('#domain: {:.3f} {:.3f} {:.3f}'.format(domain[0], domain[1], domain[2]))
print('#time_window: {:.3e}'.format(timewindows[selector]))
## Can introduce soil model
#print('#soil_peplinski: 0.5 0.5 2.0 2.66 0.001 0.25 mySoil')
#print('#fractal_box: 0 0 0 {} {} {} 1.5 1 1 1 50 mySoil mySoilBox 1'.format(domain[0], domain[1], fs[2] + radii[-1]))
print('#material: {}'.format(materials[selector]))
print('#box: 0 0 0 {} {} {} {} n'.format(domain[0], domain[1], fs[2] + radii[-1], materials[selector].split()[-1]))
## Save the position of the antenna to file for use when processing results
np.savetxt(os.path.join(os.path.dirname(inputfile), filename + '_rxsorigin.txt'), antennaposition, fmt="%f")
## Generate receiver points for pattern
for radius in range(len(radii)):
## H-plane circle (xz plane, y=0, phi=0,pi)
x = radii[radius] * np.sin(theta * np.pi /180) * np.cos(180 * np.pi / 180)
y = radii[radius] * np.sin(theta * np.pi /180) * np.sin(180 * np.pi / 180)
z = radii[radius] * np.cos(theta * np.pi /180)
for rxpt in range(len(theta)):
print('#rx: {:.3f} {:.3f} {:.3f}'.format(x[rxpt] + antennaposition[0], y[rxpt] + antennaposition[1], z[rxpt] + antennaposition[2]))
geometry_view(0, 0, 0, domain[0], domain[1], domain[2], 0.001, 0.001, 0.001, filename, 'n')
#end_python:

查看文件

@@ -1,9 +0,0 @@
#title: GSSI 400MHz 'like' antenna in free-space
#domain: 0.380 0.380 0.360
#dx_dy_dz: 0.001 0.001 0.001
#time_window: 12e-9
#python:
from user_libs.antennas.GSSI import antenna_like_GSSI_400
antenna_like_GSSI_400(0.190, 0.190, 0.140, resolution=0.001)
#end_python:

查看文件

@@ -0,0 +1,35 @@
from pathlib import Path
import gprMax
from user_libs.antennas.GSSI import antenna_like_GSSI_400
# File path for output
fn = Path(__file__)
# Discretisation
dl = 0.001
# Domain
x = 0.380
y = 0.380
z = 0.360
scene = gprMax.Scene()
title = gprMax.Title(name=fn.with_suffix('').name)
domain = gprMax.Domain(p1=(x, y, z))
dxdydz = gprMax.Discretisation(p1=(dl, dl, dl))
time_window = gprMax.TimeWindow(time=12e-9)
scene.add(title)
scene.add(domain)
scene.add(dxdydz)
scene.add(time_window)
# Import antenna model and add to model
gssi_objects = antenna_like_GSSI_400(0.190, 0.190, 0.140, resolution=dl)
for obj in gssi_objects:
scene.add(obj)
# Run model
gprMax.run(scenes=[scene], geometry_only=False, outputfile=fn)

查看文件

@@ -1,9 +0,0 @@
#title: MALA 1.2GHz 'like' antenna in free-space
#domain: 0.264 0.189 0.220
#dx_dy_dz: 0.001 0.001 0.001
#time_window: 6e-9
#python:
from user_libs.antennas.MALA import antenna_like_MALA_1200
antenna_like_MALA_1200(0.132, 0.095, 0.100, 0.001)
#end_python:

查看文件

@@ -0,0 +1,35 @@
from pathlib import Path
import gprMax
from user_libs.antennas.MALA import antenna_like_MALA_1200
# File path for output
fn = Path(__file__)
# Discretisation
dl = 0.002
# Domain
x = 0.264
y = 0.189
z = 0.220
scene = gprMax.Scene()
title = gprMax.Title(name=fn.name)
domain = gprMax.Domain(p1=(x, y, z))
dxdydz = gprMax.Discretisation(p1=(dl, dl, dl))
time_window = gprMax.TimeWindow(time=6e-9)
scene.add(title)
scene.add(domain)
scene.add(dxdydz)
scene.add(time_window)
# Import antenna model and add to model
gssi_objects = antenna_like_MALA_1200(0.132, 0.095, 0.100, resolution=dl)
for obj in gssi_objects:
scene.add(obj)
# Run model
gprMax.run(scenes=[scene], geometry_only=False, outputfile=fn)

查看文件

@@ -1,53 +0,0 @@
#python:
from gprMax.input_cmd_funcs import *
command('title', 'A or B scan from a metal cylinder buried in a dielectric half-space')
z_dim = 0.002
resolution = 0.002
tsim = 3e-9
B_scan = False
domain = domain(x=64e-2, y=30e-2, z=z_dim)
dx = dx_dy_dz(resolution, resolution, z_dim)
time_window(tsim)
material(permittivity=6, conductivity=0,
permeability=1, magconductivity=0, name='half_space')
identifier = waveform('ricker', amplitude=1, frequency=1.5e9,
identifier='my_ricker')
if B_scan:
x_ant = 8e-2
else:
x_ant = domain.x/2 - 1e-2 # in the middle of the x-axis
tx = hertzian_dipole('z',
x_ant, domain.y - 4e-2, 0, # minus 4 cm in y-direction
identifier)
rx(tx.x + 2e-2, tx.y, tx.z) # 2 cm away in x-direction from tx
if B_scan:
src_steps(dx=0.8e-2/4)
rx_steps(dx=0.8e-2/4)
b0, b1 = box(0, 0, 0,
domain.x, domain.y - 4e-2, z_dim, # same as domain, minus 4 cm in y-direction
'half_space')
c_x, c_y = (domain.x/2, b1.y - 5e-2) # in the middle of the x-axis and 5 cm down from the half_space
cylinder(c_x, c_y, 0,
c_x, c_y, z_dim,
radius=1e-2, material='pec')
# Outputs, geometry and snapshots
geometry_view(0, 0, 0,
domain.x, domain.y, domain.z,
dx.x, dx.y, dx.z,
'cylinder', 'n')
N = 32
for i in range(1, N+1):
snapshot(0, 0, 0,
domain.x, domain.y, domain.z,
dx.x, dx.y, dx.z, i*(tsim/N), 'snapshot' + str(i))
#end_python:

查看文件

@@ -1,16 +0,0 @@
#title: B-scan from a metal cylinder buried in a dielectric half-space with a GSSI 1.5GHz 'like' antenna
#domain: 0.480 0.148 0.235
#dx_dy_dz: 0.001 0.001 0.001
#time_window: 6e-9
#material: 6 0 1 0 half_space
#box: 0 0 0 0.480 0.148 0.170 half_space
#cylinder: 0.240 0 0.080 0.240 0.148 0.080 0.010 pec
#python:
from user_libs.antennas.GSSI import antenna_like_GSSI_1500
antenna_like_GSSI_1500(0.105 + current_model_run * 0.005, 0.074, 0.170, 0.001)
#end_python:
geometry_view: 0 0 0 0.480 0.148 0.235 0.001 0.001 0.001 cylinder_GSSI_1500 n

查看文件

@@ -1,42 +0,0 @@
import gprMax
# single objects
dxdydz = gprMax.Discretisation(p1=(1e-3, 1e-3, 1e-3))
messages = gprMax.Messages(yn='y')
tw = gprMax.TimeWindow(time=6e-9)
domain = gprMax.Domain(p1=(0.15, 0.15, 0.1))
title = gprMax.Title(name='Heterogeneous soil using a stochastic distribution of dielectric properties given by a mixing model from Peplinski')
waveform1 = gprMax.Waveform(wave_type='ricker', amp=1, freq=1.5e9, id='my_ricker')
dipole = gprMax.HertzianDipole(p1=(0.045, 0.075, 0.085), polarisation='y', waveform_id='my_ricker')
sp = gprMax.SoilPeplinski(sand_fraction=0.5,
clay_fraction=0.5,
bulk_density=2.0,
sand_density=2.66,
water_fraction_lower=0.001,
water_fraction_upper=0.25,
id='my_soil')
fb = gprMax.FractalBox(p1=(0, 0, 0), p2=(0.15, 0.15, 0.070), frac_dim=1.5, weighting=[1, 1, 1], n_materials=50, mixing_model_id='my_soil', id='my_soil_box')
asf = gprMax.AddSurfaceRoughness(p1=(0, 0, 0.070), p2=(0.15, 0.15, 0.070), frac_dim=1.5, weighting=[1, 1], limits=[0.065, 0.080], fractal_box_id='my_soil_box')
gv = gprMax.GeometryView(p1=(0, 0, 0), p2=(0.15, 0.15, 0.1), dl=(0.001, 0.001, 0.001), filename='heterogeneous_soil', output_type='n')
rx = gprMax.Rx(p1=(0.045, 0.075 + 10e-3, 0.085))
scene = gprMax.Scene()
scene.add(dxdydz)
scene.add(messages)
scene.add(tw)
scene.add(domain)
scene.add(title)
scene.add(waveform1)
scene.add(dipole)
scene.add(sp)
scene.add(fb)
scene.add(asf)
scene.add(gv)
scene.add(rx)
gprMax.run(scenes=[scene], n=1, geometry_only=False, outputfile='mysimulation')