Whitespace removal.

这个提交包含在:
Craig Warren
2016-07-21 16:31:30 +01:00
父节点 4095925ef0
当前提交 f4c01b776c
共有 12 个文件被更改,包括 67 次插入67 次删除

查看文件

@@ -58,7 +58,7 @@ class FractalSurface(object):
def generate_fractal_surface(self, G): def generate_fractal_surface(self, G):
"""Generate a 2D array with a fractal distribution. """Generate a 2D array with a fractal distribution.
Args: Args:
G (class): Grid class instance - holds essential parameters describing the model. G (class): Grid class instance - holds essential parameters describing the model.
""" """
@@ -135,7 +135,7 @@ class FractalVolume(object):
def generate_fractal_volume(self, G): def generate_fractal_volume(self, G):
"""Generate a 3D volume with a fractal distribution. """Generate a 3D volume with a fractal distribution.
Args: Args:
G (class): Grid class instance - holds essential parameters describing the model. G (class): Grid class instance - holds essential parameters describing the model.
""" """
@@ -216,11 +216,11 @@ class Grass(object):
def calculate_blade_geometry(self, blade, height): def calculate_blade_geometry(self, blade, height):
"""Calculates the x and y coordinates for a given height of grass blade. """Calculates the x and y coordinates for a given height of grass blade.
Args: Args:
blade (int): Numeric ID of grass blade. blade (int): Numeric ID of grass blade.
height (float): Height of grass blade. height (float): Height of grass blade.
Returns: Returns:
x, y (float): x and y coordinates of grass blade. x, y (float): x and y coordinates of grass blade.
""" """
@@ -234,11 +234,11 @@ class Grass(object):
def calculate_root_geometry(self, root, depth): def calculate_root_geometry(self, root, depth):
"""Calculates the x and y coordinates for a given depth of grass root. """Calculates the x and y coordinates for a given depth of grass root.
Args: Args:
root (int): Numeric ID of grass root. root (int): Numeric ID of grass root.
depth (float): Depth of grass root. depth (float): Depth of grass root.
Returns: Returns:
x, y (float): x and y coordinates of grass root. x, y (float): x and y coordinates of grass root.
""" """

查看文件

@@ -137,7 +137,7 @@ def geometry_view(xs, ys, zs, xf, yf, zf, dx, dy, dz, filename, type='n'):
dx, dy, dz (float): Spatial discretisation of geometry view. dx, dy, dz (float): Spatial discretisation of geometry view.
filename (str): Filename where geometry file information will be stored. filename (str): Filename where geometry file information will be stored.
type (str): Can be either n (normal) or f (fine) which specifies whether to output the geometry information on a per-cell basis (n) or a per-cell-edge basis (f). type (str): Can be either n (normal) or f (fine) which specifies whether to output the geometry information on a per-cell basis (n) or a per-cell-edge basis (f).
Returns: Returns:
s, f, d (tuple): 3 namedtuple Coordinate for the start, finish coordinates and spatial discretisation s, f, d (tuple): 3 namedtuple Coordinate for the start, finish coordinates and spatial discretisation
""" """
@@ -157,7 +157,7 @@ def snapshot(xs, ys, zs, xf, yf, zf, dx, dy, dz, time, filename):
dx, dy, dz (float): Spatial discretisation of geometry view. dx, dy, dz (float): Spatial discretisation of geometry view.
time (float): Time in seconds (float) or the iteration number (integer) which denote the point in time at which the snapshot will be taken. time (float): Time in seconds (float) or the iteration number (integer) which denote the point in time at which the snapshot will be taken.
filename (str): Filename where geometry file information will be stored. filename (str): Filename where geometry file information will be stored.
Returns: Returns:
s, f, d (tuple): 3 namedtuple Coordinate for the start, finish coordinates and spatial discretisation s, f, d (tuple): 3 namedtuple Coordinate for the start, finish coordinates and spatial discretisation
""" """
@@ -181,7 +181,7 @@ def edge(xs, ys, zs, xf, yf, zf, material):
Args: Args:
xs, ys, zs, xf, yf, zf (float): Start and finish coordinates. xs, ys, zs, xf, yf, zf (float): Start and finish coordinates.
material (str): Material identifier. material (str): Material identifier.
Returns: Returns:
s, f (tuple): 2 namedtuple Coordinate for the start and finish coordinates s, f (tuple): 2 namedtuple Coordinate for the start and finish coordinates
""" """
@@ -198,7 +198,7 @@ def plate(xs, ys, zs, xf, yf, zf, material):
Args: Args:
xs, ys, zs, xf, yf, zf (float): Start and finish coordinates. xs, ys, zs, xf, yf, zf (float): Start and finish coordinates.
material (str): Material identifier(s). material (str): Material identifier(s).
Returns: Returns:
s, f (tuple): 2 namedtuple Coordinate for the start and finish coordinates s, f (tuple): 2 namedtuple Coordinate for the start and finish coordinates
""" """
@@ -216,7 +216,7 @@ def triangle(x1, y1, z1, x2, y2, z2, x3, y3, z3, thickness, material):
x1, y1, z1, x2, y2, z2, x3, y3, z3 (float): Coordinates of the vertices. x1, y1, z1, x2, y2, z2, x3, y3, z3 (float): Coordinates of the vertices.
thickness (float): Thickness for a triangular prism, or zero for a triangular patch. thickness (float): Thickness for a triangular prism, or zero for a triangular patch.
material (str): Material identifier(s). material (str): Material identifier(s).
Returns: Returns:
v1, v2, v3 (tuple): 3 namedtuple Coordinate for the vertices v1, v2, v3 (tuple): 3 namedtuple Coordinate for the vertices
""" """
@@ -304,7 +304,7 @@ def excitation_file(file1):
Args: Args:
file1 (str): filename file1 (str): filename
Returns: Returns:
file1 (str): filename file1 (str): filename
""" """
@@ -321,7 +321,7 @@ def waveform(shape, amplitude, frequency, identifier):
amplitude (float): is the amplitude of the waveform. amplitude (float): is the amplitude of the waveform.
frequency (float): is the frequency of the waveform in Hertz. frequency (float): is the frequency of the waveform in Hertz.
identifier (str): is an identifier for the waveform used to assign it to a source. identifier (str): is an identifier for the waveform used to assign it to a source.
Returns: Returns:
identifier (str): is an identifier for the waveform used to assign it to a source. identifier (str): is an identifier for the waveform used to assign it to a source.
""" """
@@ -339,7 +339,7 @@ def hertzian_dipole(polarization, f1, f2, f3, identifier, t0=None, t_remove=None
identifier (str): is the identifier of the waveform that should be used with the source. identifier (str): is the identifier of the waveform that should be used with the source.
t0 (float): is an optinal argument for the time delay in starting the source. t0 (float): is an optinal argument for the time delay in starting the source.
t_remove (float): is a time to remove the source. t_remove (float): is a time to remove the source.
Returns: Returns:
coordinates (tuple): namedtuple Coordinate of the source location coordinates (tuple): namedtuple Coordinate of the source location
""" """
@@ -357,7 +357,7 @@ def rx(x, y, z, identifier=None, to_save=None):
x, y, z (float): are the coordinates (x,y,z) of the receiver in the model. x, y, z (float): are the coordinates (x,y,z) of the receiver in the model.
identifier (str): is the optional identifier of the receiver identifier (str): is the optional identifier of the receiver
to_save (list): is a list of outputs with this receiver. It can be any selection from 'Ex', 'Ey', 'Ez', 'Hx', 'Hy', 'Hz', 'Ix', 'Iy', or 'Iz'. to_save (list): is a list of outputs with this receiver. It can be any selection from 'Ex', 'Ey', 'Ez', 'Hx', 'Hy', 'Hz', 'Ix', 'Iy', or 'Iz'.
Returns: Returns:
coordinates (tuple): namedtuple Coordinate of the receiver location coordinates (tuple): namedtuple Coordinate of the receiver location
""" """
@@ -372,7 +372,7 @@ def src_steps(dx=0, dy=0, dz=0):
Args: Args:
dx, dy, dz (float): are the increments in (x, y, z) to move all simple sources or all receivers. dx, dy, dz (float): are the increments in (x, y, z) to move all simple sources or all receivers.
Returns: Returns:
coordinates (tuple): namedtuple Coordinate of the increments coordinates (tuple): namedtuple Coordinate of the increments
""" """
@@ -388,7 +388,7 @@ def rx_steps(dx=0, dy=0, dz=0):
Args: Args:
dx, dy, dz (float): are the increments in (x, y, z) to move all simple sources or all receivers. dx, dy, dz (float): are the increments in (x, y, z) to move all simple sources or all receivers.
Returns: Returns:
coordinates (tuple): namedtuple Coordinate of the increments coordinates (tuple): namedtuple Coordinate of the increments
""" """

查看文件

@@ -25,11 +25,11 @@ from gprMax.exceptions import CmdInputError
def process_python_include_code(inputfile, usernamespace): def process_python_include_code(inputfile, usernamespace):
"""Looks for and processes any Python code found in the input file. It will ignore any lines that are comments, i.e. begin with a double hash (##), and any blank lines. It will also ignore any lines that do not begin with a hash (#) after it has processed Python commands. It will also process any include commands and insert the contents of the included file at that location. """Looks for and processes any Python code found in the input file. It will ignore any lines that are comments, i.e. begin with a double hash (##), and any blank lines. It will also ignore any lines that do not begin with a hash (#) after it has processed Python commands. It will also process any include commands and insert the contents of the included file at that location.
Args: Args:
inputfile (str): Name of the input file to open. inputfile (str): Name of the input file to open.
usernamespace (dict): Namespace that can be accessed by user in any Python code blocks in input file. usernamespace (dict): Namespace that can be accessed by user in any Python code blocks in input file.
Returns: Returns:
processedlines (list): Input commands after Python processing. processedlines (list): Input commands after Python processing.
""" """
@@ -118,7 +118,7 @@ def process_python_include_code(inputfile, usernamespace):
def write_processed_file(inputfile, modelrun, numbermodelruns, processedlines): def write_processed_file(inputfile, modelrun, numbermodelruns, processedlines):
"""Writes an input file after any Python code and include commands in the original input file have been processed. """Writes an input file after any Python code and include commands in the original input file have been processed.
Args: Args:
inputfile (str): Name of the input file to open. inputfile (str): Name of the input file to open.
modelrun (int): Current model run number. modelrun (int): Current model run number.
@@ -140,11 +140,11 @@ def write_processed_file(inputfile, modelrun, numbermodelruns, processedlines):
def check_cmd_names(processedlines, checkessential=True): def check_cmd_names(processedlines, checkessential=True):
"""Checks the validity of commands, i.e. are they gprMax commands, and that all essential commands are present. """Checks the validity of commands, i.e. are they gprMax commands, and that all essential commands are present.
Args: Args:
processedlines (list): Input commands after Python processing. processedlines (list): Input commands after Python processing.
checkessential (boolean): Perform check to see that all essential commands are present. checkessential (boolean): Perform check to see that all essential commands are present.
Returns: Returns:
singlecmds (dict): Commands that can only occur once in the model. singlecmds (dict): Commands that can only occur once in the model.
multiplecmds (dict): Commands that can have multiple instances in the model. multiplecmds (dict): Commands that can have multiple instances in the model.

查看文件

@@ -33,10 +33,10 @@ from gprMax.utilities import round_value
def process_geometrycmds(geometry, G): def process_geometrycmds(geometry, G):
"""This function checks the validity of command parameters, creates instances of classes of parameters, and calls functions to directly set arrays solid, rigid and ID. """This function checks the validity of command parameters, creates instances of classes of parameters, and calls functions to directly set arrays solid, rigid and ID.
Args: Args:
geometry (list): Geometry commands in the model geometry (list): Geometry commands in the model
""" """
for object in geometry: for object in geometry:

查看文件

@@ -30,7 +30,7 @@ from gprMax.waveforms import Waveform
def process_singlecmds(singlecmds, G): def process_singlecmds(singlecmds, G):
"""Checks the validity of command parameters and creates instances of classes of parameters. """Checks the validity of command parameters and creates instances of classes of parameters.
Args: Args:
singlecmds (dict): Commands that can only occur once in the model. singlecmds (dict): Commands that can only occur once in the model.
G (class): Grid class instance - holds essential parameters describing the model. G (class): Grid class instance - holds essential parameters describing the model.

查看文件

@@ -69,7 +69,7 @@ class Material(object):
def calculate_update_coeffsH(self, G): def calculate_update_coeffsH(self, G):
"""Calculates the magnetic update coefficients of the material. """Calculates the magnetic update coefficients of the material.
Args: Args:
G (class): Grid class instance - holds essential parameters describing the model. G (class): Grid class instance - holds essential parameters describing the model.
""" """
@@ -85,7 +85,7 @@ class Material(object):
# Calculate electric update coefficients # Calculate electric update coefficients
def calculate_update_coeffsE(self, G): def calculate_update_coeffsE(self, G):
"""Calculates the electric update coefficients of the material. """Calculates the electric update coefficients of the material.
Args: Args:
G (class): Grid class instance - holds essential parameters describing the model. G (class): Grid class instance - holds essential parameters describing the model.
""" """
@@ -167,7 +167,7 @@ class PeplinskiSoil(object):
def calculate_debye_properties(self, nbins, G): def calculate_debye_properties(self, nbins, G):
"""Calculates the real and imaginery part of a Debye model for the soil as well as a conductivity. It uses a semi-empirical model (http://dx.doi.org/10.1109/36.387598). """Calculates the real and imaginery part of a Debye model for the soil as well as a conductivity. It uses a semi-empirical model (http://dx.doi.org/10.1109/36.387598).
Args: Args:
nbins (int): Number of bins to use to create the different materials. nbins (int): Number of bins to use to create the different materials.
G (class): Grid class instance - holds essential parameters describing the model. G (class): Grid class instance - holds essential parameters describing the model.

查看文件

@@ -30,7 +30,7 @@ from gprMax.gprMax import run_std_sim, run_mpi_sim
def run_opt_sim(args, numbermodelruns, inputfile, usernamespace): def run_opt_sim(args, numbermodelruns, inputfile, usernamespace):
"""Run a simulation using Taguchi's optmisation process. """Run a simulation using Taguchi's optmisation process.
Args: Args:
args (dict): Namespace with command line arguments args (dict): Namespace with command line arguments
numbermodelruns (int): Total number of model runs. numbermodelruns (int): Total number of model runs.
@@ -159,11 +159,11 @@ def run_opt_sim(args, numbermodelruns, inputfile, usernamespace):
def taguchi_code_blocks(inputfile, taguchinamespace): def taguchi_code_blocks(inputfile, taguchinamespace):
"""Looks for and processes a Taguchi code block (containing Python code) in the input file. It will ignore any lines that are comments, i.e. begin with a double hash (##), and any blank lines. """Looks for and processes a Taguchi code block (containing Python code) in the input file. It will ignore any lines that are comments, i.e. begin with a double hash (##), and any blank lines.
Args: Args:
inputfile (str): Name of the input file to open. inputfile (str): Name of the input file to open.
taguchinamespace (dict): Namespace that can be accessed by user a Taguchi code block in input file. taguchinamespace (dict): Namespace that can be accessed by user a Taguchi code block in input file.
Returns: Returns:
processedlines (list): Input commands after Python processing. processedlines (list): Input commands after Python processing.
""" """
@@ -205,10 +205,10 @@ def taguchi_code_blocks(inputfile, taguchinamespace):
def construct_OA(optparams): def construct_OA(optparams):
"""Load an orthogonal array (OA) from a numpy file. Configure and return OA and properties of OA. """Load an orthogonal array (OA) from a numpy file. Configure and return OA and properties of OA.
Args: Args:
optparams (dict): Dictionary containing name of parameters to optimise and their initial ranges optparams (dict): Dictionary containing name of parameters to optimise and their initial ranges
Returns: Returns:
OA (array): Orthogonal array OA (array): Orthogonal array
N (int): Number of experiments in OA N (int): Number of experiments in OA
@@ -292,7 +292,7 @@ def construct_OA(optparams):
def calculate_ranges_experiments(optparams, optparamsinit, levels, levelsopt, levelsdiff, OA, N, k, s, i): def calculate_ranges_experiments(optparams, optparamsinit, levels, levelsopt, levelsdiff, OA, N, k, s, i):
"""Calculate values for parameters to optimise for a set of experiments. """Calculate values for parameters to optimise for a set of experiments.
Args: Args:
optparams (dict): Ordered dictionary containing name of parameters to optimise and their values optparams (dict): Ordered dictionary containing name of parameters to optimise and their values
optparamsinit (list): Initial ranges for parameters to optimise optparamsinit (list): Initial ranges for parameters to optimise
@@ -304,7 +304,7 @@ def calculate_ranges_experiments(optparams, optparamsinit, levels, levelsopt, le
k (int): Number of parameters to optimise in OA k (int): Number of parameters to optimise in OA
s (int): Number of levels in OA s (int): Number of levels in OA
i (int): Iteration number i (int): Iteration number
Returns: Returns:
optparams (dict): Ordered dictionary containing name of parameters to optimise and their values optparams (dict): Ordered dictionary containing name of parameters to optimise and their values
levels (array): Lower, central, and upper values for each parameter levels (array): Lower, central, and upper values for each parameter
@@ -359,7 +359,7 @@ def calculate_ranges_experiments(optparams, optparamsinit, levels, levelsopt, le
def calculate_optimal_levels(optparams, levels, levelsopt, fitnessvalues, OA, N, k): def calculate_optimal_levels(optparams, levels, levelsopt, fitnessvalues, OA, N, k):
"""Calculate optimal levels from results of fitness metric by building a response table. """Calculate optimal levels from results of fitness metric by building a response table.
Args: Args:
optparams (dict): Ordered dictionary containing name of parameters to optimise and their values optparams (dict): Ordered dictionary containing name of parameters to optimise and their values
levels (array): Lower, central, and upper values for each parameter levels (array): Lower, central, and upper values for each parameter
@@ -368,7 +368,7 @@ def calculate_optimal_levels(optparams, levels, levelsopt, fitnessvalues, OA, N,
OA (array): Orthogonal array OA (array): Orthogonal array
N (int): Number of experiments in OA N (int): Number of experiments in OA
k (int): Number of parameters to optimise in OA k (int): Number of parameters to optimise in OA
Returns: Returns:
optparams (dict): Ordered dictionary containing name of parameters to optimise and their values optparams (dict): Ordered dictionary containing name of parameters to optimise and their values
levelsopt (array): Optimal level for each parameter from previous iteration levelsopt (array): Optimal level for each parameter from previous iteration
@@ -417,7 +417,7 @@ def calculate_optimal_levels(optparams, levels, levelsopt, fitnessvalues, OA, N,
def plot_optimisation_history(fitnessvalueshist, optparamshist, optparamsinit): def plot_optimisation_history(fitnessvalueshist, optparamshist, optparamsinit):
"""Plot the history of fitness values and each optimised parameter values for the optimisation. """Plot the history of fitness values and each optimised parameter values for the optimisation.
Args: Args:
fitnessvalueshist (list): History of fitness values fitnessvalueshist (list): History of fitness values
optparamshist (dict): Name of parameters to optimise and history of their values optparamshist (dict): Name of parameters to optimise and history of their values

查看文件

@@ -66,7 +66,7 @@ class CFS(object):
def calculate_sigmamax(self, direction, er, mr, G): def calculate_sigmamax(self, direction, er, mr, G):
"""Calculates an optimum value for sigma max based on underlying material properties. """Calculates an optimum value for sigma max based on underlying material properties.
Args: Args:
direction (str): Direction of PML slab direction (str): Direction of PML slab
er (float): Average permittivity of underlying material. er (float): Average permittivity of underlying material.
@@ -87,12 +87,12 @@ class CFS(object):
def scaling_polynomial(self, order, Evalues, Hvalues): def scaling_polynomial(self, order, Evalues, Hvalues):
"""Applies the polynomial to be used for the scaling profile for electric and magnetic PML updates. """Applies the polynomial to be used for the scaling profile for electric and magnetic PML updates.
Args: Args:
order (int): Order of polynomial for scaling profile. order (int): Order of polynomial for scaling profile.
Evalues (float): numpy array holding scaling profile values for electric PML update. Evalues (float): numpy array holding scaling profile values for electric PML update.
Hvalues (float): numpy array holding scaling profile values for magnetic PML update. Hvalues (float): numpy array holding scaling profile values for magnetic PML update.
Returns: Returns:
Evalues (float): numpy array holding scaling profile values for electric PML update. Evalues (float): numpy array holding scaling profile values for electric PML update.
Hvalues (float): numpy array holding scaling profile values for magnetic PML update. Hvalues (float): numpy array holding scaling profile values for magnetic PML update.
@@ -105,11 +105,11 @@ class CFS(object):
def calculate_values(self, thickness, parameter): def calculate_values(self, thickness, parameter):
"""Calculates values for electric and magnetic PML updates based on profile type and minimum and maximum values. """Calculates values for electric and magnetic PML updates based on profile type and minimum and maximum values.
Args: Args:
thickness (int): Thickness of PML in cells. thickness (int): Thickness of PML in cells.
parameter (CFSParameter): Instance of CFSParameter parameter (CFSParameter): Instance of CFSParameter
Returns: Returns:
Evalues (float): numpy array holding profile value for electric PML update. Evalues (float): numpy array holding profile value for electric PML update.
Hvalues (float): numpy array holding profile value for magnetic PML update. Hvalues (float): numpy array holding profile value for magnetic PML update.
@@ -194,7 +194,7 @@ class PML(object):
def calculate_update_coeffs(self, er, mr, G): def calculate_update_coeffs(self, er, mr, G):
"""Calculates electric and magnetic update coefficients for the PML. """Calculates electric and magnetic update coefficients for the PML.
Args: Args:
er (float): Average permittivity of underlying material er (float): Average permittivity of underlying material
mr (float): Average permeability of underlying material mr (float): Average permeability of underlying material

查看文件

@@ -67,7 +67,7 @@ class Snapshot(object):
def prepare_vtk_imagedata(self, modelrun, numbermodelruns, G): def prepare_vtk_imagedata(self, modelrun, numbermodelruns, G):
"""Prepares a VTK ImageData (.vti) file for a snapshot. """Prepares a VTK ImageData (.vti) file for a snapshot.
Args: Args:
modelrun (int): Current model run number. modelrun (int): Current model run number.
numbermodelruns (int): Total number of model runs. numbermodelruns (int): Total number of model runs.
@@ -112,7 +112,7 @@ class Snapshot(object):
def write_vtk_imagedata(self, Ex, Ey, Ez, Hx, Hy, Hz, G): def write_vtk_imagedata(self, Ex, Ey, Ez, Hx, Hy, Hz, G):
"""Writes electric and magnetic field values to VTK ImageData (.vti) file. """Writes electric and magnetic field values to VTK ImageData (.vti) file.
Args: Args:
Ex, Ey, Ez, Hx, Hy, Hz (memory view): Electric and magnetic field values. Ex, Ey, Ez, Hx, Hy, Hz (memory view): Electric and magnetic field values.
G (class): Grid class instance - holds essential parameters describing the model. G (class): Grid class instance - holds essential parameters describing the model.

查看文件

@@ -51,7 +51,7 @@ class VoltageSource(Source):
def update_electric(self, abstime, updatecoeffsE, ID, Ex, Ey, Ez, G): def update_electric(self, abstime, updatecoeffsE, ID, Ex, Ey, Ez, G):
"""Updates electric field values for a voltage source. """Updates electric field values for a voltage source.
Args: Args:
abstime (float): Absolute time. abstime (float): Absolute time.
updatecoeffsE (memory view): numpy array of electric field update coefficients. updatecoeffsE (memory view): numpy array of electric field update coefficients.
@@ -91,7 +91,7 @@ class VoltageSource(Source):
def create_material(self, G): def create_material(self, G):
"""Create a new material at the voltage source location that adds the voltage source conductivity to the underlying parameters. """Create a new material at the voltage source location that adds the voltage source conductivity to the underlying parameters.
Args: Args:
G (class): Grid class instance - holds essential parameters describing the model. G (class): Grid class instance - holds essential parameters describing the model.
""" """
@@ -129,7 +129,7 @@ class HertzianDipole(Source):
def update_electric(self, abstime, updatecoeffsE, ID, Ex, Ey, Ez, G): def update_electric(self, abstime, updatecoeffsE, ID, Ex, Ey, Ez, G):
"""Updates electric field values for a Hertzian dipole. """Updates electric field values for a Hertzian dipole.
Args: Args:
abstime (float): Absolute time. abstime (float): Absolute time.
updatecoeffsE (memory view): numpy array of electric field update coefficients. updatecoeffsE (memory view): numpy array of electric field update coefficients.
@@ -167,7 +167,7 @@ class MagneticDipole(Source):
def update_magnetic(self, abstime, updatecoeffsH, ID, Hx, Hy, Hz, G): def update_magnetic(self, abstime, updatecoeffsH, ID, Hx, Hy, Hz, G):
"""Updates magnetic field values for a magnetic dipole. """Updates magnetic field values for a magnetic dipole.
Args: Args:
abstime (float): Absolute time. abstime (float): Absolute time.
updatecoeffsH (memory view): numpy array of magnetic field update coefficients. updatecoeffsH (memory view): numpy array of magnetic field update coefficients.
@@ -231,7 +231,7 @@ class TransmissionLine(Source):
def calculate_incident_V_I(self, G): def calculate_incident_V_I(self, G):
"""Calculates the incident voltage and current with a long length transmission line not connected to the main grid from: http://dx.doi.org/10.1002/mop.10415 """Calculates the incident voltage and current with a long length transmission line not connected to the main grid from: http://dx.doi.org/10.1002/mop.10415
Args: Args:
G (class): Grid class instance - holds essential parameters describing the model. G (class): Grid class instance - holds essential parameters describing the model.
""" """
@@ -250,7 +250,7 @@ class TransmissionLine(Source):
def update_abc(self, G): def update_abc(self, G):
"""Updates absorbing boundary condition at end of the transmission line. """Updates absorbing boundary condition at end of the transmission line.
Args: Args:
G (class): Grid class instance - holds essential parameters describing the model. G (class): Grid class instance - holds essential parameters describing the model.
""" """
@@ -263,7 +263,7 @@ class TransmissionLine(Source):
def update_voltage(self, time, G): def update_voltage(self, time, G):
"""Updates voltage values along the transmission line. """Updates voltage values along the transmission line.
Args: Args:
time (float): Absolute time. time (float): Absolute time.
G (class): Grid class instance - holds essential parameters describing the model. G (class): Grid class instance - holds essential parameters describing the model.
@@ -281,7 +281,7 @@ class TransmissionLine(Source):
def update_current(self, time, G): def update_current(self, time, G):
"""Updates current values along the transmission line. """Updates current values along the transmission line.
Args: Args:
time (float): Absolute time. time (float): Absolute time.
G (class): Grid class instance - holds essential parameters describing the model. G (class): Grid class instance - holds essential parameters describing the model.
@@ -296,7 +296,7 @@ class TransmissionLine(Source):
def update_electric(self, abstime, Ex, Ey, Ez, G): def update_electric(self, abstime, Ex, Ey, Ez, G):
"""Updates electric field value in the main grid from voltage value in the transmission line. """Updates electric field value in the main grid from voltage value in the transmission line.
Args: Args:
abstime (float): Absolute time. abstime (float): Absolute time.
Ex, Ey, Ez (memory view): numpy array of electric field values. Ex, Ey, Ez (memory view): numpy array of electric field values.
@@ -323,7 +323,7 @@ class TransmissionLine(Source):
def update_magnetic(self, abstime, Hx, Hy, Hz, G): def update_magnetic(self, abstime, Hx, Hy, Hz, G):
"""Updates current value in transmission line from magnetic field values in the main grid. """Updates current value in transmission line from magnetic field values in the main grid.
Args: Args:
abstime (float): Absolute time. abstime (float): Absolute time.
Hx, Hy, Hz (memory view): numpy array of magnetic field values. Hx, Hy, Hz (memory view): numpy array of magnetic field values.

查看文件

@@ -22,7 +22,7 @@ import decimal as d
def logo(version): def logo(version):
"""Print gprMax logo, version, and licencing/copyright information. """Print gprMax logo, version, and licencing/copyright information.
Args: Args:
version (str): Version number. version (str): Version number.
""" """
@@ -30,17 +30,17 @@ def logo(version):
licenseinfo = """ licenseinfo = """
Copyright (C) 2015-2016: The University of Edinburgh Copyright (C) 2015-2016: The University of Edinburgh
Authors: Craig Warren and Antonis Giannopoulos Authors: Craig Warren and Antonis Giannopoulos
gprMax is free software: you can redistribute it and/or modify gprMax is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
gprMax is distributed in the hope that it will be useful, gprMax is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with gprMax. If not, see <http://www.gnu.org/licenses/>.""" along with gprMax. If not, see <http://www.gnu.org/licenses/>."""
@@ -65,7 +65,7 @@ along with gprMax. If not, see <http://www.gnu.org/licenses/>."""
def update_progress(progress): def update_progress(progress):
"""Displays or updates a console progress bar. """Displays or updates a console progress bar.
Args: Args:
progress (float): Number between zero and one to signify progress. progress (float): Number between zero and one to signify progress.
""" """
@@ -80,11 +80,11 @@ def update_progress(progress):
def round_value(value, decimalplaces=0): def round_value(value, decimalplaces=0):
"""Rounding function. """Rounding function.
Args: Args:
value (float): Number to round. value (float): Number to round.
decimalplaces (int): Number of decimal places of float to represent rounded value. decimalplaces (int): Number of decimal places of float to represent rounded value.
Returns: Returns:
rounded (int/float): Rounded value. rounded (int/float): Rounded value.
""" """
@@ -103,11 +103,11 @@ def round_value(value, decimalplaces=0):
def human_size(size, a_kilobyte_is_1024_bytes=True): def human_size(size, a_kilobyte_is_1024_bytes=True):
"""Convert a file size to human-readable form. """Convert a file size to human-readable form.
Args: Args:
size (int): file size in bytes size (int): file size in bytes
a_kilobyte_is_1024_bytes (boolean) - true for multiples of 1024, false for multiples of 1000 a_kilobyte_is_1024_bytes (boolean) - true for multiples of 1024, false for multiples of 1000
Returns: Returns:
Human-readable (string). Human-readable (string).
""" """

查看文件

@@ -35,11 +35,11 @@ class Waveform(object):
def calculate_value(self, time, dt): def calculate_value(self, time, dt):
"""Calculates value of the waveform at a specific time. """Calculates value of the waveform at a specific time.
Args: Args:
time (float): Absolute time. time (float): Absolute time.
dt (float): Absolute time discretisation. dt (float): Absolute time discretisation.
Returns: Returns:
waveform (float): Calculated value for waveform. waveform (float): Calculated value for waveform.
""" """