Added the ability to pass a dictionary of variables into the antenna functions.

这个提交包含在:
Craig Warren
2015-12-16 17:49:33 +00:00
父节点 eac8ff9a89
当前提交 87963caca8

查看文件

@@ -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]))