From 818d0e7866b3287e6190be6d304ee337a379378d Mon Sep 17 00:00:00 2001 From: Craig Warren Date: Mon, 28 Oct 2019 17:09:26 +0000 Subject: [PATCH] Updating antenna model libs to use API. --- user_libs/antennas/GSSI.py | 866 +++++++++++++++++++++++-------------- user_libs/antennas/MALA.py | 466 +++++++++++++++----- 2 files changed, 886 insertions(+), 446 deletions(-) diff --git a/user_libs/antennas/GSSI.py b/user_libs/antennas/GSSI.py index 26ca6fb6..2f95b0a3 100644 --- a/user_libs/antennas/GSSI.py +++ b/user_libs/antennas/GSSI.py @@ -5,20 +5,31 @@ # # Please use the attribution at http://dx.doi.org/10.1190/1.3548506 - +import gprMax from gprMax.exceptions import CmdInputError -from gprMax.input_cmd_funcs import * -def antenna_like_GSSI_1500(x, y, z, resolution=0.001, rotate90=False): - """Inserts a description of an antenna similar to the GSSI 1.5GHz antenna. Can be used with 1mm (default) or 2mm spatial resolution. The external dimensions of the antenna are 170x108x45mm. One output point is defined between the arms of the receiver bowtie. The bowties are aligned with the y axis so the output is the y component of the electric field (x component if the antenna is rotated 90 degrees). +def antenna_like_GSSI_1500(x, y, z, resolution=0.001): + """Inserts a description of an antenna similar to the GSSI 1.5GHz antenna. + Can be used with 1mm (default) or 2mm spatial resolution. The external + dimensions of the antenna are 170x108x45mm. One output point is defined + between the arms of the receiver bowtie. The bowties are aligned with + the y axis so the output is the y component of the electric field. Args: - x, y, z (float): Coordinates of a location in the model to insert the antenna. Coordinates are relative to the geometric centre of the antenna in the x-y plane and the bottom of the antenna skid in the z direction. + x, y, z (float): Coordinates of a location in the model to insert the + antenna. Coordinates are relative to the geometric + centre of the antenna in the x-y plane and the + bottom of the antenna skid in the z direction. resolution (float): Spatial resolution for the antenna model. - rotate90 (bool): Rotate model 90 degrees CCW in xy plane. + + Returns: + scene_objects (list): All model objects that will be part of a scene. """ + # All model objects that will be returned by function + scene_objects = [] + # Antenna geometry properties casesize = (0.170, 0.108, 0.043) casethickness = 0.002 @@ -30,14 +41,6 @@ def antenna_like_GSSI_1500(x, y, z, resolution=0.001, rotate90=False): bowtieheight = 0.014 patchheight = 0.015 - # Set origin for rotation to geometric centre of antenna in x-y plane if required, and set output component for receiver - if rotate90: - rotate90origin = (x, y) - output = 'Ex' - else: - rotate90origin = () - output = 'Ey' - x = x - (casesize[0] / 2) y = y - (casesize[1] / 2) @@ -60,56 +63,100 @@ def antenna_like_GSSI_1500(x, y, z, resolution=0.001, rotate90=False): # Specify optimisation state of antenna model optstate = ['WarrenThesis', 'DebyeAbsorber', 'GiannakisPaper'] - optstate = optstate[0] + optstate = optstate[1] if optstate == 'WarrenThesis': # Original optimised values from http://hdl.handle.net/1842/4074 excitationfreq = 1.71e9 sourceresistance = 230 # Correction for old (< 123) GprMax3D bug (optimised to 4) rxres = 925 # Resistance at Rx bowtie - material(1.58, 0.428, 1, 0, 'absorber1') - material(3, 0, 1, 0, 'absorber2') # Foam modelled as PCB material - material(3, 0, 1, 0, 'pcb') - material(2.35, 0, 1, 0, 'hdpe') - material(3, (1 / rxres) * (dy / (dx * dz)), 1, 0, 'rxres') + absorber1 = gprMax.Material(er=1.58, se=0.428, mr=1, sm=0, id='absorber1') + absorber2 = gprMax.Material(er=3, se=0, mr=1, sm=0, id='absorber2') # Foam modelled as PCB material + pcb = gprMax.Material(er=3, se=0, mr=1, sm=0, id='pcb') + hdpe = gprMax.Material(er=2.35, se=0, mr=1, sm=0, id='hdpe') + rxres = gprMax.Material(er=3, se=(1 / rxres) * (dy / (dx * dz)), mr=1, sm=0, id='rxres') + scene_objects.extend((absorber1, absorber2, pcb, hdpe, rxres)) elif optstate == 'DebyeAbsorber': # Same values as WarrenThesis but uses dispersive absorber properties for Eccosorb LS22 excitationfreq = 1.71e9 sourceresistance = 230 # Correction for old (< 123) GprMax3D bug (optimised to 4) rxres = 925 # Resistance at Rx bowtie - material(1, 0, 1, 0, 'absorber1') - print('#add_dispersion_debye: 3 3.7733 1.00723e-11 3.14418 1.55686e-10 20.2441 3.44129e-10 absorber1') # Eccosorb LS22 3-pole Debye model (https://bitbucket.org/uoyaeg/aegboxts/wiki/Home) - material(3, 0, 1, 0, 'absorber2') # Foam modelled as PCB material - material(3, 0, 1, 0, 'pcb') - material(2.35, 0, 1, 0, 'hdpe') - material(3, (1 / rxres) * (dy / (dx * dz)), 1, 0, 'rxres') + absorber1 = gprMax.Material(er=1, se=0, mr=1, sm=0, id='absorber1') + # Eccosorb LS22 3-pole Debye model (https://bitbucket.org/uoyaeg/aegboxts/wiki/Home) + absorber1_disp = gprMax.AddDebyeDispersion(n_poles=3, er_delta=[3.7733, 3.14418, 20.2441], + tau=[1.00723e-11, 1.55686e-10, 3.44129e-10], + material_ids=['absorber1']) + absorber2 = gprMax.Material(er=3, se=0, mr=1, sm=0, id='absorber2') # Foam modelled as PCB material + pcb = gprMax.Material(er=3, se=0, mr=1, sm=0, id='pcb') + hdpe = gprMax.Material(er=2.35, se=0, mr=1, sm=0, id='hdpe') + rxres = gprMax.Material(er=3, se=(1 / rxres) * (dy / (dx * dz)), mr=1, sm=0, id='rxres') + scene_objects.extend((absorber1, absorber1_disp, absorber2, pcb, hdpe, rxres)) elif optstate == 'GiannakisPaper': # Further optimised values from https://doi.org/10.1109/TGRS.2018.2869027 sourceresistance = 195 - material(3.96, 0.31, 1, 0, 'absorber1') - material(1.05, 1.01, 1, 0, 'absorber2') - material(1.37, 0.0002, 1, 0, 'pcb') - material(1.99, 0.013, 1, 0, 'hdpe') + absorber1 = gprMax.Material(er=3.96, se=0.31, mr=1, sm=0, id='absorber1') + absorber2 = gprMax.Material(er=1.05, se=1.01, mr=1, sm=0, id='absorber2') + pcb = gprMax.Material(er=1.37, se=0.0002, mr=1, sm=0, id='pcb') + hdpe = gprMax.Material(er=1.99, se=0.013, mr=1, sm=0, id='hdpe') + scene_objects.extend((absorber1, absorber2, pcb, hdpe)) # Antenna geometry # Plastic case - box(x, y, z + skidthickness, x + casesize[0], y + casesize[1], z + skidthickness + casesize[2], 'hdpe', rotate90origin=rotate90origin) - box(x + casethickness, y + casethickness, z + skidthickness, x + casesize[0] - casethickness, y + casesize[1] - casethickness, z + skidthickness + casesize[2] - casethickness, 'free_space', rotate90origin=rotate90origin) + b1 = gprMax.Box(p1=(x, y, z + skidthickness), + p2=(x + casesize[0], y + casesize[1], z + skidthickness + casesize[2]), + material_id='hdpe') + b2 = gprMax.Box(p1=(x + casethickness, y + casethickness, z + skidthickness), + p2=(x + casesize[0] - casethickness, y + casesize[1] - casethickness, + z + skidthickness + casesize[2] - casethickness), + material_id='free_space') # Metallic enclosure - box(x + 0.025, y + casethickness, z + skidthickness, x + casesize[0] - 0.025, y + casesize[1] - casethickness, z + skidthickness + 0.027, 'pec', rotate90origin=rotate90origin) + b3 = gprMax.Box(p1=(x + 0.025, y + casethickness, z + skidthickness), + p2=(x + casesize[0] - 0.025, y + casesize[1] - casethickness, + z + skidthickness + 0.027), material_id='pec') # Absorber material (absorber1) and foam (absorber2) around edge of absorber - box(x + 0.025 + shieldthickness, y + casethickness + shieldthickness, z + skidthickness, x + 0.025 + shieldthickness + 0.057, y + casesize[1] - casethickness - shieldthickness, z + skidthickness + 0.027 - shieldthickness - 0.001, 'absorber2', rotate90origin=rotate90origin) - box(x + 0.025 + shieldthickness + foamsurroundthickness, y + casethickness + shieldthickness + foamsurroundthickness, z + skidthickness, x + 0.025 + shieldthickness + 0.057 - foamsurroundthickness, y + casesize[1] - casethickness - shieldthickness - foamsurroundthickness, z + skidthickness + 0.027 - shieldthickness, 'absorber1', rotate90origin=rotate90origin) - box(x + 0.086, y + casethickness + shieldthickness, z + skidthickness, x + 0.086 + 0.057, y + casesize[1] - casethickness - shieldthickness, z + skidthickness + 0.027 - shieldthickness - 0.001, 'absorber2', rotate90origin=rotate90origin) - box(x + 0.086 + foamsurroundthickness, y + casethickness + shieldthickness + foamsurroundthickness, z + skidthickness, x + 0.086 + 0.057 - foamsurroundthickness, y + casesize[1] - casethickness - shieldthickness - foamsurroundthickness, z + skidthickness + 0.027 - shieldthickness, 'absorber1', rotate90origin=rotate90origin) + b4 = gprMax.Box(p1=(x + 0.025 + shieldthickness, y + casethickness + shieldthickness, + z + skidthickness), p2=(x + 0.025 + shieldthickness + 0.057, + y + casesize[1] - casethickness - shieldthickness, + z + skidthickness + 0.027 - shieldthickness - 0.001), + material_id='absorber2') + b5 = gprMax.Box(p1=(x + 0.025 + shieldthickness + foamsurroundthickness, + y + casethickness + shieldthickness + foamsurroundthickness, + z + skidthickness), + p2=(x + 0.025 + shieldthickness + 0.057 - foamsurroundthickness, + y + casesize[1] - casethickness - shieldthickness - foamsurroundthickness, + z + skidthickness + 0.027 - shieldthickness), + material_id='absorber1') + b6 = gprMax.Box(p1=(x + 0.086, y + casethickness + shieldthickness, z + skidthickness), + p2=(x + 0.086 + 0.057, y + casesize[1] - casethickness - shieldthickness, + z + skidthickness + 0.027 - shieldthickness - 0.001), + material_id='absorber2') + b7 = gprMax.Box(p1=(x + 0.086 + foamsurroundthickness, + y + casethickness + shieldthickness + foamsurroundthickness, + z + skidthickness), + p2=(x + 0.086 + 0.057 - foamsurroundthickness, + y + casesize[1] - casethickness - shieldthickness - foamsurroundthickness, + z + skidthickness + 0.027 - shieldthickness), + material_id='absorber1') # PCB - box(x + 0.025 + shieldthickness + foamsurroundthickness, y + casethickness + shieldthickness + foamsurroundthickness, z + skidthickness, x + 0.086 - shieldthickness - foamsurroundthickness, y + casesize[1] - casethickness - shieldthickness - foamsurroundthickness, z + skidthickness + pcbthickness, 'pcb', rotate90origin=rotate90origin) - box(x + 0.086 + foamsurroundthickness, y + casethickness + shieldthickness + foamsurroundthickness, z + skidthickness, x + 0.086 + 0.057 - foamsurroundthickness, y + casesize[1] - casethickness - shieldthickness - foamsurroundthickness, z + skidthickness + pcbthickness, 'pcb', rotate90origin=rotate90origin) + b8 = gprMax.Box(p1=(x + 0.025 + shieldthickness + foamsurroundthickness, + y + casethickness + shieldthickness + foamsurroundthickness, + z + skidthickness), + p2=(x + 0.086 - shieldthickness - foamsurroundthickness, + y + casesize[1] - casethickness - shieldthickness - foamsurroundthickness, + z + skidthickness + pcbthickness), material_id='pcb') + b9 = gprMax.Box(p1=(x + 0.086 + foamsurroundthickness, + y + casethickness + shieldthickness + foamsurroundthickness, + z + skidthickness), + p2=(x + 0.086 + 0.057 - foamsurroundthickness, + y + casesize[1] - casethickness - shieldthickness - foamsurroundthickness, + z + skidthickness + pcbthickness), material_id='pcb') + + scene_objects.extend((b1, b2, b3, b4, b5, b6, b7, b8, b9)) # PCB components if resolution == 0.001: @@ -117,84 +164,163 @@ def antenna_like_GSSI_1500(x, y, z, resolution=0.001, rotate90=False): a = 0 b = 0 while b < 13: - plate(x + 0.045 + a * dx, y + 0.039 + b * dx, z + skidthickness, x + 0.065 - a * dx, y + 0.039 + b * dx + dy, z + skidthickness, 'pec', rotate90origin=rotate90origin) - plate(x + 0.045 + a * dx, y + 0.067 - b * dx, z + skidthickness, x + 0.065 - a * dx, y + 0.067 - b * dx + dy, z + skidthickness, 'pec', rotate90origin=rotate90origin) - plate(x + 0.104 + a * dx, y + 0.039 + b * dx, z + skidthickness, x + 0.124 - a * dx, y + 0.039 + b * dx + dy, z + skidthickness, 'pec', rotate90origin=rotate90origin) - plate(x + 0.104 + a * dx, y + 0.067 - b * dx, z + skidthickness, x + 0.124 - a * dx, y + 0.067 - b * dx + dy, z + skidthickness, 'pec', rotate90origin=rotate90origin) + p1 = gprMax.Plate(p1=(x + 0.045 + a * dx, y + 0.039 + b * dx, z + skidthickness), + p2=(x + 0.065 - a * dx, y + 0.039 + b * dx + dy, z + skidthickness), + material_id='pec') + p2 = gprMax.Plate(p1=(x + 0.045 + a * dx, y + 0.067 - b * dx, z + skidthickness), + p2=(x + 0.065 - a * dx, y + 0.067 - b * dx + dy, z + skidthickness), + material_id='pec') + p3 = gprMax.Plate(p1=(x + 0.104 + a * dx, y + 0.039 + b * dx, z + skidthickness), + p2=(x + 0.124 - a * dx, y + 0.039 + b * dx + dy, z + skidthickness), + material_id='pec') + p4 = gprMax.Plate(p1=(x + 0.104 + a * dx, y + 0.067 - b * dx, z + skidthickness), + p2=(x + 0.124 - a * dx, y + 0.067 - b * dx + dy, z + skidthickness), + material_id='pec') + scene_objects.extend((p1, p2, p3, p4)) b += 1 if a == 2 or a == 4 or a == 7: - plate(x + 0.045 + a * dx, y + 0.039 + b * dx, z + skidthickness, x + 0.065 - a * dx, y + 0.039 + b * dx + dy, z + skidthickness, 'pec', rotate90origin=rotate90origin) - plate(x + 0.045 + a * dx, y + 0.067 - b * dx, z + skidthickness, x + 0.065 - a * dx, y + 0.067 - b * dx + dy, z + skidthickness, 'pec', rotate90origin=rotate90origin) - plate(x + 0.104 + a * dx, y + 0.039 + b * dx, z + skidthickness, x + 0.124 - a * dx, y + 0.039 + b * dx + dy, z + skidthickness, 'pec', rotate90origin=rotate90origin) - plate(x + 0.104 + a * dx, y + 0.067 - b * dx, z + skidthickness, x + 0.124 - a * dx, y + 0.067 - b * dx + dy, z + skidthickness, 'pec', rotate90origin=rotate90origin) + p5 = gprMax.Plate(p1=(x + 0.045 + a * dx, y + 0.039 + b * dx, z + skidthickness), + p2=(x + 0.065 - a * dx, y + 0.039 + b * dx + dy, z + skidthickness), + material_id='pec') + p6 = gprMax.Plate(p1=(x + 0.045 + a * dx, y + 0.067 - b * dx, z + skidthickness), + p2=(x + 0.065 - a * dx, y + 0.067 - b * dx + dy, z + skidthickness), + material_id='pec') + p7 = gprMax.Plate(p1=(x + 0.104 + a * dx, y + 0.039 + b * dx, z + skidthickness), + p2=(x + 0.124 - a * dx, y + 0.039 + b * dx + dy, z + skidthickness), + material_id='pec') + p8 = gprMax.Plate(p1=(x + 0.104 + a * dx, y + 0.067 - b * dx, z + skidthickness), + p2=(x + 0.124 - a * dx, y + 0.067 - b * dx + dy, z + skidthickness), + material_id='pec') b += 1 + scene_objects.extend((p5, p6, p7, p8)) a += 1 # Rx extension section (upper y) - plate(x + 0.044, y + 0.068, z + skidthickness, x + 0.044 + bowtiebase, y + 0.068 + patchheight, z + skidthickness, 'pec', rotate90origin=rotate90origin) + p9 = gprMax.Plate(p1=(x + 0.044, y + 0.068, z + skidthickness), + p2=(x + 0.044 + bowtiebase, y + 0.068 + patchheight, z + skidthickness), + material_id='pec') # Tx extension section (upper y) - plate(x + 0.103, y + 0.068, z + skidthickness, x + 0.103 + bowtiebase, y + 0.068 + patchheight, z + skidthickness, 'pec', rotate90origin=rotate90origin) + p10 = gprMax.Plate(p1=(x + 0.103, y + 0.068, z + skidthickness), + p2=(x + 0.103 + bowtiebase, y + 0.068 + patchheight, z + skidthickness), + material_id='pec') + scene_objects.extend((p9, p10)) # Edges that represent wire between bowtie halves in 1mm model - edge(tx[0] - 0.059, tx[1] - dy, tx[2], tx[0] - 0.059, tx[1], tx[2], 'pec', rotate90origin=rotate90origin) - edge(tx[0] - 0.059, tx[1] + dy, tx[2], tx[0] - 0.059, tx[1] + 0.002, tx[2], 'pec', rotate90origin=rotate90origin) - edge(tx[0], tx[1] - dy, tx[2], tx[0], tx[1], tx[2], 'pec', rotate90origin=rotate90origin) - edge(tx[0], tx[1] + dz, tx[2], tx[0], tx[1] + 0.002, tx[2], 'pec', rotate90origin=rotate90origin) + e1 = gprMax.Edge(p1=(tx[0] - 0.059, tx[1] - dy, tx[2]), + p2=(tx[0] - 0.059, tx[1], tx[2]), material_id='pec') + e2 = gprMax.Edge(p1=(tx[0] - 0.059, tx[1] + dy, tx[2]), + p2=(tx[0] - 0.059, tx[1] + 0.002, tx[2]), material_id='pec') + e3 = gprMax.Edge(p1=(tx[0], tx[1] - dy, tx[2]), + p2=(tx[0], tx[1], tx[2]), material_id='pec') + e4 = gprMax.Edge(p1=(tx[0], tx[1] + dz, tx[2]), + p2=(tx[0], tx[1] + 0.002, tx[2]), material_id='pec') + scene_objects.extend((e1, e2, e3, e4)) elif resolution == 0.002: # Rx & Tx bowties for a in range(0, 6): - plate(x + 0.044 + a * dx, y + 0.040 + a * dx, z + skidthickness, x + 0.066 - a * dx, y + 0.040 + a * dx + dy, z + skidthickness, 'pec', rotate90origin=rotate90origin) - plate(x + 0.044 + a * dx, y + 0.064 - a * dx, z + skidthickness, x + 0.066 - a * dx, y + 0.064 - a * dx + dy, z + skidthickness, 'pec', rotate90origin=rotate90origin) - plate(x + 0.103 + a * dx, y + 0.040 + a * dx, z + skidthickness, x + 0.125 - a * dx, y + 0.040 + a * dx + dy, z + skidthickness, 'pec', rotate90origin=rotate90origin) - plate(x + 0.103 + a * dx, y + 0.064 - a * dx, z + skidthickness, x + 0.125 - a * dx, y + 0.064 - a * dx + dy, z + skidthickness, 'pec', rotate90origin=rotate90origin) + p1 = gprMax.Plate(p1=(x + 0.044 + a * dx, y + 0.040 + a * dx, z + skidthickness), + p2=(x + 0.066 - a * dx, y + 0.040 + a * dx + dy, z + skidthickness), + material_id='pec') + p2 = gprMax.Plate(p1=(x + 0.044 + a * dx, y + 0.064 - a * dx, z + skidthickness), + p2=(x + 0.066 - a * dx, y + 0.064 - a * dx + dy, z + skidthickness), + material_id='pec') + p3 = gprMax.Plate(p1=(x + 0.103 + a * dx, y + 0.040 + a * dx, z + skidthickness), + p2=(x + 0.125 - a * dx, y + 0.040 + a * dx + dy, z + skidthickness), + material_id='pec') + p4 = gprMax.Plate(p1=(x + 0.103 + a * dx, y + 0.064 - a * dx, z + skidthickness), + p2=(x + 0.125 - a * dx, y + 0.064 - a * dx + dy, z + skidthickness), + material_id='pec') # Rx extension section (upper y) - plate(x + 0.044, y + 0.066, z + skidthickness, x + 0.044 + bowtiebase, y + 0.066 + patchheight, z + skidthickness, 'pec', rotate90origin=rotate90origin) + p5 = gprMax.Plate(p1=(x + 0.044, y + 0.066, z + skidthickness), + p2=(x + 0.044 + bowtiebase, y + 0.066 + patchheight, z + skidthickness), + material_id='pec') # Tx extension section (upper y) - plate(x + 0.103, y + 0.066, z + skidthickness, x + 0.103 + bowtiebase, y + 0.066 + patchheight, z + skidthickness, 'pec', rotate90origin=rotate90origin) + p6 = gprMax.Plate(p1=(x + 0.103, y + 0.066, z + skidthickness), + p2=(x + 0.103 + bowtiebase, y + 0.066 + patchheight, z + skidthickness), + material_id='pec') + scene_objects.extend((p1, p2, p3, p4, p5, p6)) # Rx extension section (lower y) - plate(x + 0.044, y + 0.024, z + skidthickness, x + 0.044 + bowtiebase, y + 0.024 + patchheight, z + skidthickness, 'pec', rotate90origin=rotate90origin) + p11 = gprMax.Plate(p1=(x + 0.044, y + 0.024, z + skidthickness), + p2=(x + 0.044 + bowtiebase, y + 0.024 + patchheight, z + skidthickness), + material_id='pec') # Tx extension section (lower y) - plate(x + 0.103, y + 0.024, z + skidthickness, x + 0.103 + bowtiebase, y + 0.024 + patchheight, z + skidthickness, 'pec', rotate90origin=rotate90origin) + p12 = gprMax.Plate(p1=(x + 0.103, y + 0.024, z + skidthickness), + p2=(x + 0.103 + bowtiebase, y + 0.024 + patchheight, z + skidthickness), + material_id='pec') + scene_objects.extend((p11, p12)) # Skid - box(x, y, z, x + casesize[0], y + casesize[1], z + skidthickness, 'hdpe', rotate90origin=rotate90origin) + b10 = gprMax.Box(p1=(x, y, z), p2=(x + casesize[0], y + casesize[1], z + skidthickness), + material_id='hdpe') + scene_objects.append(b10) # Geometry views - # geometry_view(x - dx, y - dy, z - dz, x + casesize[0] + dx, y + casesize[1] + dy, z + skidthickness + casesize[2] + dz, dx, dy, dz, 'antenna_like_GSSI_1500') - # geometry_view(x, y, z, x + casesize[0], y + casesize[1], z + 0.010, dx, dy, dz, 'antenna_like_GSSI_1500_pcb', type='f') + gv1 = gprMax.GeometryView(p1=(x - dx, y - dy, z - dz), p2=(x + casesize[0] + dx, + y + casesize[1] + dy, z + skidthickness + casesize[2] + dz), + dl=(dx, dy, dz), filename='antenna_like_GSSI_1500', + output_type='n') + gv2 = gprMax.GeometryView(p1=(x, y, z), p2=(x + casesize[0], y + casesize[1], z + 0.010), + dl=(dx, dy, dz), filename='antenna_like_GSSI_1500_pcb', + output_type='f') + # scene_objects.extend((gv1, gv2)) # Excitation if optstate == 'WarrenThesis' or optstate == 'DebyeAbsorber': # Gaussian pulse - print('#waveform: gaussian 1 {} myGaussian'.format(excitationfreq)) - voltage_source('y', tx[0], tx[1], tx[2], sourceresistance, 'myGaussian', dxdy=(resolution, resolution), rotate90origin=rotate90origin) + w1 = gprMax.Waveform(wave_type='gaussian', amp=1, freq=excitationfreq, id='my_gaussian') + vs1 = gprMax.VoltageSource(polarisation='y', p1=(tx[0], tx[1], tx[2]), resistance=sourceresistance, waveform_id='my_gaussian') + scene_objects.extend((w1, vs1)) elif optstate == 'GiannakisPaper': # Optimised custom pulse - print('#excitation_file: ../user_libs/antennas/GSSI1p5optpulse.txt linear extrapolate') - voltage_source('y', tx[0], tx[1], tx[2], sourceresistance, 'GSSI1p5optpulse', dxdy=(resolution, resolution), rotate90origin=rotate90origin) + exc1 = gprMax.ExcitationFile(filepath='../user_libs/antennas/GSSI1p5optpulse.txt', kind='linear', fill_value='extrapolate') + vs1 = gprMax.VoltageSource(polarisation='y', p1=(tx[0], tx[1], tx[2]), resistance=sourceresistance, waveform_id='GSSI1p5optpulse') + scene_objects.extend((exc1, vs1)) # Output point - receiver bowtie if resolution == 0.001: if optstate == 'WarrenThesis' or optstate == 'DebyeAbsorber': - edge(tx[0] - 0.059, tx[1], tx[2], tx[0] - 0.059, tx[1] + dy, tx[2], 'rxres', rotate90origin=rotate90origin) - rx(tx[0] - 0.059, tx[1], tx[2], identifier='rxbowtie', to_save=[output], polarisation='y', dxdy=(resolution, resolution), rotate90origin=rotate90origin) + e1 = gprMax.Edge(p1=(tx[0] - 0.059, tx[1], tx[2]), + p2=(tx[0] - 0.059, tx[1] + dy, tx[2]), + material_id='rxres') + scene_objects.append(e1) + r1 = gprMax.Rx(p1=(tx[0] - 0.059, tx[1], tx[2]), id='rxbowtie', + outputs='Ey') + scene_objects.append(r1) + elif resolution == 0.002: if optstate == 'WarrenThesis' or optstate == 'DebyeAbsorber': - edge(tx[0] - 0.060, tx[1], tx[2], tx[0] - 0.060, tx[1] + dy, tx[2], 'rxres', rotate90origin=rotate90origin) - rx(tx[0] - 0.060, tx[1], tx[2], identifier='rxbowtie', to_save=[output], polarisation='y', dxdy=(resolution, resolution), rotate90origin=rotate90origin) + e1 = gprMax.Edge(p1=(tx[0] - 0.060, tx[1], tx[2]), + p2=(tx[0] - 0.060, tx[1] + dy, tx[2]), + material_id='rxres') + scene_objects.append(e1) + r1 = gprMax.Rx(p1=(tx[0] - 0.060, tx[1], tx[2]), id='rxbowtie', + outputs='Ey') + scene_objects.append(r1) + + return scene_objects -def antenna_like_GSSI_400(x, y, z, resolution=0.001, rotate90=False): - """Inserts a description of an antenna similar to the GSSI 400MHz antenna. Can be used with 0.5mm, 1mm (default) or 2mm spatial resolution. The external dimensions of the antenna are 300x300x178mm. One output point is defined between the arms of the receiver bowtie. The bowties are aligned with the y axis so the output is the y component of the electric field. +def antenna_like_GSSI_400(x, y, z, resolution=0.001): + """Inserts a description of an antenna similar to the GSSI 400MHz antenna. + Can be used with 0.5mm, 1mm (default) or 2mm spatial resolution. + The external dimensions of the antenna are 300x300x178mm. + One output point is defined between the arms of the receiver bowtie. + The bowties are aligned with the y axis so the output is the y component + of the electric field. Args: x, y, z (float): Coordinates of a location in the model to insert the antenna. Coordinates are relative to the geometric centre of the antenna in the x-y plane and the bottom of the antenna skid in the z direction. resolution (float): Spatial resolution for the antenna model. - rotate90 (bool): Rotate model 90 degrees CCW in xy plane. + + Returns: + scene_objects (list): All model objects that will be part of a scene. """ + # All model objects that will be returned by function + scene_objects = [] + # Antenna geometry properties casesize = (0.3, 0.3, 0.178) # original casethickness = 0.002 @@ -207,14 +333,6 @@ def antenna_like_GSSI_400(x, y, z, resolution=0.001, rotate90=False): metalboxheight = 0.089 metalmiddleplateheight = 0.11 - # Set origin for rotation to geometric centre of antenna in x-y plane if required, and set output component for receiver - if rotate90: - rotate90origin = (x, y) - output = 'Ex' - else: - rotate90origin = () - output = 'Ey' - smooth_dec = 'yes' # choose to use dielectric smoothing or not src_type = 'voltage_source' # # source type. "voltage_source" or "transmission_line" excitationfreq = 0.39239891e9 # GHz @@ -252,324 +370,418 @@ def antenna_like_GSSI_400(x, y, z, resolution=0.001, rotate90=False): raise CmdInputError('This antenna module can only be used with a spatial discretisation of 0.5mm, 1mm, 2mm') # Material definitions - material(absorberEr, absorbersig, 1, 0, 'absorber') - material(pcber, 0, 1, 0, 'pcb') - material(hdper, 0, 1, 0, 'hdpe') + absorber = gprMax.Material(er=absorberEr, se=absorbersig, mr=1, sm=0, id='absorber') + pcb = gprMax.Material(er=pcber, se=0, mr=1, sm=0, id='pcb') + hdpe = gprMax.Material(er=hdper, se=0, mr=1, sm=0, id='hdpe') + scene_objects.extend((absorber, pcb, hdpe)) # Antenna geometry if smooth_dec == 'yes': # Plastic case - box(x, y, z + skidthickness - 0.002, x + casesize[0], y + casesize[1], z + casesize[2], 'hdpe', rotate90origin=rotate90origin) # new new (0.300 x 0.300 x 0.170) - box(x + casethickness, y + casethickness, z + skidthickness - 0.002, x + casesize[0] - casethickness, y + casesize[1] - casethickness, z + casesize[2] - casethickness, 'free_space', rotate90origin=rotate90origin) # (0.296 x 0.296 x 0.168) + b1 = gprMax.Box(p1=(x, y, z + skidthickness - 0.002), + p2=(x + casesize[0], y + casesize[1], z + casesize[2]), + material_id='hdpe') + b2 = gprMax.Box(p1=(x + casethickness, y + casethickness, z + skidthickness - 0.002), + p2=(x + casesize[0] - casethickness, y + casesize[1] - casethickness, + z + casesize[2] - casethickness), material_id='free_space') # Metallic enclosure - box(x + casethickness, y + casethickness, z + skidthickness + (metalmiddleplateheight - metalboxheight), x + casesize[0] - casethickness, y + casesize[1] - casethickness, z + skidthickness + (metalmiddleplateheight - metalboxheight) + metalboxheight, 'pec', rotate90origin=rotate90origin) # new (0.296 x 0.296 x 0.088) + b3 = gprMax.Box(p1=(x + casethickness, y + casethickness, z + skidthickness + + (metalmiddleplateheight - metalboxheight)), + p2=(x + casesize[0] - casethickness, y + casesize[1] - casethickness, + z + skidthickness + (metalmiddleplateheight - metalboxheight) + + metalboxheight), material_id='pec') # Absorber, and foam (modelled as PCB material) around edge of absorber - box(x + casethickness, y + casethickness, z + skidthickness, x + casesize[0] - casethickness, y + casesize[1] - casethickness, z + skidthickness + (metalmiddleplateheight - metalboxheight), 'absorber', rotate90origin=rotate90origin) # new 4 (0.296 x 0.296 x 0.022) - box(x + casethickness + shieldthickness, y + casethickness + shieldthickness, z + skidthickness + (metalmiddleplateheight - metalboxheight), x + casesize[0] - casethickness - shieldthickness, y + casesize[1] - casethickness - shieldthickness, z + skidthickness - shieldthickness + metalmiddleplateheight, 'absorber', rotate90origin=rotate90origin) # new 4 (0.292 x 0.292 x 0.086) + b4 = gprMax.Box(p1=(x + casethickness, y + casethickness, z + skidthickness), + p2=(x + casesize[0] - casethickness, y + casesize[1] - casethickness, + z + skidthickness + (metalmiddleplateheight - metalboxheight)), + material_id='absorber') + b5 = gprMax.Box(p1=(x + casethickness + shieldthickness, y + casethickness + + shieldthickness, z + skidthickness + (metalmiddleplateheight - metalboxheight)), + p2=(x + casesize[0] - casethickness - shieldthickness, + y + casesize[1] - casethickness - shieldthickness, + z + skidthickness - shieldthickness + metalmiddleplateheight), + material_id='absorber') + scene_objects.extend((b1, b2, b3, b4, b5)) # PCB if resolution == 0.0005: - box(x + 0.01 + 0.005 + 0.018, y + casethickness + 0.005 + 0.0235, z + skidthickness, x + 0.01 + 0.005 + 0.034 + bowtiebase, y + casethickness + 0.005 + 0.204 + patchheight, z + skidthickness + pcbthickness, 'pcb', rotate90origin=rotate90origin) # new - box(x + 0.01 + 0.005 + 0.178, y + casethickness + 0.005 + 0.0235, z + skidthickness, x + 0.01 + 0.005 + 0.194 + bowtiebase, y + casethickness + 0.005 + 0.204 + patchheight, z + skidthickness + pcbthickness, 'pcb', rotate90origin=rotate90origin) # new + b6 = gprMax.Box(p1=(x + 0.01 + 0.005 + 0.018, y + casethickness + + 0.005 + 0.0235, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.034 + bowtiebase, + y + casethickness + 0.005 + 0.204 + patchheight, + z + skidthickness + pcbthickness), material_id='pcb') + b7 = gprMax.Box(p1=(x + 0.01 + 0.005 + 0.178, y + casethickness + + 0.005 + 0.0235, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.194 + bowtiebase, + y + casethickness + 0.005 + 0.204 + patchheight, + z + skidthickness + pcbthickness), material_id='pcb') + scene_objects.extend((b6, b7)) elif resolution == 0.001: - box(x + 0.01 + 0.005 + 0.018, y + casethickness + 0.005 + 0.023, z + skidthickness, x + 0.01 + 0.005 + 0.034 + bowtiebase, y + casethickness + 0.005 + 0.204 + patchheight, z + skidthickness + pcbthickness, 'pcb', rotate90origin=rotate90origin) # new - box(x + 0.01 + 0.005 + 0.178, y + casethickness + 0.005 + 0.023, z + skidthickness, x + 0.01 + 0.005 + 0.194 + bowtiebase, y + casethickness + 0.005 + 0.204 + patchheight, z + skidthickness + pcbthickness, 'pcb', rotate90origin=rotate90origin) # new + b6 = gprMax.Box(p1=(x + 0.01 + 0.005 + 0.018, y + casethickness + 0.005 + 0.023, + z + skidthickness), p2=(x + 0.01 + 0.005 + 0.034 + bowtiebase, + y + casethickness + 0.005 + 0.204 + patchheight, + z + skidthickness + pcbthickness), material_id='pcb') + b7 = gprMax.Box(p1=(x + 0.01 + 0.005 + 0.178, y + casethickness + 0.005 + 0.023, + z + skidthickness), p2=(x + 0.01 + 0.005 + 0.194 + bowtiebase, + y + casethickness + 0.005 + 0.204 + patchheight, + z + skidthickness + pcbthickness), material_id='pcb') + scene_objects.extend((b6, b7)) elif resolution == 0.002: - box(x + 0.01 + 0.005 + 0.017, y + casethickness + 0.005 + 0.021, z + skidthickness, x + 0.01 + 0.005 + 0.033 + bowtiebase, y + casethickness + 0.006 + 0.202 + patchheight, z + skidthickness + pcbthickness, 'pcb', rotate90origin=rotate90origin) # new (for use with edges) - box(x + 0.01 + 0.005 + 0.179, y + casethickness + 0.005 + 0.021, z + skidthickness, x + 0.01 + 0.005 + 0.195 + bowtiebase, y + casethickness + 0.006 + 0.202 + patchheight, z + skidthickness + pcbthickness, 'pcb', rotate90origin=rotate90origin) # new (for use with edges) + b6 = gprMax.Box(p1=(x + 0.01 + 0.005 + 0.017, y + casethickness + 0.005 + 0.021, + z + skidthickness), p2=(x + 0.01 + 0.005 + 0.033 + bowtiebase, + y + casethickness + 0.006 + 0.202 + patchheight, + z + skidthickness + pcbthickness), material_id='pcb') + b7 = gprMax.Box(p1=(x + 0.01 + 0.005 + 0.179, y + casethickness + 0.005 + 0.021, + z + skidthickness), p2=(x + 0.01 + 0.005 + 0.195 + bowtiebase, + y + casethickness + 0.006 + 0.202 + patchheight, + z + skidthickness + pcbthickness), material_id='pcb') + scene_objects.extend((b6, b7)) elif smooth_dec == 'no': # Plastic case - box(x, y, z + skidthickness - 0.002, x + casesize[0], y + casesize[1], z + casesize[2], 'hdpe', 'n', rotate90origin=rotate90origin) # new new (0.300 x 0.300 x 0.170) - box(x + casethickness, y + casethickness, z + skidthickness - 0.002, x + casesize[0] - casethickness, y + casesize[1] - casethickness, z + casesize[2] - casethickness, 'free_space', 'n', rotate90origin=rotate90origin) # (0.296 x 0.296 x 0.168) + b8 = gprMax.Box(p1=(x, y, z + skidthickness - 0.002), + p2=(x + casesize[0], y + casesize[1], z + casesize[2]), + material_id='hdpe', averaging='n') + b9 = gprMax.Box(p1=(x + casethickness, y + casethickness, z + skidthickness - 0.002), + p2=(x + casesize[0] - casethickness, y + casesize[1] - casethickness, + z + casesize[2] - casethickness), material_id='free_space', + averaging='n') # Metallic enclosure - box(x + casethickness, y + casethickness, z + skidthickness + (metalmiddleplateheight - metalboxheight), x + casesize[0] - casethickness, y + casesize[1] - casethickness, z + skidthickness + (metalmiddleplateheight - metalboxheight) + metalboxheight, 'pec', rotate90origin=rotate90origin) # new (0.296 x 0.296 x 0.088) + b10 = gprMax.Box(p1=(x + casethickness, y + casethickness, + z + skidthickness + (metalmiddleplateheight - metalboxheight)), + p2=(x + casesize[0] - casethickness, y + casesize[1] - casethickness, + z + skidthickness + (metalmiddleplateheight - metalboxheight) + + metalboxheight), material_id='pec') # Absorber, and foam (modelled as PCB material) around edge of absorber - box(x + casethickness, y + casethickness, z + skidthickness, x + casesize[0] - casethickness, y + casesize[1] - casethickness, z + skidthickness + (metalmiddleplateheight - metalboxheight), 'absorber', 'n', rotate90origin=rotate90origin) # new 4 (0.296 x 0.296 x 0.022) - box(x + casethickness + shieldthickness, y + casethickness + shieldthickness, z + skidthickness + (metalmiddleplateheight - metalboxheight), x + casesize[0] - casethickness - shieldthickness, y + casesize[1] - casethickness - shieldthickness, z + skidthickness - shieldthickness + metalmiddleplateheight, 'absorber', 'n', rotate90origin=rotate90origin) # new 4 (0.292 x 0.292 x 0.086) + b11 = gprMax.Box(p1=(x + casethickness, y + casethickness, z + skidthickness), + p2=(x + casesize[0] - casethickness, y + casesize[1] - casethickness, + z + skidthickness + (metalmiddleplateheight - metalboxheight)), + material_id='absorber', averaging='n') + b12 = gprMax.Box(p1=(x + casethickness + shieldthickness, + y + casethickness + shieldthickness, + z + skidthickness + (metalmiddleplateheight - metalboxheight)), + p2=(x + casesize[0] - casethickness - shieldthickness, + y + casesize[1] - casethickness - shieldthickness, + z + skidthickness - shieldthickness + metalmiddleplateheight), + material_id='absorber', averaging='n') + scene_objects.extend((b8, b9, b10, b11, b12)) # PCB if resolution == 0.0005: - box(x + 0.01 + 0.005 + 0.018, y + casethickness + 0.005 + 0.0235, z + skidthickness, x + 0.01 + 0.005 + 0.034 + bowtiebase, y + casethickness + 0.005 + 0.204 + patchheight, z + skidthickness + pcbthickness, 'pcb', 'n', rotate90origin=rotate90origin) # new - box(x + 0.01 + 0.005 + 0.178, y + casethickness + 0.005 + 0.0235, z + skidthickness, x + 0.01 + 0.005 + 0.194 + bowtiebase, y + casethickness + 0.005 + 0.204 + patchheight, z + skidthickness + pcbthickness, 'pcb', 'n', rotate90origin=rotate90origin) # new + b13 = gprMax.Box(p1=(x + 0.01 + 0.005 + 0.018, + y + casethickness + 0.005 + 0.0235, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.034 + bowtiebase, + y + casethickness + 0.005 + 0.204 + patchheight, + z + skidthickness + pcbthickness), material_id='pcb', + averaging='n') + b14 = gprMax.Box(p1=(x + 0.01 + 0.005 + 0.178, + y + casethickness + 0.005 + 0.0235, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.194 + bowtiebase, + y + casethickness + 0.005 + 0.204 + patchheight, + z + skidthickness + pcbthickness), material_id='pcb', + averaging='n') + scene_objects.extend((b13, b14)) elif resolution == 0.001: - box(x + 0.01 + 0.005 + 0.018, y + casethickness + 0.005 + 0.023, z + skidthickness, x + 0.01 + 0.005 + 0.034 + bowtiebase, y + casethickness + 0.005 + 0.204 + patchheight, z + skidthickness + pcbthickness, 'pcb', 'n', rotate90origin=rotate90origin) # new - box(x + 0.01 + 0.005 + 0.178, y + casethickness + 0.005 + 0.023, z + skidthickness, x + 0.01 + 0.005 + 0.194 + bowtiebase, y + casethickness + 0.005 + 0.204 + patchheight, z + skidthickness + pcbthickness, 'pcb', 'n', rotate90origin=rotate90origin) # new + b13 = gprMax.Box(p1=(x + 0.01 + 0.005 + 0.018, + y + casethickness + 0.005 + 0.023, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.034 + bowtiebase, + y + casethickness + 0.005 + 0.204 + patchheight, + z + skidthickness + pcbthickness), material_id='pcb', + averaging='n') + b14 = gprMax.Box(p1=(x + 0.01 + 0.005 + 0.178, + y + casethickness + 0.005 + 0.023, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.194 + bowtiebase, + y + casethickness + 0.005 + 0.204 + patchheight, + z + skidthickness + pcbthickness), material_id='pcb', + averaging='n') + scene_objects.extend((b13, b14)) elif resolution == 0.002: - box(x + 0.01 + 0.005 + 0.017, y + casethickness + 0.005 + 0.021, z + skidthickness, x + 0.01 + 0.005 + 0.033 + bowtiebase, y + casethickness + 0.006 + 0.202 + patchheight, z + skidthickness + pcbthickness, 'pcb', 'n', rotate90origin=rotate90origin) # new (for use with edges) - box(x + 0.01 + 0.005 + 0.179, y + casethickness + 0.005 + 0.021, z + skidthickness, x + 0.01 + 0.005 + 0.195 + bowtiebase, y + casethickness + 0.006 + 0.202 + patchheight, z + skidthickness + pcbthickness, 'pcb', 'n', rotate90origin=rotate90origin) # new (for use with edges) + b13 = gprMax.Box(p1=(x + 0.01 + 0.005 + 0.017, + y + casethickness + 0.005 + 0.021, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.033 + bowtiebase, + y + casethickness + 0.006 + 0.202 + patchheight, + z + skidthickness + pcbthickness), material_id='pcb', + averaging='n') + b14 = gprMax.Box(p1=(x + 0.01 + 0.005 + 0.179, + y + casethickness + 0.005 + 0.021, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.195 + bowtiebase, + y + casethickness + 0.006 + 0.202 + patchheight, + z + skidthickness + pcbthickness), material_id='pcb', + averaging='n') + scene_objects.extend((b13, b14)) # PCB components # My own bowties with triangle commands if resolution == 0.0005: # "left" side # extension plates - plate(x + 0.01 + 0.005 + 0.026, y + casethickness + 0.005 + 0.0235, z + skidthickness, x + 0.01 + 0.005 + 0.026 + bowtiebase, y + casethickness + 0.005 + 0.0235 + patchheight, z + skidthickness, 'pec', rotate90origin=rotate90origin) # new - # box(x + 0.01 + 0.005 + 0.026, y + casethickness + 0.005 + 0.0235, z + skidthickness, x + 0.01 + 0.005 + 0.026 + bowtiebase, y + casethickness + 0.005 + 0.0235 + patchheight, z + skidthickness + 0.002, 'pec', rotate90origin=rotate90origin) # new new - - plate(x + 0.01 + 0.005 + 0.026, y + casethickness + 0.005 + 0.204, z + skidthickness, x + 0.01 + 0.005 + 0.026 + bowtiebase, y + casethickness + 0.005 + 0.204 + patchheight, z + skidthickness, 'pec', rotate90origin=rotate90origin) # new - # box(x + 0.01 + 0.005 + 0.026, y + casethickness + 0.005 + 0.204, z + skidthickness, x + 0.01 + 0.005 + 0.026 + bowtiebase, y + casethickness + 0.005 + 0.204 + patchheight, z + skidthickness + 0.002, 'pec', rotate90origin=rotate90origin) # new new - + p1 = gprMax.Plate(p1=(x + 0.01 + 0.005 + 0.026, + y + casethickness + 0.005 + 0.0235, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.026 + bowtiebase, + y + casethickness + 0.005 + 0.0235 + patchheight, + z + skidthickness), material_id='pec') + p2 = gprMax.Plate(p1=(x + 0.01 + 0.005 + 0.026, + y + casethickness + 0.005 + 0.204, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.026 + bowtiebase, + y + casethickness + 0.005 + 0.204 + patchheight, + z + skidthickness), material_id='pec') # triangles - # triangle(x + 0.01 + 0.005 + 0.026, y + casethickness + 0.005 + 0.0835, z + skidthickness, - # x + 0.01 + 0.005 + 0.026 + bowtiebase, y + casethickness + 0.005 + 0.0835, z + skidthickness, - # x + 0.01 + 0.005 + 0.026 + (bowtiebase/2), y + casethickness + 0.005 + 0.0835 + bowtieheight, z + skidthickness, - # 0.002,'pec', rotate90origin=rotate90origin) - triangle(x + 0.01 + 0.005 + 0.026, y + casethickness + 0.005 + 0.0835, z + skidthickness, - x + 0.01 + 0.005 + 0.026 + bowtiebase, y + casethickness + 0.005 + 0.0835, z + skidthickness, - x + 0.01 + 0.005 + 0.026 + (bowtiebase/2), y + casethickness + 0.005 + 0.0835 + bowtieheight, z + skidthickness, - 0,'pec', rotate90origin=rotate90origin) # new - # triangle(x + 0.01 + 0.005 + 0.026, y + casethickness + 0.005 + 0.204, z + skidthickness, - # x + 0.01 + 0.005 + 0.026 + bowtiebase, y + casethickness + 0.005 + 0.204, z + skidthickness, - # x + 0.01 + 0.005 + 0.026 + (bowtiebase/2), y + casethickness + 0.005 + 0.204 - bowtieheight, z + skidthickness, - # 0.002,'pec', rotate90origin=rotate90origin) - triangle(x + 0.01 + 0.005 + 0.026, y + casethickness + 0.005 + 0.204, z + skidthickness, - x + 0.01 + 0.005 + 0.026 + bowtiebase, y + casethickness + 0.005 + 0.204, z + skidthickness, - x + 0.01 + 0.005 + 0.026 + (bowtiebase/2), y + casethickness + 0.005 + 0.204 - bowtieheight, z + skidthickness, - 0,'pec', rotate90origin=rotate90origin) # new + t1 = gprMax.Triangle(p1=(x + 0.01 + 0.005 + 0.026, + y + casethickness + 0.005 + 0.0835, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.026 + bowtiebase, + y + casethickness + 0.005 + 0.0835, z + skidthickness), + p3=(x + 0.01 + 0.005 + 0.026 + (bowtiebase/2), + y + casethickness + 0.005 + 0.0835 + bowtieheight, + z + skidthickness), thickness=0, material_id='pec') + t2 = gprMax.Triangle(p1=(x + 0.01 + 0.005 + 0.026, + y + casethickness + 0.005 + 0.204, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.026 + bowtiebase, + y + casethickness + 0.005 + 0.204, z + skidthickness), + p3=(x + 0.01 + 0.005 + 0.026 + (bowtiebase/2), + y + casethickness + 0.005 + 0.204 - bowtieheight, + z + skidthickness), thickness=0, material_id='pec') # "right" side - plate(x + 0.01 + 0.005 + 0.186, y + casethickness + 0.005 + 0.0235, z + skidthickness, x + 0.01 + 0.005 + 0.186 + bowtiebase, y + casethickness + 0.005 + 0.0235 + patchheight, z + skidthickness, 'pec', rotate90origin=rotate90origin) # new - # box(x + 0.01 + 0.005 + 0.186, y + casethickness + 0.005 + 0.0235, z + skidthickness, x + 0.01 + 0.005 + 0.186 + bowtiebase, y + casethickness + 0.005 + 0.0235 + patchheight, z + skidthickness + 0.002, 'pec', rotate90origin=rotate90origin) # new new - - plate(x + 0.01 + 0.005 + 0.186, y + casethickness + 0.005 + 0.204, z + skidthickness, x + 0.01 + 0.005 + 0.186 + bowtiebase, y + casethickness + 0.005 + 0.204 + patchheight, z + skidthickness, 'pec', rotate90origin=rotate90origin) # new - # box(x + 0.01 + 0.005 + 0.186, y + casethickness + 0.005 + 0.204, z + skidthickness, x + 0.01 + 0.005 + 0.186 + bowtiebase, y + casethickness + 0.005 + 0.204 + patchheight, z + skidthickness + 0.002, 'pec', rotate90origin=rotate90origin) # new - + p3 = gprMax.Plate(p1=(x + 0.01 + 0.005 + 0.186, + y + casethickness + 0.005 + 0.0235, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.186 + bowtiebase, + y + casethickness + 0.005 + 0.0235 + patchheight, + z + skidthickness), material_id='pec') + p4 = gprMax.Plate(p1=(x + 0.01 + 0.005 + 0.186, + y + casethickness + 0.005 + 0.204, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.186 + bowtiebase, + y + casethickness + 0.005 + 0.204 + patchheight, + z + skidthickness), material_id='pec') # triangles - # triangle(x + 0.01 + 0.005 + 0.186, y + casethickness + 0.005 + 0.0835, z + skidthickness, - # x + 0.01 + 0.005 + 0.186 + bowtiebase, y + casethickness + 0.005 + 0.0835, z + skidthickness, - # x + 0.01 + 0.005 + 0.186 + (bowtiebase/2), y + casethickness + 0.005 + 0.0835 + bowtieheight, z + skidthickness, - # 0.002,'pec', rotate90origin=rotate90origin) - triangle(x + 0.01 + 0.005 + 0.186, y + casethickness + 0.005 + 0.0835, z + skidthickness, - x + 0.01 + 0.005 + 0.186 + bowtiebase, y + casethickness + 0.005 + 0.0835, z + skidthickness, - x + 0.01 + 0.005 + 0.186 + (bowtiebase/2), y + casethickness + 0.005 + 0.0835 + bowtieheight, z + skidthickness, - 0,'pec', rotate90origin=rotate90origin) - # triangle(x + 0.01 + 0.005 + 0.186, y + casethickness + 0.005 + 0.204, z + skidthickness, - # x + 0.01 + 0.005 + 0.186 + bowtiebase, y + casethickness + 0.005 + 0.204, z + skidthickness, - # x + 0.01 + 0.005 + 0.186 + (bowtiebase/2), y + casethickness + 0.005 + 0.204 - bowtieheight, z + skidthickness, - # 0.002,'pec', rotate90origin=rotate90origin) - triangle(x + 0.01 + 0.005 + 0.186, y + casethickness + 0.005 + 0.204, z + skidthickness, - x + 0.01 + 0.005 + 0.186 + bowtiebase, y + casethickness + 0.005 + 0.204, z + skidthickness, - x + 0.01 + 0.005 + 0.186 + (bowtiebase/2), y + casethickness + 0.005 + 0.204 - bowtieheight, z + skidthickness, - 0,'pec', rotate90origin=rotate90origin) + t3 = gprMax.Triangle(p1=(x + 0.01 + 0.005 + 0.186, + y + casethickness + 0.005 + 0.0835, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.186 + bowtiebase, + y + casethickness + 0.005 + 0.0835, z + skidthickness), + p3=(x + 0.01 + 0.005 + 0.186 + (bowtiebase/2), + y + casethickness + 0.005 + 0.0835 + bowtieheight, + z + skidthickness), thickness=0, material_ID='pec') + t4 = gprMax.Triangle(p1=(x + 0.01 + 0.005 + 0.186, + y + casethickness + 0.005 + 0.204, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.186 + bowtiebase, + y + casethickness + 0.005 + 0.204, z + skidthickness), + p3=(x + 0.01 + 0.005 + 0.186 + (bowtiebase/2), + y + casethickness + 0.005 + 0.204 - bowtieheight, + z + skidthickness), thickness=0, material_id='pec') # Edges that represent wire between bowtie halves in 1mm model - edge(tx[0] + 0.16, tx[1] - dy, tx[2], tx[0] + 0.16, tx[1], tx[2], 'pec', rotate90origin=rotate90origin) - edge(tx[0] + 0.16, tx[1] + dy, tx[2], tx[0] + 0.16, tx[1] + 2*dy, tx[2], 'pec', rotate90origin=rotate90origin) - edge(tx[0], tx[1] - dy, tx[2], tx[0], tx[1], tx[2], 'pec', rotate90origin=rotate90origin) - edge(tx[0], tx[1] + dy, tx[2], tx[0], tx[1] + 2*dy, tx[2], 'pec', rotate90origin=rotate90origin) + e1 = gprMax.Edge(p1=(tx[0] + 0.16, tx[1] - dy, tx[2]), + p2=(tx[0] + 0.16, tx[1], tx[2]), material_id='pec') + e2 = gprMax.Edge(p1=(tx[0] + 0.16, tx[1] + dy, tx[2]), + p2=(tx[0] + 0.16, tx[1] + 2*dy, tx[2]), material_id='pec') + e3 = gprMax.Edge(p1=(tx[0], tx[1] - dy, tx[2]), + p2=(tx[0], tx[1], tx[2]), material_id='pec') + e4 = gprMax.Edge(p1=(tx[0], tx[1] + dy, tx[2]), + p2=(tx[0], tx[1] + 2*dy, tx[2]), material_id='pec') + scene_objects.extend((p1, p2, t1, t2, p3, p4, t3, t4, e1, e2, e3, e4)) elif resolution == 0.001: # "left" side # extension plates - plate(x + 0.01 + 0.005 + 0.026, y + casethickness + 0.005 + 0.023, z + skidthickness, x + 0.01 + 0.005 + 0.026 + bowtiebase, y + casethickness + 0.005 + 0.023 + patchheight, z + skidthickness, 'pec', rotate90origin=rotate90origin) # new - # box(x + 0.01 + 0.005 + 0.026, y + casethickness + 0.005 + 0.023, z + skidthickness, x + 0.01 + 0.005 + 0.026 + bowtiebase, y + casethickness + 0.005 + 0.023 + patchheight, z + skidthickness + 0.002, 'pec', rotate90origin=rotate90origin) # new - - plate(x + 0.01 + 0.005 + 0.026, y + casethickness + 0.005 + 0.204, z + skidthickness, x + 0.01 + 0.005 + 0.026 + bowtiebase, y + casethickness + 0.005 + 0.204 + patchheight, z + skidthickness, 'pec', rotate90origin=rotate90origin) # new - # box(x + 0.01 + 0.005 + 0.026, y + casethickness + 0.005 + 0.204, z + skidthickness, x + 0.01 + 0.005 + 0.026 + bowtiebase, y + casethickness + 0.005 + 0.204 + patchheight, z + skidthickness + 0.002, 'pec', rotate90origin=rotate90origin) # new - + p1 = gprMax.Plate(p1=(x + 0.01 + 0.005 + 0.026, + y + casethickness + 0.005 + 0.023, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.026 + bowtiebase, + y + casethickness + 0.005 + 0.023 + patchheight, + z + skidthickness), material_id='pec') + p2 = gprMax.Plate(p1=(x + 0.01 + 0.005 + 0.026, + y + casethickness + 0.005 + 0.204, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.026 + bowtiebase, + y + casethickness + 0.005 + 0.204 + patchheight, + z + skidthickness), material_id='pec') # triangles - # triangle(x + 0.01 + 0.005 + 0.026, y + casethickness + 0.005 + 0.083, z + skidthickness, - # x + 0.01 + 0.005 + 0.026 + bowtiebase, y + casethickness + 0.005 + 0.083, z + skidthickness, - # x + 0.01 + 0.005 + 0.026 + (bowtiebase/2), y + casethickness + 0.005 + 0.083 + bowtieheight, z + skidthickness, - # 0.002,'pec', rotate90origin=rotate90origin) - triangle(x + 0.01 + 0.005 + 0.026, y + casethickness + 0.005 + 0.083, z + skidthickness, - x + 0.01 + 0.005 + 0.026 + bowtiebase, y + casethickness + 0.005 + 0.083, z + skidthickness, - x + 0.01 + 0.005 + 0.026 + (bowtiebase/2), y + casethickness + 0.005 + 0.083 + bowtieheight, z + skidthickness, - 0,'pec', rotate90origin=rotate90origin) # new - # triangle(x + 0.01 + 0.005 + 0.026, y + casethickness + 0.005 + 0.204, z + skidthickness, - # x + 0.01 + 0.005 + 0.026 + bowtiebase, y + casethickness + 0.005 + 0.204, z + skidthickness, - # x + 0.01 + 0.005 + 0.026 + (bowtiebase/2), y + casethickness + 0.005 + 0.204 - bowtieheight, z + skidthickness, - # 0.002,'pec', rotate90origin=rotate90origin) - triangle(x + 0.01 + 0.005 + 0.026, y + casethickness + 0.005 + 0.204, z + skidthickness, - x + 0.01 + 0.005 + 0.026 + bowtiebase, y + casethickness + 0.005 + 0.204, z + skidthickness, - x + 0.01 + 0.005 + 0.026 + (bowtiebase/2), y + casethickness + 0.005 + 0.204 - bowtieheight, z + skidthickness, - 0,'pec', rotate90origin=rotate90origin) # new + t1 = gprMax.Triangle(p1=(x + 0.01 + 0.005 + 0.026, + y + casethickness + 0.005 + 0.083, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.026 + bowtiebase, + y + casethickness + 0.005 + 0.083, z + skidthickness), + p3=(x + 0.01 + 0.005 + 0.026 + (bowtiebase/2), + y + casethickness + 0.005 + 0.083 + bowtieheight, + z + skidthickness), thickness=0, material_id='pec') + t2 = gprMax.Triangle(p1=(x + 0.01 + 0.005 + 0.026, + y + casethickness + 0.005 + 0.204, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.026 + bowtiebase, + y + casethickness + 0.005 + 0.204, z + skidthickness), + p3=(x + 0.01 + 0.005 + 0.026 + (bowtiebase/2), + y + casethickness + 0.005 + 0.204 - bowtieheight, + z + skidthickness), thickness=0, material_id='pec') # "right" side - plate(x + 0.01 + 0.005 + 0.186, y + casethickness + 0.005 + 0.023, z + skidthickness, x + 0.01 + 0.005 + 0.186 + bowtiebase, y + casethickness + 0.005 + 0.023 + patchheight, z + skidthickness, 'pec', rotate90origin=rotate90origin) # new - # box(x + 0.01 + 0.005 + 0.186, y + casethickness + 0.005 + 0.023, z + skidthickness, x + 0.01 + 0.005 + 0.186 + bowtiebase, y + casethickness + 0.005 + 0.023 + patchheight, z + skidthickness + 0.002, 'pec', rotate90origin=rotate90origin) # new - - plate(x + 0.01 + 0.005 + 0.186, y + casethickness + 0.005 + 0.204, z + skidthickness, x + 0.01 + 0.005 + 0.186 + bowtiebase, y + casethickness + 0.005 + 0.204 + patchheight, z + skidthickness, 'pec', rotate90origin=rotate90origin) # new - # box(x + 0.01 + 0.005 + 0.186, y + casethickness + 0.005 + 0.204, z + skidthickness, x + 0.01 + 0.005 + 0.186 + bowtiebase, y + casethickness + 0.005 + 0.204 + patchheight, z + skidthickness + 0.002, 'pec', rotate90origin=rotate90origin) # new - + p3 = gprMax.Plate(p1=(x + 0.01 + 0.005 + 0.186, + y + casethickness + 0.005 + 0.023, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.186 + bowtiebase, + y + casethickness + 0.005 + 0.023 + patchheight, + z + skidthickness), material_id='pec') + p4 = gprMax.Plate(p1=(x + 0.01 + 0.005 + 0.186, + y + casethickness + 0.005 + 0.204, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.186 + bowtiebase, + y + casethickness + 0.005 + 0.204 + patchheight, + z + skidthickness), material_id='pec') # triangles - # triangle(x + 0.01 + 0.005 + 0.186, y + casethickness + 0.005 + 0.083, z + skidthickness, - # x + 0.01 + 0.005 + 0.186 + bowtiebase, y + casethickness + 0.005 + 0.083, z + skidthickness, - # x + 0.01 + 0.005 + 0.186 + (bowtiebase/2), y + casethickness + 0.005 + 0.083 + bowtieheight, z + skidthickness, - # 0.002,'pec', rotate90origin=rotate90origin) - triangle(x + 0.01 + 0.005 + 0.186, y + casethickness + 0.005 + 0.083, z + skidthickness, - x + 0.01 + 0.005 + 0.186 + bowtiebase, y + casethickness + 0.005 + 0.083, z + skidthickness, - x + 0.01 + 0.005 + 0.186 + (bowtiebase/2), y + casethickness + 0.005 + 0.083 + bowtieheight, z + skidthickness, - 0,'pec', rotate90origin=rotate90origin) - # triangle(x + 0.01 + 0.005 + 0.186, y + casethickness + 0.005 + 0.204, z + skidthickness, - # x + 0.01 + 0.005 + 0.186 + bowtiebase, y + casethickness + 0.005 + 0.204, z + skidthickness, - # x + 0.01 + 0.005 + 0.186 + (bowtiebase/2), y + casethickness + 0.005 + 0.204 - bowtieheight, z + skidthickness, - # 0.002,'pec', rotate90origin=rotate90origin) - triangle(x + 0.01 + 0.005 + 0.186, y + casethickness + 0.005 + 0.204, z + skidthickness, - x + 0.01 + 0.005 + 0.186 + bowtiebase, y + casethickness + 0.005 + 0.204, z + skidthickness, - x + 0.01 + 0.005 + 0.186 + (bowtiebase/2), y + casethickness + 0.005 + 0.204 - bowtieheight, z + skidthickness, - 0,'pec', rotate90origin=rotate90origin) + t3 = gprMax.Triangle(p1=(x + 0.01 + 0.005 + 0.186, + y + casethickness + 0.005 + 0.083, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.186 + bowtiebase, + y + casethickness + 0.005 + 0.083, z + skidthickness), + p3=(x + 0.01 + 0.005 + 0.186 + (bowtiebase/2), + y + casethickness + 0.005 + 0.083 + bowtieheight, + z + skidthickness), thickness=0, material_id='pec') + t4 = gprMax.Triangle(p1=(x + 0.01 + 0.005 + 0.186, + y + casethickness + 0.005 + 0.204, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.186 + bowtiebase, + y + casethickness + 0.005 + 0.204, z + skidthickness), + p3=(x + 0.01 + 0.005 + 0.186 + (bowtiebase/2), + y + casethickness + 0.005 + 0.204 - bowtieheight, + z + skidthickness), thickness=0, material_id='pec') # Edges that represent wire between bowtie halves in 1mm model - edge(tx[0] + 0.16, tx[1] - dy, tx[2], tx[0] + 0.16, tx[1], tx[2], 'pec', rotate90origin=rotate90origin) - edge(tx[0] + 0.16, tx[1] + dy, tx[2], tx[0] + 0.16, tx[1] + 2*dy, tx[2], 'pec', rotate90origin=rotate90origin) - edge(tx[0], tx[1] - dy, tx[2], tx[0], tx[1], tx[2], 'pec', rotate90origin=rotate90origin) - edge(tx[0], tx[1] + dy, tx[2], tx[0], tx[1] + 2*dy, tx[2], 'pec', rotate90origin=rotate90origin) + e1 = gprMax.Edge(p1=(tx[0] + 0.16, tx[1] - dy, tx[2]), + p2=(tx[0] + 0.16, tx[1], tx[2]), material_id='pec') + e2 = gprMax.Edge(p1=(tx[0] + 0.16, tx[1] + dy, tx[2]), + p2=(tx[0] + 0.16, tx[1] + 2*dy, tx[2]), material_id='pec') + e3 = gprMax.Edge(p1=(tx[0], tx[1] - dy, tx[2]), + p2=(tx[0], tx[1], tx[2]), material_id='pec') + e4 = gprMax.Edge(p1=(tx[0], tx[1] + dy, tx[2]), + p2=(tx[0], tx[1] + 2*dy, tx[2]), material_id='pec') + scene_objects.extend((p1, p2, t1, t2, p3, p4, t3, t4, e1, e2, e3, e4)) elif resolution == 0.002: # "left" side # extension plates - plate(x + 0.01 + 0.005 + 0.025, y + casethickness + 0.005 + 0.021, z + skidthickness, x + 0.01 + 0.005 + 0.025 + bowtiebase, y + casethickness + 0.005 + 0.021 + patchheight, z + skidthickness, 'pec', rotate90origin=rotate90origin) # new (for use with edges) - # box(x + 0.01 + 0.005 + 0.025, y + casethickness + 0.005 + 0.021, z + skidthickness, x + 0.01 + 0.005 + 0.025 + bowtiebase, y + casethickness + 0.005 + 0.021 + patchheight, z + skidthickness + 0.002, 'pec', rotate90origin=rotate90origin) # new (for use with edges) - plate(x + 0.01 + 0.005 + 0.025, y + casethickness + 0.005 + 0.203, z + skidthickness, x + 0.01 + 0.005 + 0.025 + bowtiebase, y + casethickness + 0.005 + 0.203 + patchheight, z + skidthickness, 'pec', rotate90origin=rotate90origin) # new (for use with edges) - # box(x + 0.01 + 0.005 + 0.025, y + casethickness + 0.005 + 0.203, z + skidthickness, x + 0.01 + 0.005 + 0.025 + bowtiebase, y + casethickness + 0.005 + 0.203 + patchheight, z + skidthickness + 0.002, 'pec', rotate90origin=rotate90origin) # new (for use with edges) - + p1 = gprMax.Plate(p1=(x + 0.01 + 0.005 + 0.025, + y + casethickness + 0.005 + 0.021, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.025 + bowtiebase, + y + casethickness + 0.005 + 0.021 + patchheight, + z + skidthickness), material_id='pec') + p2 = gprMax.Plate(p1=(x + 0.01 + 0.005 + 0.025, + y + casethickness + 0.005 + 0.203, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.025 + bowtiebase, + y + casethickness + 0.005 + 0.203 + patchheight, + z + skidthickness), material_id='pec') # triangles - # triangle(x + 0.01 + 0.005 + 0.025, y + casethickness + 0.005 + 0.081, z + skidthickness, - # x + 0.01 + 0.005 + 0.025 + bowtiebase, y + casethickness + 0.005 + 0.081, z + skidthickness, - # x + 0.01 + 0.005 + 0.025 + (bowtiebase/2), y + casethickness + 0.005 + 0.081 + bowtieheight, z + skidthickness, - # 0.002,'pec', rotate90origin=rotate90origin) # new (for use with edges) - triangle(x + 0.01 + 0.005 + 0.025, y + casethickness + 0.005 + 0.081, z + skidthickness, - x + 0.01 + 0.005 + 0.025 + bowtiebase, y + casethickness + 0.005 + 0.081, z + skidthickness, - x + 0.01 + 0.005 + 0.025 + (bowtiebase/2), y + casethickness + 0.005 + 0.081 + bowtieheight, z + skidthickness, - 0,'pec', rotate90origin=rotate90origin) # new (for use with edges) - # triangle(x + 0.01 + 0.005 + 0.025, y + casethickness + 0.005 + 0.203, z + skidthickness, - # x + 0.01 + 0.005 + 0.025 + bowtiebase, y + casethickness + 0.005 + 0.203, z + skidthickness, - # x + 0.01 + 0.005 + 0.025 + (bowtiebase/2), y + casethickness + 0.005 + 0.203 - bowtieheight, z + skidthickness, - # 0.002,'pec', rotate90origin=rotate90origin) # new (for use with edges) - triangle(x + 0.01 + 0.005 + 0.025, y + casethickness + 0.005 + 0.203, z + skidthickness, - x + 0.01 + 0.005 + 0.025 + bowtiebase, y + casethickness + 0.005 + 0.203, z + skidthickness, - x + 0.01 + 0.005 + 0.025 + (bowtiebase/2), y + casethickness + 0.005 + 0.203 - bowtieheight, z + skidthickness, - 0,'pec', rotate90origin=rotate90origin) # new (for use with edges) - + t1 = gprMax.Triangle(p1=(x + 0.01 + 0.005 + 0.025, + y + casethickness + 0.005 + 0.081, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.025 + bowtiebase, + y + casethickness + 0.005 + 0.081, z + skidthickness), + p3=(x + 0.01 + 0.005 + 0.025 + (bowtiebase/2), + y + casethickness + 0.005 + 0.081 + bowtieheight, + z + skidthickness), thickness=0, material_id='pec') + t2 = gprMax.Triangle(p1=(x + 0.01 + 0.005 + 0.025, + y + casethickness + 0.005 + 0.203, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.025 + bowtiebase, + y + casethickness + 0.005 + 0.203, z + skidthickness), + p3=(x + 0.01 + 0.005 + 0.025 + (bowtiebase/2), + y + casethickness + 0.005 + 0.203 - bowtieheight, + z + skidthickness), thickness=0, material_id='pec') # "right" side - plate(x + 0.01 + 0.005 + 0.187, y + casethickness + 0.005 + 0.021, z + skidthickness, x + 0.01 + 0.005 + 0.187 + bowtiebase, y + casethickness + 0.005 + 0.021 + patchheight, z + skidthickness, 'pec', rotate90origin=rotate90origin) # new (for use with edges) - # box(x + 0.01 + 0.005 + 0.187, y + casethickness + 0.005 + 0.021, z + skidthickness, x + 0.01 + 0.005 + 0.187 + bowtiebase, y + casethickness + 0.005 + 0.021 + patchheight, z + skidthickness + 0.002, 'pec', rotate90origin=rotate90origin) # new (for use with edges) - plate(x + 0.01 + 0.005 + 0.187, y + casethickness + 0.005 + 0.203, z + skidthickness, x + 0.01 + 0.005 + 0.187 + bowtiebase, y + casethickness + 0.005 + 0.203 + patchheight, z + skidthickness, 'pec', rotate90origin=rotate90origin) # new (for use with edges) - # box(x + 0.01 + 0.005 + 0.187, y + casethickness + 0.005 + 0.203, z + skidthickness, x + 0.01 + 0.005 + 0.187 + bowtiebase, y + casethickness + 0.005 + 0.203 + patchheight, z + skidthickness + 0.002, 'pec', rotate90origin=rotate90origin) # new (for use with edges) - + p3 = gprMax.Plate(p1=(x + 0.01 + 0.005 + 0.187, + y + casethickness + 0.005 + 0.021, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.187 + bowtiebase, + y + casethickness + 0.005 + 0.021 + patchheight, + z + skidthickness), material_id='pec') + p4 = gprMax.Plate(p1=(x + 0.01 + 0.005 + 0.187, + y + casethickness + 0.005 + 0.203, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.187 + bowtiebase, + y + casethickness + 0.005 + 0.203 + patchheight, + z + skidthickness), material_id='pec') # triangles - # triangle(x + 0.01 + 0.005 + 0.187, y + casethickness + 0.005 + 0.081, z + skidthickness, - # x + 0.01 + 0.005 + 0.187 + bowtiebase, y + casethickness + 0.005 + 0.081, z + skidthickness, - # x + 0.01 + 0.005 + 0.187 + (bowtiebase/2), y + casethickness + 0.005 + 0.081 + bowtieheight, z + skidthickness, - # 0.002,'pec', rotate90origin=rotate90origin) # new (for use with edges) - triangle(x + 0.01 + 0.005 + 0.187, y + casethickness + 0.005 + 0.081, z + skidthickness, - x + 0.01 + 0.005 + 0.187 + bowtiebase, y + casethickness + 0.005 + 0.081, z + skidthickness, - x + 0.01 + 0.005 + 0.187 + (bowtiebase/2), y + casethickness + 0.005 + 0.081 + bowtieheight, z + skidthickness, - 0,'pec', rotate90origin=rotate90origin) # new (for use with edges) - # triangle(x + 0.01 + 0.005 + 0.187, y + casethickness + 0.005 + 0.203, z + skidthickness, - # x + 0.01 + 0.005 + 0.187 + bowtiebase, y + casethickness + 0.005 + 0.203, z + skidthickness, - # x + 0.01 + 0.005 + 0.187 + (bowtiebase/2), y + casethickness + 0.005 + 0.203 - bowtieheight, z + skidthickness, - # 0.002,'pec', rotate90origin=rotate90origin) # new (for use with edges) - triangle(x + 0.01 + 0.005 + 0.187, y + casethickness + 0.005 + 0.203, z + skidthickness, - x + 0.01 + 0.005 + 0.187 + bowtiebase, y + casethickness + 0.005 + 0.203, z + skidthickness, - x + 0.01 + 0.005 + 0.187 + (bowtiebase/2), y + casethickness + 0.005 + 0.203 - bowtieheight, z + skidthickness, - 0,'pec', rotate90origin=rotate90origin) # new (for use with edges) + t3 = gprMax.Triangle(p1=(x + 0.01 + 0.005 + 0.187, + y + casethickness + 0.005 + 0.081, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.187 + bowtiebase, + y + casethickness + 0.005 + 0.081, z + skidthickness), + p3=(x + 0.01 + 0.005 + 0.187 + (bowtiebase/2), + y + casethickness + 0.005 + 0.081 + bowtieheight, + z + skidthickness), thickness=0, material_id='pec') + t4 = gprMax.Triangle(p1=(x + 0.01 + 0.005 + 0.187, + y + casethickness + 0.005 + 0.203, z + skidthickness), + p2=(x + 0.01 + 0.005 + 0.187 + bowtiebase, + y + casethickness + 0.005 + 0.203, z + skidthickness), + p3=(x + 0.01 + 0.005 + 0.187 + (bowtiebase/2), + y + casethickness + 0.005 + 0.203 - bowtieheight, + z + skidthickness), thickness=0, material_id='pec') # Edges that represent wire between bowtie halves in 2mm model - edge(tx[0] + 0.162, tx[1] - dy, tx[2], tx[0] + 0.162, tx[1], tx[2], 'pec', rotate90origin=rotate90origin) - edge(tx[0] + 0.162, tx[1] + dy, tx[2], tx[0] + 0.162, tx[1] + 2*dy, tx[2], 'pec', rotate90origin=rotate90origin) - edge(tx[0], tx[1] - dy, tx[2], tx[0], tx[1], tx[2], 'pec', rotate90origin=rotate90origin) - edge(tx[0], tx[1] + dy, tx[2], tx[0], tx[1] + 2*dy, tx[2], 'pec', rotate90origin=rotate90origin) + e1 = gprMax.Edge(p1=(tx[0] + 0.162, tx[1] - dy, tx[2]), + p2=(tx[0] + 0.162, tx[1], tx[2]), material_id='pec') + e2 = gprMax.Edge(p1=(tx[0] + 0.162, tx[1] + dy, tx[2]), + p2=(tx[0] + 0.162, tx[1] + 2*dy, tx[2]), material_id='pec') + e3 = gprMax.Edge(p1=(tx[0], tx[1] - dy, tx[2]), + p2=(tx[0], tx[1], tx[2]), material_id='pec') + e4 = gprMax.Edge(p1=(tx[0], tx[1] + dy, tx[2]), + p2=(tx[0], tx[1] + 2*dy, tx[2]), material_id='pec') + scene_objects.extend((p1, p2, t1, t2, p3, p4, t3, t4, e1, e2, e3, e4)) - # "left" side - # extension plates - plate(x + 0.01 + 0.005 + 0.025, y + casethickness + 0.005 + 0.021, z + skidthickness, x + 0.01 + 0.005 + 0.025 + bowtiebase, y + casethickness + 0.005 + 0.021 + patchheight, z + skidthickness, 'pec', rotate90origin=rotate90origin) # new (for use with edges) - # box(x + 0.01 + 0.005 + 0.025, y + casethickness + 0.005 + 0.021, z + skidthickness, x + 0.01 + 0.005 + 0.025 + bowtiebase, y + casethickness + 0.005 + 0.021 + patchheight, z + skidthickness + 0.002, 'pec', rotate90origin=rotate90origin) # new (for use with edges) - plate(x + 0.01 + 0.005 + 0.025, y + casethickness + 0.005 + 0.203, z + skidthickness, x + 0.01 + 0.005 + 0.025 + bowtiebase, y + casethickness + 0.005 + 0.203 + patchheight, z + skidthickness, 'pec', rotate90origin=rotate90origin) # new (for use with edges) - # box(x + 0.01 + 0.005 + 0.025, y + casethickness + 0.005 + 0.203, z + skidthickness, x + 0.01 + 0.005 + 0.025 + bowtiebase, y + casethickness + 0.005 + 0.203 + patchheight, z + skidthickness + 0.002, 'pec', rotate90origin=rotate90origin) # new (for use with edges) - - # triangles - # triangle(x + 0.01 + 0.005 + 0.025, y + casethickness + 0.005 + 0.081, z + skidthickness, - # x + 0.01 + 0.005 + 0.025 + bowtiebase, y + casethickness + 0.005 + 0.081, z + skidthickness, - # x + 0.01 + 0.005 + 0.025 + (bowtiebase/2), y + casethickness + 0.005 + 0.081 + bowtieheight, z + skidthickness, - # 0.002,'pec', rotate90origin=rotate90origin) # new (for use with edges) - triangle(x + 0.01 + 0.005 + 0.025, y + casethickness + 0.005 + 0.081, z + skidthickness, - x + 0.01 + 0.005 + 0.025 + bowtiebase, y + casethickness + 0.005 + 0.081, z + skidthickness, - x + 0.01 + 0.005 + 0.025 + (bowtiebase/2), y + casethickness + 0.005 + 0.081 + bowtieheight, z + skidthickness, - 0,'pec', rotate90origin=rotate90origin) # new (for use with edges) - # triangle(x + 0.01 + 0.005 + 0.025, y + casethickness + 0.005 + 0.203, z + skidthickness, - # x + 0.01 + 0.005 + 0.025 + bowtiebase, y + casethickness + 0.005 + 0.203, z + skidthickness, - # x + 0.01 + 0.005 + 0.025 + (bowtiebase/2), y + casethickness + 0.005 + 0.203 - bowtieheight, z + skidthickness, - # 0.002,'pec', rotate90origin=rotate90origin) # new (for use with edges) - triangle(x + 0.01 + 0.005 + 0.025, y + casethickness + 0.005 + 0.203, z + skidthickness, - x + 0.01 + 0.005 + 0.025 + bowtiebase, y + casethickness + 0.005 + 0.203, z + skidthickness, - x + 0.01 + 0.005 + 0.025 + (bowtiebase/2), y + casethickness + 0.005 + 0.203 - bowtieheight, z + skidthickness, - 0,'pec', rotate90origin=rotate90origin) # new (for use with edges) - - # "right" side - plate(x + 0.01 + 0.005 + 0.187, y + casethickness + 0.005 + 0.021, z + skidthickness, x + 0.01 + 0.005 + 0.187 + bowtiebase, y + casethickness + 0.005 + 0.021 + patchheight, z + skidthickness, 'pec', rotate90origin=rotate90origin) # new (for use with edges) - # box(x + 0.01 + 0.005 + 0.187, y + casethickness + 0.005 + 0.021, z + skidthickness, x + 0.01 + 0.005 + 0.187 + bowtiebase, y + casethickness + 0.005 + 0.021 + patchheight, z + skidthickness + 0.002, 'pec', rotate90origin=rotate90origin) # new (for use with edges) - plate(x + 0.01 + 0.005 + 0.187, y + casethickness + 0.005 + 0.203, z + skidthickness, x + 0.01 + 0.005 + 0.187 + bowtiebase, y + casethickness + 0.005 + 0.203 + patchheight, z + skidthickness, 'pec', rotate90origin=rotate90origin) # new (for use with edges) - # box(x + 0.01 + 0.005 + 0.187, y + casethickness + 0.005 + 0.203, z + skidthickness, x + 0.01 + 0.005 + 0.187 + bowtiebase, y + casethickness + 0.005 + 0.203 + patchheight, z + skidthickness + 0.002, 'pec', rotate90origin=rotate90origin) # new (for use with edges) - - # triangles - # triangle(x + 0.01 + 0.005 + 0.187, y + casethickness + 0.005 + 0.081, z + skidthickness, - # x + 0.01 + 0.005 + 0.187 + bowtiebase, y + casethickness + 0.005 + 0.081, z + skidthickness, - # x + 0.01 + 0.005 + 0.187 + (bowtiebase/2), y + casethickness + 0.005 + 0.081 + bowtieheight, z + skidthickness, - # 0.002,'pec', rotate90origin=rotate90origin) # new (for use with edges) - triangle(x + 0.01 + 0.005 + 0.187, y + casethickness + 0.005 + 0.081, z + skidthickness, - x + 0.01 + 0.005 + 0.187 + bowtiebase, y + casethickness + 0.005 + 0.081, z + skidthickness, - x + 0.01 + 0.005 + 0.187 + (bowtiebase/2), y + casethickness + 0.005 + 0.081 + bowtieheight, z + skidthickness, - 0,'pec', rotate90origin=rotate90origin) # new (for use with edges) - # triangle(x + 0.01 + 0.005 + 0.187, y + casethickness + 0.005 + 0.203, z + skidthickness, - # x + 0.01 + 0.005 + 0.187 + bowtiebase, y + casethickness + 0.005 + 0.203, z + skidthickness, - # x + 0.01 + 0.005 + 0.187 + (bowtiebase/2), y + casethickness + 0.005 + 0.203 - bowtieheight, z + skidthickness, - # 0.002,'pec', rotate90origin=rotate90origin) # new (for use with edges) - triangle(x + 0.01 + 0.005 + 0.187, y + casethickness + 0.005 + 0.203, z + skidthickness, - x + 0.01 + 0.005 + 0.187 + bowtiebase, y + casethickness + 0.005 + 0.203, z + skidthickness, - x + 0.01 + 0.005 + 0.187 + (bowtiebase/2), y + casethickness + 0.005 + 0.203 - bowtieheight, z + skidthickness, - 0,'pec', rotate90origin=rotate90origin) # new (for use with edges) - - # Edges that represent wire between bowtie halves in 2mm model - edge(tx[0] + 0.162, tx[1] - dy, tx[2], tx[0] + 0.162, tx[1], tx[2], 'pec', rotate90origin=rotate90origin) - edge(tx[0] + 0.162, tx[1] + dy, tx[2], tx[0] + 0.162, tx[1] + 2*dy, tx[2], 'pec', rotate90origin=rotate90origin) - edge(tx[0], tx[1] - dy, tx[2], tx[0], tx[1], tx[2], 'pec', rotate90origin=rotate90origin) - edge(tx[0], tx[1] + dy, tx[2], tx[0], tx[1] + 2*dy, tx[2], 'pec', rotate90origin=rotate90origin) - - # metallic plate extension - box(x + (casesize[0] / 2), y + casethickness, z + skidthickness, x + (casesize[0] / 2) + shieldthickness, y + casesize[1] - casethickness, z + skidthickness + metalmiddleplateheight, 'pec', rotate90origin=rotate90origin) # new + # Metallic plate extension + b15 = gprMax.Box(p1=(x + (casesize[0] / 2), y + casethickness, z + skidthickness), + p2=(x + (casesize[0] / 2) + shieldthickness, + y + casesize[1] - casethickness, z + skidthickness + metalmiddleplateheight), + material_id='pec') + # Skid if smooth_dec == 'yes': - # Skid - box(x, y, z, x + casesize[0], y + casesize[1], z + skidthickness - 0.002, 'hdpe', rotate90origin=rotate90origin) # new - + b16 = gprMax.Box(p1=(x, y, z), + p2=(x + casesize[0], y + casesize[1], z + skidthickness - 0.002), + material_id='hdpe') elif smooth_dec == 'no': - # Skid - box(x, y, z, x + casesize[0], y + casesize[1], z + skidthickness - 0.002, 'hdpe', 'n', rotate90origin=rotate90origin) # new + b16 = gprMax.Box(p1=(x, y, z), + p2=(x + casesize[0], y + casesize[1], z + skidthickness - 0.002), + material_id='hdpe', averaging='n') + scene_objects.extend((b15, b16)) + # Source # Excitation - Gaussian pulse - print('#waveform: gaussian 1 {} myGaussian'.format(excitationfreq)) - if src_type == 'voltage_source': - print('#voltage_source: y {} {} {} {} myGaussian'.format(tx[0], tx[1], tx[2], sourceresistance)) - elif src_type == 'transmission_line': - print('#transmission_line: y {} {} {} {} myGaussian'.format(tx[0], tx[1], tx[2], sourceresistance)) + w1 = gprMax.Waveform(wave_type='gaussian', amp=1, freq=excitationfreq, id='my_gaussian') + scene_objects.append(w1) - # Output point - receiver bowtie - print('#waveform: gaussian 0 4e8 my_zero_src') + if src_type == 'voltage_source': + vs1 = gprMax.VoltageSource(polarisation='y', p1=(tx[0], tx[1], tx[2]), + resistance=sourceresistance, waveform_id='my_gaussian') + scene_objects.append(vs1) + elif src_type == 'transmission_line': + tl1 = gprMax.TransmissionLine(polarisation='y', p1=(tx[0], tx[1], tx[2]), + resistance=sourceresistance, waveform_id='my_gaussian') + scene_objects.append(tl1) + + # Receiver + # Zero waveform to use with transmission line at receiver output + w2 = gprMax.Waveform(wave_type='gaussian', amp=0, freq=excitationfreq, id='my_zero_wave') + scene_objects.append(w2) if resolution == 0.001 or resolution == 0.0005: if src_type == 'transmission_line': - print('#transmission_line: y {} {} {} {} my_zero_src'.format(tx[0] + 0.16, tx[1], tx[2], receiverresistance)) + tl2 = gprMax.TransmissionLine(polarisation='y', p1=(tx[0] + 0.16, tx[1], tx[2]), + resistance=receiverresistance, waveform_id='my_zero_wave') + scene_objects.append(tl2) elif src_type == 'voltage_source': - print('#voltage_source: y {} {} {} {} my_zero_src'.format(tx[0] + 0.16, tx[1], tx[2], receiverresistance)) - print('#rx: {} {} {} {} {}'.format(tx[0] + 0.16, tx[1], tx[2], 'rx1', 'Ey')) + r1 = gprMax.Rx(p1=(tx[0] + 0.16, tx[1], tx[2]), id='rxbowtie', outputs='Ey') + scene_objects.append(r1) elif resolution == 0.002: if src_type == 'transmission_line': - print('#transmission_line: y {} {} {} {} my_zero_src'.format(tx[0] + 0.162, tx[1], tx[2], receiverresistance)) + tl2 = gprMax.TransmissionLine(polarisation='y', p1=(tx[0] + 0.162, tx[1], tx[2]), + resistance=receiverresistance, waveform_id='my_zero_wave') + scene_objects.append(tl2) elif src_type == 'voltage_source': - print('#rx: {} {} {} {} {}'.format(tx[0] + 0.162, tx[1], tx[2], 'rx1', 'Ey')) + r1 = gprMax.Rx(p1=(tx[0] + 0.162, tx[1], tx[2]), id='rxbowtie', outputs='Ey') + scene_objects.append(r1) # Geometry views - # geometry_view(x - dx, y - dy, z - dz, x + casesize[0] + dx, y + casesize[1] + dy, z + skidthickness + casesize[2] + dz, dx, dy, dz, 'antenna_like_GSSI_400') - # geometry_view(x, y, z, x + casesize[0], y + casesize[1], z + 0.010, dx, dy, dz, 'antenna_like_GSSI_400_pcb', type='f') + gv1 = gprMax.GeometryView(p1=(x - dx, y - dy, z - dz), p2=(x + casesize[0] + dx, + y + casesize[1] + dy, z + skidthickness + casesize[2] + dz), + dl=(dx, dy, dz), filename='antenna_like_GSSI_400', + output_type='n') + gv2 = gprMax.GeometryView(p1=(x, y, z), p2=(x + casesize[0], y + casesize[1], z + 0.010), + dl=(dx, dy, dz), filename='antenna_like_GSSI_400_pcb', + output_type='f') + # scene_objects.extend((gv1, gv2)) + + return scene_objects diff --git a/user_libs/antennas/MALA.py b/user_libs/antennas/MALA.py index 83ee2ce4..c5f4df45 100644 --- a/user_libs/antennas/MALA.py +++ b/user_libs/antennas/MALA.py @@ -5,23 +5,29 @@ # # Please use the attribution at http://dx.doi.org/10.1190/1.3548506 -import os - +import gprMax from gprMax.exceptions import CmdInputError -from gprMax.input_cmd_funcs import * - -userlibdir = os.path.dirname(os.path.abspath(__file__)) -def antenna_like_MALA_1200(x, y, z, resolution=0.001, rotate90=False): - """Inserts a description of an antenna similar to the MALA 1.2GHz antenna. Can be used with 1mm (default) or 2mm spatial resolution. The external dimensions of the antenna are 184x109x46mm. One output point is defined between the arms of the receiver bowtie. The bowties are aligned with the y axis so the output is the y component of the electric field (x component if the antenna is rotated 90 degrees). +def antenna_like_MALA_1200(x, y, z, resolution=0.001): + """Inserts a description of an antenna similar to the MALA 1.2GHz antenna. + Can be used with 1mm (default) or 2mm spatial resolution. + The external dimensions of the antenna are 184x109x46mm. + One output point is defined between the arms of the receiver bowtie. + The bowties are aligned with the y axis so the output is the y component + of the electric field (x component if the antenna is rotated 90 degrees). Args: x, y, z (float): Coordinates of a location in the model to insert the antenna. Coordinates are relative to the geometric centre of the antenna in the x-y plane and the bottom of the antenna skid in the z direction. resolution (float): Spatial resolution for the antenna model. - rotate90 (bool): Rotate model 90 degrees CCW in xy plane. + + Returns: + scene_objects (list): All model objects that will be part of a scene. """ + # All model objects that will be returned by function + scene_objects = [] + # Antenna geometry properties casesize = (0.184, 0.109, 0.040) casethickness = 0.002 @@ -33,14 +39,6 @@ def antenna_like_MALA_1200(x, y, z, resolution=0.001, rotate90=False): skidthickness = 0.006 bowtieheight = 0.025 - # Set origin for rotation to geometric centre of antenna in x-y plane if required, and set output component for receiver - if rotate90: - rotate90origin = (x, y) - output = 'Ex' - else: - rotate90origin = () - output = 'Ey' - # Original optimised values from http://hdl.handle.net/1842/4074 excitationfreq = 0.978e9 sourceresistance = 1000 @@ -83,152 +81,382 @@ def antenna_like_MALA_1200(x, y, z, resolution=0.001, rotate90=False): rxsiglower = ((1 / rxrescelllower) * (dy / (dx * dz))) / 2 # Divide by number of parallel edges per resistor # Material definitions - material(absorberEr, absorbersig, 1, 0, 'absorber') - material(3, 0, 1, 0, 'pcb') - material(2.35, 0, 1, 0, 'hdpe') - material(2.26, 0, 1, 0, 'polypropylene') - material(3, txsiglower, 1, 0, 'txreslower') - material(3, txsigupper, 1, 0, 'txresupper') - material(3, rxsiglower, 1, 0, 'rxreslower') - material(3, rxsigupper, 1, 0, 'rxresupper') + absorber = gprMax.Material(er=absorberEr, se=absorbersig, mr=1, sm=0, id='absorber') + pcb = gprMax.Material(er=3, se=0, mr=1, sm=0, id='pcb') + hdpe = gprMax.Material(er=2.35, se=0, mr=1, sm=0, id='hdpe') + polypropylene = gprMax.Material(er=2.26, se=0, mr=1, sm=0, id='polypropylene') + txreslower = gprMax.Material(er=3, se=txsiglower, mr=1, sm=0, id='txreslower') + txresupper = gprMax.Material(er=3, se=txsigupper, mr=1, sm=0, id='txresupper') + rxreslower = gprMax.Material(er=3, se=rxsiglower, mr=1, sm=0, id='rxreslower') + rxresupper = gprMax.Material(er=3, se=rxsigupper, mr=1, sm=0, id='rxresupper') + scene_objects.extend((absorber, pcb, hdpe, polypropylene, txreslower, txresupper, + rxreslower, rxresupper)) # Antenna geometry # Shield - metallic enclosure - box(x, y, z + skidthickness, x + casesize[0], y + casesize[1], z + skidthickness + casesize[2], 'pec', rotate90origin=rotate90origin) - box(x + 0.020, y + casethickness, z + skidthickness, x + 0.100, y + casesize[1] - casethickness, z + skidthickness + casethickness, 'free_space', rotate90origin=rotate90origin) - box(x + 0.100, y + casethickness, z + skidthickness, x + casesize[0] - casethickness, y + casesize[1] - casethickness, z + skidthickness + casethickness, 'free_space', rotate90origin=rotate90origin) + b1 = gprMax.Box(p1=(x, y, z + skidthickness), + p2=(x + casesize[0], y + casesize[1], z + skidthickness + casesize[2]), + material_id='pec') + b2 = gprMax.Box(p1=(x + 0.020, y + casethickness, z + skidthickness), + p2=(x + 0.100, y + casesize[1] - casethickness, + z + skidthickness + casethickness), material_id='free_space') + b3 = gprMax.Box(p1=(x + 0.100, y + casethickness, z + skidthickness), + p2=(x + casesize[0] - casethickness, y + casesize[1] - casethickness, + z + skidthickness + casethickness), material_id='free_space') # Absorber material - box(x + 0.020, y + casethickness, z + skidthickness, x + 0.100, y + casesize[1] - casethickness, z + skidthickness + casesize[2] - casethickness, 'absorber', rotate90origin=rotate90origin) - box(x + 0.100, y + casethickness, z + skidthickness, x + casesize[0] - casethickness, y + casesize[1] - casethickness, z + skidthickness + casesize[2] - casethickness, 'absorber', rotate90origin=rotate90origin) + b4 = gprMax.Box(p1=(x + 0.020, y + casethickness, z + skidthickness), + p2=(x + 0.100, y + casesize[1] - casethickness, + z + skidthickness + casesize[2] - casethickness), + material_id='absorber') + b5 = gprMax.Box(p1=(x + 0.100, y + casethickness, z + skidthickness), + p2=(x + casesize[0] - casethickness, y + casesize[1] - casethickness, + z + skidthickness + casesize[2] - casethickness), + material_id='absorber') + scene_objects.extend((b1, b2, b3, b4, b5)) # Shield - cylindrical sections - cylinder(x + 0.055, y + casesize[1] - 0.008, z + skidthickness, x + 0.055, y + casesize[1] - 0.008, z + skidthickness + casesize[2] - casethickness, 0.008, 'pec', rotate90origin=rotate90origin) - cylinder(x + 0.055, y + 0.008, z + skidthickness, x + 0.055, y + 0.008, z + skidthickness + casesize[2] - casethickness, 0.008, 'pec', rotate90origin=rotate90origin) - cylinder(x + 0.147, y + casesize[1] - 0.008, z + skidthickness, x + 0.147, y + casesize[1] - 0.008, z + skidthickness + casesize[2] - casethickness, 0.008, 'pec', rotate90origin=rotate90origin) - cylinder(x + 0.147, y + 0.008, z + skidthickness, x + 0.147, y + 0.008, z + skidthickness + casesize[2] - casethickness, 0.008, 'pec', rotate90origin=rotate90origin) - cylinder(x + 0.055, y + casesize[1] - 0.008, z + skidthickness, x + 0.055, y + casesize[1] - 0.008, z + skidthickness + casesize[2] - casethickness, 0.007, 'free_space', rotate90origin=rotate90origin) - cylinder(x + 0.055, y + 0.008, z + skidthickness, x + 0.055, y + 0.008, z + skidthickness + casesize[2] - casethickness, 0.007, 'free_space', rotate90origin=rotate90origin) - cylinder(x + 0.147, y + casesize[1] - 0.008, z + skidthickness, x + 0.147, y + casesize[1] - 0.008, z + skidthickness + casesize[2] - casethickness, 0.007, 'free_space', rotate90origin=rotate90origin) - cylinder(x + 0.147, y + 0.008, z + skidthickness, x + 0.147, y + 0.008, z + skidthickness + casesize[2] - casethickness, 0.007, 'free_space', rotate90origin=rotate90origin) - box(x + 0.054, y + casesize[1] - 0.016, z + skidthickness, x + 0.056, y + casesize[1] - 0.014, z + skidthickness + casesize[2] - casethickness, 'free_space', rotate90origin=rotate90origin) - box(x + 0.054, y + 0.014, z + skidthickness, x + 0.056, y + 0.016, z + skidthickness + casesize[2] - casethickness, 'free_space', rotate90origin=rotate90origin) - box(x + 0.146, y + casesize[1] - 0.016, z + skidthickness, x + 0.148, y + casesize[1] - 0.014, z + skidthickness + casesize[2] - casethickness, 'free_space', rotate90origin=rotate90origin) - box(x + 0.146, y + 0.014, z + skidthickness, x + 0.148, y + 0.016, z + skidthickness + casesize[2] - casethickness, 'free_space', rotate90origin=rotate90origin) + c1 = gprMax.Cylinder(p1=(x + 0.055, y + casesize[1] - 0.008, z + skidthickness), + p2=(x + 0.055, y + casesize[1] - 0.008, + z + skidthickness + casesize[2] - casethickness), + r=0.008, material_id='pec') + c2 = gprMax.Cylinder(p1=(x + 0.055, y + 0.008, z + skidthickness), + p2=(x + 0.055, y + 0.008, + z + skidthickness + casesize[2] - casethickness), + r=0.008, material_id='pec') + c3 = gprMax.Cylinder(p1=(x + 0.147, y + casesize[1] - 0.008, z + skidthickness), + p2=(x + 0.147, y + casesize[1] - 0.008, + z + skidthickness + casesize[2] - casethickness), + r=0.008, material_id='pec') + c4 = gprMax.Cylinder(p1=(x + 0.147, y + 0.008, z + skidthickness), + p2=(x + 0.147, y + 0.008, + z + skidthickness + casesize[2] - casethickness), + r=0.008, material_id='pec') + c5 = gprMax.Cylinder(p1=(x + 0.055, y + casesize[1] - 0.008, z + skidthickness), + p2=(x + 0.055, y + casesize[1] - 0.008, + z + skidthickness + casesize[2] - casethickness), + r=0.007, material_id='free_space') + c6 = gprMax.Cylinder(p1=(x + 0.055, y + 0.008, z + skidthickness), + p2=(x + 0.055, y + 0.008, + z + skidthickness + casesize[2] - casethickness), + r=0.007, material_id='free_space') + c7 = gprMax.Cylinder(p1=(x + 0.147, y + casesize[1] - 0.008, z + skidthickness), + p2=(x + 0.147, y + casesize[1] - 0.008, + z + skidthickness + casesize[2] - casethickness), + r=0.007, material_id='free_space') + c8 = gprMax.Cylinder(p1=(x + 0.147, y + 0.008, z + skidthickness), + p2=(x + 0.147, y + 0.008, + z + skidthickness + casesize[2] - casethickness), + r=0.007, 'free_space') + b6 = gprMax.Box(p1=(x + 0.054, y + casesize[1] - 0.016, z + skidthickness), + p2=(x + 0.056, y + casesize[1] - 0.014, + z + skidthickness + casesize[2] - casethickness), + material_id='free_space') + b7 = gprMax.Box(p1=(x + 0.054, y + 0.014, z + skidthickness), + p2=(x + 0.056, y + 0.016, + z + skidthickness + casesize[2] - casethickness), + material_id='free_space') + b8 = gprMax.Box(p1=(x + 0.146, y + casesize[1] - 0.016, z + skidthickness), + p2=(x + 0.148, y + casesize[1] - 0.014, + z + skidthickness + casesize[2] - casethickness), + material_id='free_space') + b9 = gprMax.Box(p1=(x + 0.146, y + 0.014, z + skidthickness), + p2=(x + 0.148, y + 0.016, + z + skidthickness + casesize[2] - casethickness), + material_id='free_space') + scene_objects.extend((c1, c2, c3, c4, c5, c6, c7, c8, b6, b7, b8, b9)) # PCB - box(x + 0.020, y + 0.018, z + skidthickness, x + casesize[0] - casethickness, y + casesize[1] - 0.018, z + skidthickness + pcbthickness, 'pcb', rotate90origin=rotate90origin) + b10 = gprMax.Box(p1=(x + 0.020, y + 0.018, z + skidthickness), + p2=(x + casesize[0] - casethickness, y + casesize[1] - 0.018, + z + skidthickness + pcbthickness), material_id='pcb') # Shield - Tx & Rx cavities - box(x + 0.032, y + 0.022, z + skidthickness, x + 0.032 + cavitysize[0], y + 0.022 + cavitysize[1], z + skidthickness + cavitysize[2], 'pec', rotate90origin=rotate90origin) - box(x + 0.032 + cavitythickness, y + 0.022 + cavitythickness, z + skidthickness, x + 0.032 + cavitysize[0] - cavitythickness, y + 0.022 + cavitysize[1] - cavitythickness, z + skidthickness + cavitysize[2], 'absorber', rotate90origin=rotate90origin) - box(x + 0.108, y + 0.022, z + skidthickness, x + 0.108 + cavitysize[0], y + 0.022 + cavitysize[1], z + skidthickness + cavitysize[2], 'pec', rotate90origin=rotate90origin) - box(x + 0.108 + cavitythickness, y + 0.022 + cavitythickness, z + skidthickness, x + 0.108 + cavitysize[0] - cavitythickness, y + 0.022 + cavitysize[1] - cavitythickness, z + skidthickness + cavitysize[2], 'free_space', rotate90origin=rotate90origin) + b11 = gprMax.Box(p1=(x + 0.032, y + 0.022, z + skidthickness), + p2=(x + 0.032 + cavitysize[0], y + 0.022 + cavitysize[1], + z + skidthickness + cavitysize[2]), material_id='pec') + b12 = gprMax.Box(p1=(x + 0.032 + cavitythickness, y + 0.022 + cavitythickness, + z + skidthickness), p2=(x + 0.032 + cavitysize[0] - cavitythickness, + y + 0.022 + cavitysize[1] - cavitythickness, + z + skidthickness + cavitysize[2]), material_id='absorber') + b13 = gprMax.Box(p1=(x + 0.108, y + 0.022, z + skidthickness), + p2=(x + 0.108 + cavitysize[0], y + 0.022 + cavitysize[1], + z + skidthickness + cavitysize[2]), material_id='pec') + b14 = gprMax.Box(p1=(x + 0.108 + cavitythickness, y + 0.022 + cavitythickness, + z + skidthickness), p2=(x + 0.108 + cavitysize[0] - cavitythickness, + y + 0.022 + cavitysize[1] - cavitythickness, + z + skidthickness + cavitysize[2]), material_id='free_space') # Shield - Tx & Rx cavities - joining strips - box(x + 0.032 + cavitysize[0], y + 0.022 + cavitysize[1] - 0.006, z + skidthickness + cavitysize[2] - casethickness, x + 0.108, y + 0.022 + cavitysize[1], z + skidthickness + cavitysize[2], 'pec', rotate90origin=rotate90origin) - box(x + 0.032 + cavitysize[0], y + 0.022, z + skidthickness + cavitysize[2] - casethickness, x + 0.108, y + 0.022 + 0.006, z + skidthickness + cavitysize[2], 'pec', rotate90origin=rotate90origin) + b15 = gprMax.Box(p1=(x + 0.032 + cavitysize[0], y + 0.022 + cavitysize[1] - 0.006, + z + skidthickness + cavitysize[2] - casethickness), + p2=(x + 0.108, y + 0.022 + cavitysize[1], + z + skidthickness + cavitysize[2]), material_id='pec') + b16 = gprMax.Box(p1=(x + 0.032 + cavitysize[0], y + 0.022, + z + skidthickness + cavitysize[2] - casethickness), + p2=(x + 0.108, y + 0.022 + 0.006, + z + skidthickness + cavitysize[2]), material_id='pec') # PCB - replace bits chopped by TX & Rx cavities - box(x + 0.032 + cavitythickness, y + 0.022 + cavitythickness, z + skidthickness, x + 0.032 + cavitysize[0] - cavitythickness, y + 0.022 + cavitysize[1] - cavitythickness, z + skidthickness + pcbthickness, 'pcb', rotate90origin=rotate90origin) - box(x + 0.108 + cavitythickness, y + 0.022 + cavitythickness, z + skidthickness, x + 0.108 + cavitysize[0] - cavitythickness, y + 0.022 + cavitysize[1] - cavitythickness, z + skidthickness + pcbthickness, 'pcb', rotate90origin=rotate90origin) + b17 = gprMax.Box(p1=(x + 0.032 + cavitythickness, y + 0.022 + cavitythickness, + z + skidthickness), p2=(x + 0.032 + cavitysize[0] - cavitythickness, + y + 0.022 + cavitysize[1] - cavitythickness, + z + skidthickness + pcbthickness), material_id='pcb') + b18 = gprMax.Box(p1=(x + 0.108 + cavitythickness, y + 0.022 + cavitythickness, + z + skidthickness), p2=(x + 0.108 + cavitysize[0] - cavitythickness, + y + 0.022 + cavitysize[1] - cavitythickness, + z + skidthickness + pcbthickness), material_id='pcb') + scene_objects.extend((b10, b11, b12, b13, b14, b15, b16, b17, b18)) # PCB components # Tx bowtie if resolution == 0.001: - triangle(tx[0], tx[1] - 0.001, tx[2], tx[0] - 0.026, tx[1] - bowtieheight - 0.001, tx[2], tx[0] + 0.026, tx[1] - bowtieheight - 0.001, tx[2], 0, 'pec', rotate90origin=rotate90origin) - edge(tx[0], tx[1] - 0.001, tx[2], tx[0], tx[1], tx[2], 'pec', rotate90origin=rotate90origin) - triangle(tx[0], tx[1] + 0.002, tx[2], tx[0] - 0.026, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.026, tx[1] + bowtieheight + 0.002, tx[2], 0, 'pec', rotate90origin=rotate90origin) - edge(tx[0], tx[1] + 0.001, tx[2], tx[0], tx[1] + 0.002, tx[2], 'pec', rotate90origin=rotate90origin) + t1 = gprMax.Triangle(p1=(tx[0], tx[1] - 0.001, tx[2]), + p2=(tx[0] - 0.026, tx[1] - bowtieheight - 0.001, tx[2]), + p3=(tx[0] + 0.026, tx[1] - bowtieheight - 0.001, tx[2]), + thickness=0, material_id='pec') + e1 = gprMax.Edge(p1=(tx[0], tx[1] - 0.001, tx[2]), + p2=(tx[0], tx[1], tx[2]), material_id='pec') + t2 = gprMax.Triangle(p1=(tx[0], tx[1] + 0.002, tx[2]), + p2=(tx[0] - 0.026, tx[1] + bowtieheight + 0.002, tx[2]), + p3=(tx[0] + 0.026, tx[1] + bowtieheight + 0.002, tx[2]), + thickness=0, material_id='pec') + e2 = gprMax.Edge(p1=(tx[0], tx[1] + 0.001, tx[2]), + p2=(tx[0], tx[1] + 0.002, tx[2]), material_id='pec') + scene_objects.extend((t1, t2, e1, e2)) elif resolution == 0.002: - triangle(tx[0], tx[1], tx[2], tx[0] - 0.026, tx[1] - bowtieheight, tx[2], tx[0] + 0.026, tx[1] - bowtieheight, tx[2], 0, 'pec', rotate90origin=rotate90origin) - triangle(tx[0], tx[1] + 0.002, tx[2], tx[0] - 0.026, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.026, tx[1] + bowtieheight + 0.002, tx[2], 0, 'pec', rotate90origin=rotate90origin) + t1 = gprMax.Triangle(p1=(tx[0], tx[1], tx[2]), + p2=(tx[0] - 0.026, tx[1] - bowtieheight, tx[2]), + p3=(tx[0] + 0.026, tx[1] - bowtieheight, tx[2]), + thickness=0, material_id='pec') + t2 = gprMax.Triangle(p1=(tx[0], tx[1] + 0.002, tx[2]), + p2=(tx[0] - 0.026, tx[1] + bowtieheight + 0.002, tx[2]), + p3=(tx[0] + 0.026, tx[1] + bowtieheight + 0.002, tx[2]), + thickness=0, material_id='pec') + scene_objects.extend((t1, t2)) # Rx bowtie if resolution == 0.001: - triangle(tx[0] + 0.076, tx[1] - 0.001, tx[2], tx[0] + 0.076 - 0.026, tx[1] - bowtieheight - 0.001, tx[2], tx[0] + 0.076 + 0.026, tx[1] - bowtieheight - 0.001, tx[2], 0, 'pec', rotate90origin=rotate90origin) - edge(tx[0] + 0.076, tx[1] - 0.001, tx[2], tx[0] + 0.076, tx[1], tx[2], 'pec', rotate90origin=rotate90origin) - triangle(tx[0] + 0.076, tx[1] + 0.002, tx[2], tx[0] + 0.076 - 0.026, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.076 + 0.026, tx[1] + bowtieheight + 0.002, tx[2], 0, 'pec', rotate90origin=rotate90origin) - edge(tx[0] + 0.076, tx[1] + 0.001, tx[2], tx[0] + 0.076, tx[1] + 0.002, tx[2], 'pec', rotate90origin=rotate90origin) + t3 = gprMax.Triangle(p1=(tx[0] + 0.076, tx[1] - 0.001, tx[2]), + p2=(tx[0] + 0.076 - 0.026, tx[1] - bowtieheight - 0.001, tx[2]), + p3=(tx[0] + 0.076 + 0.026, tx[1] - bowtieheight - 0.001, tx[2]), + thickness=0, material_id='pec') + e3 = gprMax.Edge(p1=(tx[0] + 0.076, tx[1] - 0.001, tx[2]), + p2=(tx[0] + 0.076, tx[1], tx[2]), material_id='pec') + t4 = gprMax.Triangle(p1=(tx[0] + 0.076, tx[1] + 0.002, tx[2]), + p2=(tx[0] + 0.076 - 0.026, tx[1] + bowtieheight + 0.002, tx[2]), + p3=(tx[0] + 0.076 + 0.026, tx[1] + bowtieheight + 0.002, tx[2]), + thickness=0, material_id='pec') + e4 = gprMax.Edge(p1=(tx[0] + 0.076, tx[1] + 0.001, tx[2]), + p2=(tx[0] + 0.076, tx[1] + 0.002, tx[2]), material_id='pec') + scene_objects.extend((t3, e3, t4, e4)) elif resolution == 0.002: - triangle(tx[0] + 0.076, tx[1], tx[2], tx[0] + 0.076 - 0.026, tx[1] - bowtieheight, tx[2], tx[0] + 0.076 + 0.026, tx[1] - bowtieheight, tx[2], 0, 'pec', rotate90origin=rotate90origin) - triangle(tx[0] + 0.076, tx[1] + 0.002, tx[2], tx[0] + 0.076 - 0.026, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.076 + 0.026, tx[1] + bowtieheight + 0.002, tx[2], 0, 'pec', rotate90origin=rotate90origin) + t3 = gprMax.Triangle(p1=(tx[0] + 0.076, tx[1], tx[2]), + p2=(tx[0] + 0.076 - 0.026, tx[1] - bowtieheight, tx[2]), + p3=(tx[0] + 0.076 + 0.026, tx[1] - bowtieheight, tx[2]), + thickness=0, material_id='pec') + t4 = gprMax.Triangle(p1=(tx[0] + 0.076, tx[1] + 0.002, tx[2]), + p2=(tx[0] + 0.076 - 0.026, tx[1] + bowtieheight + 0.002, tx[2]), + p3=(tx[0] + 0.076 + 0.026, tx[1] + bowtieheight + 0.002, tx[2]), + thickness=0, material_id='pec') + scene_objects.extend((t3, t4)) # Tx surface mount resistors (lower y coordinate) if resolution == 0.001: - edge(tx[0] - 0.023, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023, tx[1] - bowtieheight - dy, tx[2], 'txreslower', rotate90origin=rotate90origin) - edge(tx[0] - 0.023 + dx, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023 + dx, tx[1] - bowtieheight - dy, tx[2], 'txreslower', rotate90origin=rotate90origin) - edge(tx[0], tx[1] - bowtieheight - 0.004, tx[2], tx[0], tx[1] - bowtieheight - dy, tx[2], 'txreslower', rotate90origin=rotate90origin) - edge(tx[0] + dx, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + dx, tx[1] - bowtieheight - dy, tx[2], 'txreslower', rotate90origin=rotate90origin) - edge(tx[0] + 0.022, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.022, tx[1] - bowtieheight - dy, tx[2], 'txreslower', rotate90origin=rotate90origin) - edge(tx[0] + 0.022 + dx, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.022 + dx, tx[1] - bowtieheight - dy, tx[2], 'txreslower', rotate90origin=rotate90origin) + e5 = gprMax.Edge(p1=(tx[0] - 0.023, tx[1] - bowtieheight - 0.004, tx[2]), + p2=(tx[0] - 0.023, tx[1] - bowtieheight - dy, tx[2]), + material_id='txreslower') + e6 = gprMax.Edge(p1=(tx[0] - 0.023 + dx, tx[1] - bowtieheight - 0.004, tx[2]), + p2=(tx[0] - 0.023 + dx, tx[1] - bowtieheight - dy, tx[2]), + material_id='txreslower') + e7 = gprMax.Edge(p1=(tx[0], tx[1] - bowtieheight - 0.004, tx[2]), + p2=(tx[0], tx[1] - bowtieheight - dy, tx[2]), + material_id='txreslower') + e8 = gprMax.Edge(p1=(tx[0] + dx, tx[1] - bowtieheight - 0.004, tx[2]), + p2=(tx[0] + dx, tx[1] - bowtieheight - dy, tx[2]), + material_id='txreslower') + e9 = gprMax.Edge(p1=(tx[0] + 0.022, tx[1] - bowtieheight - 0.004, tx[2]), + p2=(tx[0] + 0.022, tx[1] - bowtieheight - dy, tx[2]), + material_id='txreslower') + e10 = gprMax.Edge(p1=(tx[0] + 0.022 + dx, tx[1] - bowtieheight - 0.004, tx[2]), + p2=(tx[0] + 0.022 + dx, tx[1] - bowtieheight - dy, tx[2]), + material_id='txreslower') + scene_objects.extend((e5, e6, e7, e8, e9, e10)) elif resolution == 0.002: - edge(tx[0] - 0.023, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023, tx[1] - bowtieheight, tx[2], 'txreslower', rotate90origin=rotate90origin) - edge(tx[0] - 0.023 + dx, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023 + dx, tx[1] - bowtieheight, tx[2], 'txreslower', rotate90origin=rotate90origin) - edge(tx[0], tx[1] - bowtieheight - 0.004, tx[2], tx[0], tx[1] - bowtieheight, tx[2], 'txreslower', rotate90origin=rotate90origin) - edge(tx[0] + dx, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + dx, tx[1] - bowtieheight, tx[2], 'txreslower', rotate90origin=rotate90origin) - edge(tx[0] + 0.020, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.020, tx[1] - bowtieheight, tx[2], 'txreslower', rotate90origin=rotate90origin) - edge(tx[0] + 0.020 + dx, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.020 + dx, tx[1] - bowtieheight, tx[2], 'txreslower', rotate90origin=rotate90origin) + e5 = gprMax.Edge(p1=(tx[0] - 0.023, tx[1] - bowtieheight - 0.004, tx[2]), + p2=(tx[0] - 0.023, tx[1] - bowtieheight, tx[2]), + material_id='txreslower') + e6 = gprMax.Edge(p1=(tx[0] - 0.023 + dx, tx[1] - bowtieheight - 0.004, tx[2]), + p2=(tx[0] - 0.023 + dx, tx[1] - bowtieheight, tx[2]), + material_id='txreslower') + e7 = gprMax.Edge(p1=(tx[0], tx[1] - bowtieheight - 0.004, tx[2]), + p2=(tx[0], tx[1] - bowtieheight, tx[2]), + material_id='txreslower') + e8 = gprMax.Edge(p1=(tx[0] + dx, tx[1] - bowtieheight - 0.004, tx[2]), + p2=(tx[0] + dx, tx[1] - bowtieheight, tx[2]), + material_id='txreslower') + e9 = gprMax.Edge(p1=(tx[0] + 0.020, tx[1] - bowtieheight - 0.004, tx[2]), + p2=(tx[0] + 0.020, tx[1] - bowtieheight, tx[2]), + material_id='txreslower') + e10 = gprMax.Edge(p1=(tx[0] + 0.020 + dx, tx[1] - bowtieheight - 0.004, tx[2]), + p2=(tx[0] + 0.020 + dx, tx[1] - bowtieheight, tx[2]), + material_id='txreslower') + scene_objects.extend((e5, e6, e7, e8, e9, e10)) # Tx surface mount resistors (upper y coordinate) if resolution == 0.001: - edge(tx[0] - 0.023, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023, tx[1] + bowtieheight + 0.006, tx[2], 'txresupper', rotate90origin=rotate90origin) - edge(tx[0] - 0.023 + dx, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023 + dx, tx[1] + bowtieheight + 0.006, tx[2], 'txresupper', rotate90origin=rotate90origin) - edge(tx[0], tx[1] + bowtieheight + 0.002, tx[2], tx[0], tx[1] + bowtieheight + 0.006, tx[2], 'txresupper', rotate90origin=rotate90origin) - edge(tx[0] + dx, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + dx, tx[1] + bowtieheight + 0.006, tx[2], 'txresupper', rotate90origin=rotate90origin) - edge(tx[0] + 0.022, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.022, tx[1] + bowtieheight + 0.006, tx[2], 'txresupper', rotate90origin=rotate90origin) - edge(tx[0] + 0.022 + dx, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.022 + dx, tx[1] + bowtieheight + 0.006, tx[2], 'txresupper', rotate90origin=rotate90origin) + e11 = gprMax.Edge(p1=(tx[0] - 0.023, tx[1] + bowtieheight + 0.002, tx[2]), + p2=(tx[0] - 0.023, tx[1] + bowtieheight + 0.006, tx[2]), + material_id='txresupper') + e12 = gprMax.Edge(p1=(tx[0] - 0.023 + dx, tx[1] + bowtieheight + 0.002, tx[2]), + p2=(tx[0] - 0.023 + dx, tx[1] + bowtieheight + 0.006, tx[2]), + material_id='txresupper') + e13 = gprMax.Edge(p1=(tx[0], tx[1] + bowtieheight + 0.002, tx[2]), + p2=(tx[0], tx[1] + bowtieheight + 0.006, tx[2]), + material_id='txresupper') + e14 = gprMax.Edge(p1=(tx[0] + dx, tx[1] + bowtieheight + 0.002, tx[2]), + p2=(tx[0] + dx, tx[1] + bowtieheight + 0.006, tx[2]), + material_id='txresupper') + e15 = gprMax.Edge(p1=(tx[0] + 0.022, tx[1] + bowtieheight + 0.002, tx[2]), + p2=(tx[0] + 0.022, tx[1] + bowtieheight + 0.006, tx[2]), + material_id='txresupper') + e16 = gprMax.Edge(p1=(tx[0] + 0.022 + dx, tx[1] + bowtieheight + 0.002, tx[2]), + p2=(tx[0] + 0.022 + dx, tx[1] + bowtieheight + 0.006, tx[2]), + material_id='txresupper') + scene_objects.extend((e11, e12, e13, e14, e15, e16)) elif resolution == 0.002: - edge(tx[0] - 0.023, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023, tx[1] + bowtieheight + 0.006, tx[2], 'txresupper', rotate90origin=rotate90origin) - edge(tx[0] - 0.023 + dx, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023 + dx, tx[1] + bowtieheight + 0.006, tx[2], 'txresupper', rotate90origin=rotate90origin) - edge(tx[0], tx[1] + bowtieheight + 0.002, tx[2], tx[0], tx[1] + bowtieheight + 0.006, tx[2], 'txresupper', rotate90origin=rotate90origin) - edge(tx[0] + dx, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + dx, tx[1] + bowtieheight + 0.006, tx[2], 'txresupper', rotate90origin=rotate90origin) - edge(tx[0] + 0.020, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.020, tx[1] + bowtieheight + 0.006, tx[2], 'txresupper', rotate90origin=rotate90origin) - edge(tx[0] + 0.020 + dx, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.020 + dx, tx[1] + bowtieheight + 0.006, tx[2], 'txresupper', rotate90origin=rotate90origin) + e11 = gprMax.Edge(p1=(tx[0] - 0.023, tx[1] + bowtieheight + 0.002, tx[2]), + p2=(tx[0] - 0.023, tx[1] + bowtieheight + 0.006, tx[2]), + material_id='txresupper') + e12 = gprMax.Edge(p1=(tx[0] - 0.023 + dx, tx[1] + bowtieheight + 0.002, tx[2]), + p2=(tx[0] - 0.023 + dx, tx[1] + bowtieheight + 0.006, tx[2]), + material_id='txresupper') + e13 = gprMax.Edge(p1=(tx[0], tx[1] + bowtieheight + 0.002, tx[2]), + p2=(tx[0], tx[1] + bowtieheight + 0.006, tx[2]), + material_id='txresupper') + e14 = gprMax.Edge(p1=(tx[0] + dx, tx[1] + bowtieheight + 0.002, tx[2]), + p2=(tx[0] + dx, tx[1] + bowtieheight + 0.006, tx[2]), + material_id='txresupper') + e15 = gprMax.Edge(p1=(tx[0] + 0.020, tx[1] + bowtieheight + 0.002, tx[2]), + p2=(tx[0] + 0.020, tx[1] + bowtieheight + 0.006, tx[2]), + material_id='txresupper') + e16 = gprMax.Edge(p1=(tx[0] + 0.020 + dx, tx[1] + bowtieheight + 0.002, tx[2]), + p2=tx[0] + 0.020 + dx, tx[1] + bowtieheight + 0.006, tx[2]), + material_id='txresupper') + scene_objects.extend((e11, e12, e13, e14, e15, e16)) # Rx surface mount resistors (lower y coordinate) if resolution == 0.001: - edge(tx[0] - 0.023 + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023 + 0.076, tx[1] - bowtieheight - dy, tx[2], 'rxreslower', rotate90origin=rotate90origin) - edge(tx[0] - 0.023 + dx + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023 + dx + 0.076, tx[1] - bowtieheight - dy, tx[2], 'rxreslower', rotate90origin=rotate90origin) - edge(tx[0] + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.076, tx[1] - bowtieheight - dy, tx[2], 'rxreslower', rotate90origin=rotate90origin) - edge(tx[0] + dx + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + dx + 0.076, tx[1] - bowtieheight - dy, tx[2], 'rxreslower', rotate90origin=rotate90origin) - edge(tx[0] + 0.022 + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.022 + 0.076, tx[1] - bowtieheight - dy, tx[2], 'rxreslower', rotate90origin=rotate90origin) - edge(tx[0] + 0.022 + dx + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.022 + dx + 0.076, tx[1] - bowtieheight - dy, tx[2], 'rxreslower', rotate90origin=rotate90origin) + e17 = gprMax.Edge(p1=(tx[0] - 0.023 + 0.076, tx[1] - bowtieheight - 0.004, tx[2]), + p2=(tx[0] - 0.023 + 0.076, tx[1] - bowtieheight - dy, tx[2]), + material_id='rxreslower') + e18 = gprMax.Edge(p1=(tx[0] - 0.023 + dx + 0.076, tx[1] - bowtieheight - 0.004, tx[2]), + p2=(tx[0] - 0.023 + dx + 0.076, tx[1] - bowtieheight - dy, tx[2]), + material_id='rxreslower') + e19 = gprMax.Edge(p1=(tx[0] + 0.076, tx[1] - bowtieheight - 0.004, tx[2]), + p1=(tx[0] + 0.076, tx[1] - bowtieheight - dy, tx[2]), + material_id='rxreslower') + e20 = gprMax.Edge(p1=(tx[0] + dx + 0.076, tx[1] - bowtieheight - 0.004, tx[2]), + p2=(tx[0] + dx + 0.076, tx[1] - bowtieheight - dy, tx[2]), + material_id='rxreslower') + e21 = gprMax.Edge(p1=(tx[0] + 0.022 + 0.076, tx[1] - bowtieheight - 0.004, tx[2]), + p2=(tx[0] + 0.022 + 0.076, tx[1] - bowtieheight - dy, tx[2]), + material_id='rxreslower') + e22 = gprMax.Edge(p1=(tx[0] + 0.022 + dx + 0.076, tx[1] - bowtieheight - 0.004, tx[2]), + p2=(tx[0] + 0.022 + dx + 0.076, tx[1] - bowtieheight - dy, tx[2]), + material_id='rxreslower') + scene_objects.extend((e17, e18, e19, e20, e21, e22)) elif resolution == 0.002: - edge(tx[0] - 0.023 + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023 + 0.076, tx[1] - bowtieheight, tx[2], 'rxreslower', rotate90origin=rotate90origin) - edge(tx[0] - 0.023 + dx + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023 + dx + 0.076, tx[1] - bowtieheight, tx[2], 'rxreslower', rotate90origin=rotate90origin) - edge(tx[0] + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.076, tx[1] - bowtieheight, tx[2], 'rxreslower', rotate90origin=rotate90origin) - edge(tx[0] + dx + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + dx + 0.076, tx[1] - bowtieheight, tx[2], 'rxreslower', rotate90origin=rotate90origin) - edge(tx[0] + 0.020 + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.020 + 0.076, tx[1] - bowtieheight, tx[2], 'rxreslower', rotate90origin=rotate90origin) - edge(tx[0] + 0.020 + dx + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.020 + dx + 0.076, tx[1] - bowtieheight, tx[2], 'rxreslower', rotate90origin=rotate90origin) + e17 = gprMax.Edge(p1=(tx[0] - 0.023 + 0.076, tx[1] - bowtieheight - 0.004, tx[2]), + p2=(tx[0] - 0.023 + 0.076, tx[1] - bowtieheight, tx[2]), + material_id='rxreslower') + e18 = gprMax.Edge(p1=(tx[0] - 0.023 + dx + 0.076, tx[1] - bowtieheight - 0.004, tx[2]), + p2=(tx[0] - 0.023 + dx + 0.076, tx[1] - bowtieheight, tx[2]), + material_id='rxreslower') + e19 = gprMax.Edge(p1=(tx[0] + 0.076, tx[1] - bowtieheight - 0.004, tx[2]), + p2=(tx[0] + 0.076, tx[1] - bowtieheight, tx[2]), + material_id='rxreslower') + e20 = gprMax.Edge(p1=(tx[0] + dx + 0.076, tx[1] - bowtieheight - 0.004, tx[2]), + p2=(tx[0] + dx + 0.076, tx[1] - bowtieheight, tx[2]), + material_id='rxreslower') + e21 = gprMax.Edge(p1=(tx[0] + 0.020 + 0.076, tx[1] - bowtieheight - 0.004, tx[2]), + p2=(tx[0] + 0.020 + 0.076, tx[1] - bowtieheight, tx[2]), + material_id='rxreslower') + e22 = gprMax.Edge(p1=(tx[0] + 0.020 + dx + 0.076, tx[1] - bowtieheight - 0.004, tx[2]), + p2=(tx[0] + 0.020 + dx + 0.076, tx[1] - bowtieheight, tx[2]), + material_id='rxreslower') + scene_objects.extend((e17, e18, e19, e20, e21, e22)) # Rx surface mount resistors (upper y coordinate) if resolution == 0.001: - edge(tx[0] - 0.023 + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023 + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper', rotate90origin=rotate90origin) - edge(tx[0] - 0.023 + dx + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023 + dx + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper', rotate90origin=rotate90origin) - edge(tx[0] + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper', rotate90origin=rotate90origin) - edge(tx[0] + dx + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + dx + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper', rotate90origin=rotate90origin) - edge(tx[0] + 0.022 + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.022 + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper', rotate90origin=rotate90origin) - edge(tx[0] + 0.022 + dx + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.022 + dx + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper', rotate90origin=rotate90origin) + e23 = gprMax.Edge(p1=(tx[0] - 0.023 + 0.076, tx[1] + bowtieheight + 0.002, tx[2]), + p2=(tx[0] - 0.023 + 0.076, tx[1] + bowtieheight + 0.006, tx[2]), + material_id='rxresupper') + e24 = gprMax.Edge(p1=(tx[0] - 0.023 + dx + 0.076, tx[1] + bowtieheight + 0.002, tx[2]), + p2=(tx[0] - 0.023 + dx + 0.076, tx[1] + bowtieheight + 0.006, tx[2]), + material_id='rxresupper') + e25 = gprMax.Edge(p1=(tx[0] + 0.076, tx[1] + bowtieheight + 0.002, tx[2]), + p2=(tx[0] + 0.076, tx[1] + bowtieheight + 0.006, tx[2]), + material_id='rxresupper') + e26 = gprMax.Edge(p1=(tx[0] + dx + 0.076, tx[1] + bowtieheight + 0.002, tx[2]), + p2=(tx[0] + dx + 0.076, tx[1] + bowtieheight + 0.006, tx[2]), + material_id='rxresupper') + e27 = gprMax.Edge(p1=(tx[0] + 0.022 + 0.076, tx[1] + bowtieheight + 0.002, tx[2]), + p2=(tx[0] + 0.022 + 0.076, tx[1] + bowtieheight + 0.006, tx[2]), + material_id='rxresupper') + e28 = gprMax.Edge(p1=(tx[0] + 0.022 + dx + 0.076, tx[1] + bowtieheight + 0.002, tx[2]), + p2=(tx[0] + 0.022 + dx + 0.076, tx[1] + bowtieheight + 0.006, tx[2]), + material_id='rxresupper') + scene_objects.extend((e23, e24, e25, e26, e27, e28)) elif resolution == 0.002: - edge(tx[0] - 0.023 + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023 + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper', rotate90origin=rotate90origin) - edge(tx[0] - 0.023 + dx + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023 + dx + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper', rotate90origin=rotate90origin) - edge(tx[0] + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper', rotate90origin=rotate90origin) - edge(tx[0] + dx + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + dx + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper', rotate90origin=rotate90origin) - edge(tx[0] + 0.020 + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.020 + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper', rotate90origin=rotate90origin) - edge(tx[0] + 0.020 + dx + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.020 + dx + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper', rotate90origin=rotate90origin) + e23 = gprMax.Edge(p1=(tx[0] - 0.023 + 0.076, tx[1] + bowtieheight + 0.002, tx[2]), + p2=(tx[0] - 0.023 + 0.076, tx[1] + bowtieheight + 0.006, tx[2]), + material_id='rxresupper') + e24 = gprMax.Edge(p1=(tx[0] - 0.023 + dx + 0.076, tx[1] + bowtieheight + 0.002, tx[2]), + p2=(tx[0] - 0.023 + dx + 0.076, tx[1] + bowtieheight + 0.006, tx[2]), + material_id='rxresupper') + e25 = gprMax.Edge(p1=(tx[0] + 0.076, tx[1] + bowtieheight + 0.002, tx[2]), + p2=(tx[0] + 0.076, tx[1] + bowtieheight + 0.006, tx[2]), + material_id='rxresupper') + e26 = gprMax.Edge(p1=(tx[0] + dx + 0.076, tx[1] + bowtieheight + 0.002, tx[2]), + p2=(tx[0] + dx + 0.076, tx[1] + bowtieheight + 0.006, tx[2]), + material_id='rxresupper') + e27 = gprMax.Edge(p1=(tx[0] + 0.020 + 0.076, tx[1] + bowtieheight + 0.002, tx[2]), + p2=(tx[0] + 0.020 + 0.076, tx[1] + bowtieheight + 0.006, tx[2]), + material_id='rxresupper') + e28 = gprMax.Edge(p1=(tx[0] + 0.020 + dx + 0.076, tx[1] + bowtieheight + 0.002, tx[2]), + p2=(tx[0] + 0.020 + dx + 0.076, tx[1] + bowtieheight + 0.006, tx[2]), + material_id='rxresupper') + scene_objects.extend((e23, e24, e25, e26, e27, e28)) # Skid - box(x, y, z, x + casesize[0], y + casesize[1], z + polypropylenethickness, 'polypropylene', rotate90origin=rotate90origin) - box(x, y, z + polypropylenethickness, x + casesize[0], y + casesize[1], z + polypropylenethickness + hdpethickness, 'hdpe', rotate90origin=rotate90origin) - - # Geometry views - # geometry_view(x - dx, y - dy, z - dz, x + casesize[0] + dx, y + casesize[1] + dy, z + casesize[2] + skidthickness + dz, dx, dy, dz, 'antenna_like_MALA_1200') - # geometry_view(x, y, z, x + casesize[0], y + casesize[1], z + 0.010, dx, dy, dz, 'antenna_like_MALA_1200_pcb', type='f') + b19 = gprMax.Box(p1=(x, y, z), p2=(x + casesize[0], y + casesize[1], + z + polypropylenethickness), material_id='polypropylene') + b20 = gprMax.Box(p1=(x, y, z + polypropylenethickness), + p2=(x + casesize[0], y + casesize[1], + z + polypropylenethickness + hdpethickness), + material_id='hdpe') + scene_objects.extend((b19, b20)) # Excitation - print('#waveform: gaussian 1.0 {} myGaussian'.format(excitationfreq)) - voltage_source('y', tx[0], tx[1], tx[2], sourceresistance, 'myGaussian', dxdy=(resolution, resolution), rotate90origin=rotate90origin) + w2 = gprMax.Waveform(wave_type='gaussian', amp=1, freq=excitationfreq, id='my_gaussian') + scene_objects.append(w2) + vs1 = gprMax.VoltageSource(polarisation='y', p1=(tx[0], tx[1], tx[2]), + resistance=sourceresistance, waveform_id='my_gaussian') + scene_objects.append(vs1) # Output point - receiver bowtie - rx(tx[0] + 0.076, tx[1], tx[2], identifier='rxbowtie', to_save=[output], polarisation='y', dxdy=(resolution, resolution), rotate90origin=rotate90origin) + r1 = gprMax.Rx(p1=(tx[0] + 0.076, tx[1], tx[2]), id='rxbowtie', outputs='Ey') + scene_objects.append(r1) + + # Geometry views + gv1 = gprMax.GeometryView(p1=(x - dx, y - dy, z - dz), p2=(x + casesize[0] + dx, + y + casesize[1] + dy, z + skidthickness + casesize[2] + dz), + dl=(dx, dy, dz), filename='antenna_like_MALA_1200', + output_type='n') + gv2 = gprMax.GeometryView(p1=(x, y, z), p2=(x + casesize[0], y + casesize[1], z + 0.010), + dl=(dx, dy, dz), filename='antenna_like_MALA_1200_pcb', + output_type='f') + scene_objects.extend((gv1, gv2)) + + return scene_objects