Edit to title. Correction of domain function example.

这个提交包含在:
Craig Warren
2016-03-29 16:33:30 +01:00
父节点 e8eb6f9d93
当前提交 85aef4b0e7

查看文件

@@ -1,8 +1,8 @@
.. _python-scripting:
****************
Python scripting
****************
************************
Scripting the input file
************************
The input file has now been made scriptable by permitting blocks of Python code to be specified between ``#python`` and ``#end_python`` commands. The code is executed when the input file is read by gprMax. You don't need any external tools, such as MATLAB, to generate larger, more complex input files for building intricate models. Python scripting means that gprMax now includes :ref:`libraries of more complex objects, such as antennas <antennas>`, that can be easily inserted into a model. You can also access a number of built-in constants from your Python code.
@@ -22,22 +22,6 @@ You can access the following built-in variables from your Python code:
* ``number_model_runs`` is the total number of runs specified when the model was initially executed, i.e. from ``python -m gprMax my_input_file -n number_of_model_runs``
* ``inputdirectory`` is the path to the directory where your input file is located.
Antenna models
==============
You can also access a user library of antenna models. This library currently features models of antennas similar to:
* a Geophysical Survey Systems, Inc. (GSSI) 1.5 GHz (Model 5100) antenna (http://www.geophysical.com)
* a MALA Geoscience 1.2 GHz antenna (http://www.malags.com/)
These antenna models can be accessed from within a block of Python code in your simulation. For example, to use Python to include an antenna model similar to a GSSI 1.5 GHz antenna at a location 0.125m, 0.094m, 0.100m (x,y,z) using a 1mm spatial resolution:
.. code-block:: none
#python:
from user_libs.antennas import antenna_like_GSSI_1500
antenna_like_GSSI_1500(0.125, 0.094, 0.100, 0.001)
#end_python:
Functions for input commands
============================
@@ -48,7 +32,7 @@ To make it easier to create commands within a block of Python code, there is a b
#python:
from gprMax.input_cmd_funcs import *
domain = domain(0.2 0.2 0.2)
domain = domain(0.2, 0.2, 0.2)
for x in range(0, 8)
cylinder(0.02 + x * 0.02, 0.05, 0, 0.020 + x * 0.02, 0.05, domain[2], 0.005, 'pec’)
#end_python: