gstools.field.PGS

class gstools.field.PGS(dim, fields)[source]

Bases: object

A class to generate plurigaussian field simulations (PGS).

See e.g. [Ricketts2023] and [Armstrong2011] for more details.

Parameters:
  • dim (int) – dimension of the field

  • fields (list or numpy.ndarray) – For dim > 1 a list of spatial random fields (SRFs), with len(fields) == dim. For dim == 1, the SRF can be directly given, instead of a list. This class supports structured and unstructured meshes. All fields must have the same shapes.

Notes

Using plurigaussian fields for conditioning fields is still a beta feature.

References

[Ricketts2023]

Ricketts, E.J., Freeman, B.L., Cleall, P.J. et al. A Statistical Finite Element Method Integrating a Plurigaussian Random Field Generator for Multi-scale Modelling of Solute Transport in Concrete. Transp Porous Med 148, 95–121 (2023) https://doi.org/10.1007/s11242-023-01930-8

[Armstrong2011]

Armstrong, Margaret, et al. Plurigaussian simulations in geosciences. Springer Science & Business Media, 2011. https://doi.org/10.1007/978-3-642-19607-2

Methods

__call__(lithotypes)

Generate the plurigaussian field.

calc_lithotype_axes(lithotypes_shape)

Calculate the axes on which the lithorypes are defined.

transform_coords(lithotypes_shape, pos)

Transform position from correlation coords to L indices.

__call__(lithotypes)[source]

Generate the plurigaussian field.

Parameters:

lithotypes (numpy.ndarray) – A dim dimensional structured field, whose values are mapped to the PGS. It does not have to have the same shape as the fields, as the indices are automatically scaled.

Returns:

pgs – the plurigaussian field

Return type:

numpy.ndarray

calc_lithotype_axes(lithotypes_shape)[source]

Calculate the axes on which the lithorypes are defined.

With the centroid of the correlations of the SRFs at the center, the axes are calculated, which hold all correlations. These axes are used for the lithotypes field.

Parameters:

lithotypes_shape (tuple) – The shape of the lithotypes field.

Returns:

pos_lith – the axes holding all field correlations

Return type:

numpy.ndarray

transform_coords(lithotypes_shape, pos)[source]

Transform position from correlation coords to L indices.

This is a helper method to get the lithoty pes indices for given correlated field values.

Parameters:
  • lithotypes_shape (tuple) – The shape of the lithotypes field.

  • pos (numpy.ndarray) – The position in field coordinates, which will be transformed.

Returns:

pos_trans – the transformed position tuple

Return type:

list