Grids

GridSpec

class wtools.geostats.grids.GridSpec(**kwargs)[source]

Bases: properties.base.base.HasProperties

A GridSpec object provides the details of a single axis along a grid.
If you have a 3D grid then you will have 3 GridSpec objects.

Required Properties:

  • min (Integer): The minimum value along this dimension. The origin., an integer, Default: 0
  • n (Integer): The number of components along this dimension., an integer
  • sz (Integer): The uniform cell size along this dimension., an integer, Default: 1

Optional Properties:

  • nnodes (Integer): The number of grid nodes to consider on either side of the origin in the output map, an integer
min

0

Type:min (Integer)
Type:The minimum value along this dimension. The origin., an integer, Default
n

The number of components along this dimension., an integer

Type:n (Integer)
nnodes

The number of grid nodes to consider on either side of the origin in the output map, an integer

Type:nnodes (Integer)
sz

1

Type:sz (Integer)
Type:The uniform cell size along this dimension., an integer, Default

geoeas_to_np

wtools.geostats.grids.geoeas_to_np(datain, nx, ny=None, nz=None)[source]

Transform GeoEas array into np.ndarray to be treated like image. Function to transform a SINGLE GoeEas-formatted raster (datain) i.e., a single column, to a NumPy array that can be viewed using imshow (in 2D) or slice (in 3D).

Parameters:
  • datain (np.ndarray) – 1D input GeoEas-formatted raster of dimensions:
  • nx (int) – the number of dimensions along the 1st axis
  • ny (int, optional) – the number of dimensions along the 2nd axis
  • nz (int, optional) – the number of dimensions along the 3rd axis
Returns:

If only nx given: 1D array.

If only nx and ny given: 2D array. If nx, ny, and nz given: 3D array.

Return type:

np.ndarray

Note

In 3D, z increases upwards

References

Originally implemented in MATLAB by:
Phaedon Kyriakidis, Department of Geography, University of California Santa Barbara, May 2005
Reimplemented into Python by:
Bane Sullivan and Jonah Bartrand, Department of Geophysics, Colorado School of Mines, October 2018

geoeas_to_npGS

wtools.geostats.grids.geoeas_to_npGS(datain, gridspecs)[source]

A wrapper for geoeas_to_np to handle a list of GridSpec objects

Parameters:gridspecs (list(GridSpec)) – array with grid specifications using GridSpec objects