From 87963caca80abcc7bdb46d8dcba83cbe0891dde5 Mon Sep 17 00:00:00 2001 From: Craig Warren Date: Wed, 16 Dec 2015 17:49:33 +0000 Subject: [PATCH] Added the ability to pass a dictionary of variables into the antenna functions. --- user_libs/antennas.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/user_libs/antennas.py b/user_libs/antennas.py index 0a16bc85..b37861f6 100644 --- a/user_libs/antennas.py +++ b/user_libs/antennas.py @@ -8,12 +8,13 @@ from gprMax.exceptions import CmdInputError -def antenna_like_GSSI_1500(x, y, z, resolution=0.001): +def antenna_like_GSSI_1500(x, y, z, resolution=0.001, **kwargs): """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 170mm x 108mm x 45mm. One output point is defined between the arms of the receiever 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. + kwargs (dict): Optional variables, e.g. can be fed from an optimisation process. """ # Antenna geometry properties @@ -136,16 +137,17 @@ def antenna_like_GSSI_1500(x, y, z, resolution=0.001): # Output point - transmitter bowtie #print('#rx: {} {} {}'.format(tx[0], tx[1], tx[2])) # Output point - receiver bowtie - print('#rx: {} {} {}'.format(tx[0] - 0.059, tx[1], tx[2])) + print('#rx: {} {} {} rxGSSI1500 Ey'.format(tx[0] - 0.059, tx[1], tx[2])) -def antenna_like_MALA_1200(x, y, z, resolution=0.001): +def antenna_like_MALA_1200(x, y, z, resolution=0.001, **kwargs): """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 184mm x 109mm x 46mm. One output point is defined between the arms of the receiever 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. + kwargs (dict): Optional variables, e.g. can be fed from an optimisation process. """ # Antenna geometry properties @@ -340,5 +342,5 @@ def antenna_like_MALA_1200(x, y, z, resolution=0.001): # Output point - transmitter bowtie #print('#rx: {} {} {}'.format(tx[0], tx[1], tx[2])) # Output point - receiver bowtie - print('#rx: {} {} {}'.format(tx[0] + 0.076, tx[1], tx[2])) + print('#rx: {} {} {} rxMALA1200 Ey'.format(tx[0] + 0.076, tx[1], tx[2]))