你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 04:56:51 +08:00
Updated to improve saving/loading of antenna origin coordinates file.
这个提交包含在:
@@ -40,8 +40,8 @@ How to use the module
|
|||||||
|
|
||||||
* Firstly you should familiarise yourself with the example model input file. Edit the input file as desired and run one of the simulations for either E-plane or H-plane patterns.
|
* Firstly you should familiarise yourself with the example model input file. Edit the input file as desired and run one of the simulations for either E-plane or H-plane patterns.
|
||||||
* Whilst the simulation is running edit the 'user configurable paramters' sections of the ``initial_save.py`` and ``plot_fields.py`` modules to match the setup of the simulation.
|
* Whilst the simulation is running edit the 'user configurable paramters' sections of the ``initial_save.py`` and ``plot_fields.py`` modules to match the setup of the simulation.
|
||||||
* Once the simulation has completed, run the ``initial_save.py`` module on the output file, e.g. for the E-plane ``python -m user_libs.antenna_patterns.initial_save antenna_like_GSSI_1500_patterns_E.out``. This will produce a Numpy file containing the field pattern data.
|
* Once the simulation has completed, run the ``initial_save.py`` module on the output file, e.g. for the E-plane ``python -m user_libs.antenna_patterns.initial_save user_models/antenna_like_GSSI_1500_patterns_E_Er5.out``. This will produce a Numpy file containing the field pattern data.
|
||||||
* Plot the field pattern data by running the ``plot_fields.py`` module on the Numpy file, e.g. for the E-plane ``python -m user_libs.antenna_patterns.plot_fields antenna_like_GSSI_1500_patterns_E.npy``
|
* Plot the field pattern data by running the ``plot_fields.py`` module on the Numpy file, e.g. for the E-plane ``python -m user_libs.antenna_patterns.plot_fields user_models/antenna_like_GSSI_1500_patterns_E_Er5.npy``
|
||||||
|
|
||||||
.. tip::
|
.. tip::
|
||||||
|
|
||||||
@@ -51,4 +51,4 @@ How to use the module
|
|||||||
.. figure:: images/user_libs/antenna_like_GSSI_1500_patterns_E_Er5.png
|
.. figure:: images/user_libs/antenna_like_GSSI_1500_patterns_E_Er5.png
|
||||||
:width: 600 px
|
:width: 600 px
|
||||||
|
|
||||||
Example of the E-plane pattern from a simulation containing an antenna model similar to a GSSI 1.5 GHz antenna over a homogeneous, lossless half-space with a relative permittivity of five.
|
Example of the E-plane pattern from a simulation containing an antenna model similar to a GSSI 1.5 GHz antenna over a homogeneous, lossless half-space with a relative permittivity of five.
|
||||||
|
@@ -5,8 +5,12 @@
|
|||||||
#python:
|
#python:
|
||||||
import os
|
import os
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
|
from gprMax.input_cmd_funcs import *
|
||||||
from user_libs.antennas import antenna_like_GSSI_1500
|
from user_libs.antennas import antenna_like_GSSI_1500
|
||||||
|
|
||||||
|
filename = os.path.splitext(os.path.split(__file__)[1])[0]
|
||||||
|
|
||||||
timewindows = np.array([4.5e-9]) # For 0.3m max
|
timewindows = np.array([4.5e-9]) # For 0.3m max
|
||||||
radii = np.linspace(0.1, 0.3, 20)
|
radii = np.linspace(0.1, 0.3, 20)
|
||||||
theta = np.linspace(3, 357, 60)
|
theta = np.linspace(3, 357, 60)
|
||||||
@@ -29,7 +33,7 @@ print('#material: {}'.format(materials[selector]))
|
|||||||
print('#box: 0 0 0 {} {} {} {} n'.format(domain[0], domain[1], fs[2] + radii[-1], materials[selector].split()[-1]))
|
print('#box: 0 0 0 {} {} {} {} n'.format(domain[0], domain[1], fs[2] + radii[-1], materials[selector].split()[-1]))
|
||||||
|
|
||||||
## Save the position of the antenna to file for use when processing results
|
## Save the position of the antenna to file for use when processing results
|
||||||
np.savetxt(os.path.join(input_directory, 'antenna_like_GSSI_1500_patterns_E_rxsorigin.txt'), antennaposition, fmt="%f")
|
np.savetxt(os.path.join(input_directory, filename + '_rxsorigin.txt'), antennaposition, fmt="%f")
|
||||||
|
|
||||||
## Generate receiver points for pattern
|
## Generate receiver points for pattern
|
||||||
for radius in range(len(radii)):
|
for radius in range(len(radii)):
|
||||||
@@ -40,5 +44,5 @@ for radius in range(len(radii)):
|
|||||||
for rxpt in range(len(theta)):
|
for rxpt in range(len(theta)):
|
||||||
print('#rx: {:.3f} {:.3f} {:.3f}'.format(x[rxpt] + antennaposition[0], y[rxpt] + antennaposition[1], z[rxpt] + antennaposition[2]))
|
print('#rx: {:.3f} {:.3f} {:.3f}'.format(x[rxpt] + antennaposition[0], y[rxpt] + antennaposition[1], z[rxpt] + antennaposition[2]))
|
||||||
|
|
||||||
#print('#geometry_view: 0 0 0 {} {} {} 0.001 0.001 0.001 antenna_like_GSSI_1500_patterns_E n'.format(domain[0], domain[1], domain[2]))
|
geometry_view(0, 0, 0, domain[0], domain[1], domain[2], 0.001, 0.001, 0.001, filename, 'n')
|
||||||
#end_python:
|
#end_python:
|
||||||
|
@@ -5,8 +5,12 @@
|
|||||||
#python:
|
#python:
|
||||||
import os
|
import os
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
|
from gprMax.input_cmd_funcs import *
|
||||||
from user_libs.antennas import antenna_like_GSSI_1500
|
from user_libs.antennas import antenna_like_GSSI_1500
|
||||||
|
|
||||||
|
filename = os.path.splitext(os.path.split(__file__)[1])[0]
|
||||||
|
|
||||||
timewindows = np.array([4.5e-9]) # For 0.3m max
|
timewindows = np.array([4.5e-9]) # For 0.3m max
|
||||||
radii = np.linspace(0.1, 0.3, 20)
|
radii = np.linspace(0.1, 0.3, 20)
|
||||||
theta = np.linspace(3, 357, 60)
|
theta = np.linspace(3, 357, 60)
|
||||||
@@ -29,7 +33,7 @@ print('#material: {}'.format(materials[selector]))
|
|||||||
print('#box: 0 0 0 {} {} {} {} n'.format(domain[0], domain[1], fs[2] + radii[-1], materials[selector].split()[-1]))
|
print('#box: 0 0 0 {} {} {} {} n'.format(domain[0], domain[1], fs[2] + radii[-1], materials[selector].split()[-1]))
|
||||||
|
|
||||||
## Save the position of the antenna to file for use when processing results
|
## Save the position of the antenna to file for use when processing results
|
||||||
np.savetxt(os.path.join(input_directory, 'antenna_like_GSSI_1500_patterns_H_rxsorigin.txt'), antennaposition, fmt="%f")
|
np.savetxt(os.path.join(input_directory, filename + '_rxsorigin.txt'), antennaposition, fmt="%f")
|
||||||
|
|
||||||
## Generate receiver points for pattern
|
## Generate receiver points for pattern
|
||||||
for radius in range(len(radii)):
|
for radius in range(len(radii)):
|
||||||
@@ -40,5 +44,5 @@ for radius in range(len(radii)):
|
|||||||
for rxpt in range(len(theta)):
|
for rxpt in range(len(theta)):
|
||||||
print('#rx: {:.3f} {:.3f} {:.3f}'.format(x[rxpt] + antennaposition[0], y[rxpt] + antennaposition[1], z[rxpt] + antennaposition[2]))
|
print('#rx: {:.3f} {:.3f} {:.3f}'.format(x[rxpt] + antennaposition[0], y[rxpt] + antennaposition[1], z[rxpt] + antennaposition[2]))
|
||||||
|
|
||||||
#print('#geometry_view: 0 0 0 {} {} {} 0.001 0.001 0.001 antenna_like_GSSI_1500_patterns_H n'.format(domain[0], domain[1], domain[2]))
|
geometry_view(0, 0, 0, domain[0], domain[1], domain[2], 0.001, 0.001, 0.001, filename, 'n')
|
||||||
#end_python:
|
#end_python:
|
||||||
|
在新工单中引用
屏蔽一个用户