gstools.tools¶
GStools subpackage providing miscellaneous tools.
Export¶
vtk_export (filename, pos, field[, …]) |
Export a field to vtk |
vtk_export_structured (filename, pos, field) |
Export a field to vtk structured rectilinear grid file |
vtk_export_unstructured (filename, pos, field) |
Export a field to vtk structured rectilinear grid file |
Special functions¶
inc_gamma (s, x) |
The (upper) incomplete gamma function |
exp_int (s, x) |
The exponential integral |
inc_beta (a, b, x) |
The incomplete Beta function |
stable_cov_norm (r, len_scale, hurst, alpha) |
The normalized covariance function of the stable model |
Geometric¶
xyz2pos (x[, y, z, dtype]) |
Convert postional arguments to x, y, z |
pos2xyz (pos[, dtype, calc_dim]) |
Convert postional arguments to x, y, z |
r3d_x (theta) |
Rotation matrix about x axis. |
r3d_y (theta) |
Rotation matrix about y axis. |
r3d_z (theta) |
Rotation matrix about z axis. |
-
gstools.tools.
vtk_export_structured
(filename, pos, field, fieldname='field')[source]¶ Export a field to vtk structured rectilinear grid file
Parameters: - filename (
str
) – Filename of the file to be saved, including the path. Note that an ending (*.vtr or *.vtu) will be added to the name. - pos (
list
) – the position tuple, containing main direction and transversal directions - field (
numpy.ndarray
) – Structured field to be saved. As returned by SRF. - fieldname (
str
, optional) – Name of the field in the VTK file. Default: “field”
- filename (
-
gstools.tools.
vtk_export_unstructured
(filename, pos, field, fieldname='field')[source]¶ Export a field to vtk structured rectilinear grid file
Parameters: - filename (
str
) – Filename of the file to be saved, including the path. Note that an ending (*.vtr or *.vtu) will be added to the name. - pos (
list
) – the position tuple, containing main direction and transversal directions - field (
numpy.ndarray
) – Unstructured field to be saved. As returned by SRF. - fieldname (
str
, optional) – Name of the field in the VTK file. Default: “field”
- filename (
-
gstools.tools.
vtk_export
(filename, pos, field, fieldname='field', mesh_type='unstructured')[source]¶ Export a field to vtk
Parameters: - filename (
str
) – Filename of the file to be saved, including the path. Note that an ending (*.vtr or *.vtu) will be added to the name. - pos (
list
) – the position tuple, containing main direction and transversal directions - field (
numpy.ndarray
) – Unstructured field to be saved. As returned by SRF. - fieldname (
str
, optional) – Name of the field in the VTK file. Default: “field” - mesh_type (
str
, optional) – ‘structured’ / ‘unstructured’. Default: structured
- filename (
-
gstools.tools.
inc_gamma
(s, x)[source]¶ The (upper) incomplete gamma function
Given by:
Parameters: - s (
float
) – exponent in the integral - x (
numpy.ndarray
) – input values
- s (
-
gstools.tools.
exp_int
(s, x)[source]¶ The exponential integral
Given by:
Parameters: - s (
float
) – exponent in the integral - x (
numpy.ndarray
) – input values
- s (
-
gstools.tools.
inc_beta
(a, b, x)[source]¶ The incomplete Beta function
Given by:
Parameters: - a (
float
) – first exponent in the integral - b (
float
) – second exponent in the integral - x (
numpy.ndarray
) – input values
- a (
-
gstools.tools.
stable_cov_norm
(r, len_scale, hurst, alpha)[source]¶ The normalized covariance function of the stable model
Given by
Parameters: - r (
numpy.ndarray
) – input values - len_scale (
float
) – length-scale of the model. - hurst (
float
) – Hurst coefficient of the power law. - alpha (
float
, optional) – Shape parameter of the stable model.
- r (
-
gstools.tools.
xyz2pos
(x, y=None, z=None, dtype=None)[source]¶ Convert postional arguments to x, y, z
Parameters: - x (
numpy.ndarray
) – grid axis in x-direction if structured, or first components of position vectors if unstructured - y (
numpy.ndarray
, optional) – analog to x - z (
numpy.ndarray
, optional) – analog to x - dtype (data-type, optional) – The desired data-type for the array. If not given, then the type will be determined as the minimum type required to hold the objects in the sequence. Default: None
Returns: pos – the position tuple
Return type: - x (
-
gstools.tools.
pos2xyz
(pos, dtype=None, calc_dim=False)[source]¶ Convert postional arguments to x, y, z
Parameters: - pos (
iterable
) – the position tuple, containing main direction and transversal directions - dtype (data-type, optional) – The desired data-type for the array. If not given, then the type will be determined as the minimum type required to hold the objects in the sequence. Default: None
- calc_dim (
bool
) – State if the dimension should be returned
Returns: - x (
numpy.ndarray
) – first components of position vectors - y (
numpy.ndarray
or None) – analog to x - z (
numpy.ndarray
or None) – analog to x - dim (
int
, optional) – dimension (only if calc_dim is True)
Notes
If len(pos) > 3, everything after pos[2] will be ignored.
- pos (
-
gstools.tools.
r3d_x
(theta)[source]¶ Rotation matrix about x axis.
Parameters: theta ( float
) – Rotation angleReturns: Rotation matrix. Return type: numpy.ndarray
-
gstools.tools.
r3d_y
(theta)[source]¶ Rotation matrix about y axis.
Parameters: theta ( float
) – Rotation angleReturns: Rotation matrix. Return type: numpy.ndarray
-
gstools.tools.
r3d_z
(theta)[source]¶ Rotation matrix about z axis.
Parameters: theta ( float
) – Rotation angleReturns: Rotation matrix. Return type: numpy.ndarray