From 85aef4b0e7d34b242cb95d0ac886b40fae3d05f3 Mon Sep 17 00:00:00 2001 From: Craig Warren Date: Tue, 29 Mar 2016 16:33:30 +0100 Subject: [PATCH] Edit to title. Correction of domain function example. --- docs/source/python_scripting.rst | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/docs/source/python_scripting.rst b/docs/source/python_scripting.rst index 8dc5bfd3..235fafbb 100644 --- a/docs/source/python_scripting.rst +++ b/docs/source/python_scripting.rst @@ -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 `, 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: