bruges.models.wedge module

bruges.models.wedge.get_conforming(strat, thickness, conformance)[source]

Function to deal with top and bottom conforming wedges.

bruges.models.wedge.get_strat(strat, thickness, kind='nearest', position=1, wedge=None, zoom_mode='nearest')[source]

Take a ‘stratigraphy’ (either an int, a tuple of ints, or a list-like of floats) and expand or compress it to the required thickness.

kind can be ‘nearest’, ‘linear’, ‘quadratic’, or ‘cubic’.

bruges.models.wedge.get_subwedges(target, breadth)[source]

For a binary target (the reference trace of a wedge), create the range of net:gross subwedges. We do this with binary morphologies in the following way:

  • Erode the ‘secondary’ component (whatever appears second in the target array) one step at a time, until there is nothing left and the resulting trace contains only the primary.
  • Dilate the secondary component until there is nothing left of the primary and the resulting trace contains only the secondary.
  • Arrange the traces in order, starting with all primary, and ending in all secondary. The target trace will be somewhere in between, but not necessarily in the middle.

Returns a 2D array with one target wedge trace per section.

  • target (array) – A 1D array length N, the ‘reference’ trace for the wedge. The reference trace has thickness ‘1’ in the wedge model. This trace must be ‘binary’ — i.e. it must contain exactly 2 unique values.
  • breadth (int) – How many new reference traces should be in the output.

tuple (ndarray, ndarray, int). The ndarray has shape

N x breadth. It represents one target wedge trace per section in ‘breadth’. The integer is the position of the target trace in the ndarray’s second dimension.

bruges.models.wedge.pad_func(before, after)[source]

Padding function. Operates on vector in place, per the np.pad documentation.

bruges.models.wedge.wedge(depth=(30, 40, 30), width=(10, 80, 10), breadth=None, strat=(0, 1, 2), thickness=(0.0, 1.0), mode='linear', conformance='both')[source]

Generate a wedge model.

  • depth (int or tuple) – The vertical size of the model. If a 3-tuple, then each element corresponds to a layer. If an integer, then each layer of the model will be 1/3 of the thickness. Note that if the ‘right’ wedge thickness is more than 1, then the total thickness will be greater than this value.
  • width (int or tuple) – The width of the model. If a 3-tuple, then each element corresponds to a ‘zone’ (left, middle, right). If an integer, then the zones will be 10%, 80% and 10% of the width, respectively.
  • breadth (None or int) – Not implemented. Raises an error.
  • strat (tuple) – Stratigraphy above, in, and below the wedge. This is the ‘reference’ stratigraphy. If you give integers, you get ‘solid’ layers containing those numbers. If you give arrays, you will get layers of those arrays, expanded or squeezed into the layer thicknesses implied in depth.
  • thickness (tuple) – The wedge thickness on the left and on the right. Default is (0.0, 1.0) so the wedge will be thickness 0 on the left and the wedge thickness specified in the depth argument on the right. If the thickness are equal, you’ll have a flat, layer-cake model.
  • mode (str or function) – What kind of interpolation to use. Default: ‘linear’. Other options are ‘sigmoid’, which makes a clinoform-like body, ‘root’, which makes a steep-sided bowl shape like the edge of a channel, and ‘power’, which makes a less steep-sided bowl shape. If you pass a function, give it an API like np.linspace: f(start, stop, num), where start is the left thickness, stop is the right thickness, and num is the width of the middle (wedge) ‘zone’.
  • conformance (str) – ‘top’, ‘bottom’, or ‘both’ (the default). How you want the layers inside the wedge to behave. For top and bottom conformance, if the layer needs to be thicker than the reference.

A tuple containing the

2D wedge model, the top ‘horizon’, the base ‘horizon’, and the position at which the wedge has thickness 1 (i.e. is the thickness specfied by the middle layer depth and/or strat).

Return type:

namedtuple[ndarray, ndarray, ndarray, int]