Faults¶

This file is meant to demonstrate the use of gstlearn for Faulting. It is recalled that Faulting is defined in 2-D.

InĀ [1]:
import gstlearn as gl
import gstlearn.plot as gp

Defining the Information¶

Setting some global variables

InĀ [2]:
ndim = 2
gl.defineDefaultSpace(gl.ESpaceType.RN, ndim)

Defining the output grid

InĀ [3]:
nx = [100, 100]
grid = gl.DbGrid.create(nx)

Defining the data points

InĀ [4]:
nech = 30
data = gl.Db.createFromDbGrid(nech, grid)

Defining a Model which will serve in simulating the value at the data points.

InĀ [5]:
range = 40
model = gl.Model.createFromParam(gl.ECov.CUBIC, range)

Simulate the information at the data points

InĀ [6]:
err = gl.simtub(None, data, model, namconv=gl.NamingConvention("Data"))

Define the set of Faults. Note the coordinates of the fault end-points have been slightly translated from round coordinates in order to avoid having target grid node sitting exactly on fault vertices.

InĀ [7]:
faults = gl.Faults()
faults.addFault(gl.PolyLine2D.create(x=[5.1, 10.1, 20.1], y=[5.1, 25.1, 50.1]))
faults.addFault(gl.PolyLine2D.create(x=[50.1, 90.1], y=[60.1, 70.1]))
faults.addFault(
    gl.PolyLine2D.create(x=[20.1, 80.1, 80.1, 20.1], y=[10.1, 40.1, 10.1, 10.1])
)

Define the Moving Neighborhood (with a maximum of 'nmaxi' samples per neighborhood) an attach the Faults.

InĀ [8]:
nmaxi = 10
neighM = gl.NeighMoving.create(nmaxi=nmaxi)
bipt = gl.BiTargetCheckFaults(faults)
neighM.addBiTargetCheck(bipt)

Plot the information

InĀ [9]:
gp.plot(data)
gp.plot(faults)
gp.geometry(dims=[8, 8])
gp.decoration(title="Information")
No description has been provided for this image

Calculating the Variogram¶

We define the parameters for the calculation of an omni-directional variogram. In a first trial, we compute the variogram without taking faults into account.

InĀ [10]:
varioparam = gl.VarioParam.createOmniDirection(nlag=10, dlag=5)
vario = gl.Vario.create(varioparam)
err = vario.compute(data)
vario.display()
Variogram characteristics
=========================
Number of variable(s)       = 1
Number of direction(s)      = 1
Space dimension             = 2
Variable(s)                 = [Data]

Variance-Covariance Matrix      0.773

Direction #1
------------
Number of lags              = 10
Direction coefficients      =       1.000      0.000
Direction angles (degrees)  =       0.000
Tolerance on direction      =      90.000 (degrees)
Calculation lag             =       5.000
Tolerance on distance       =      50.000 (Percent of the lag value)

For variable 1
       Rank     Npairs   Distance      Value
          1      5.000      5.298      0.023
          2      7.000      9.910      0.166
          3     16.000     15.056      1.255
          4     13.000     19.965      0.687
          5     18.000     24.846      0.806
          6     21.000     29.884      0.785
          7     19.000     34.891      0.816
          8     15.000     40.427      0.772
          9     19.000     44.683      1.114

Represent the variogram with the number of pairs attached to each lag.

InĀ [11]:
res = gp.plot(vario, showPairs=True)
No description has been provided for this image

Performing the same variogram calculation, taking the fault into account

InĀ [12]:
varioparam = gl.VarioParam.createOmniDirection(nlag=10, dlag=5)
varioparam.addFaults(faults)
vario = gl.Vario.create(varioparam)
err = vario.compute(data)
vario.display()
Variogram characteristics
=========================
Number of variable(s)       = 1
Number of direction(s)      = 1
Space dimension             = 2
Calculation takes Faults into account
Variable(s)                 = [Data]

Variance-Covariance Matrix      0.773

Direction #1
------------
Number of lags              = 10
Direction coefficients      =       1.000      0.000
Direction angles (degrees)  =       0.000
Tolerance on direction      =      90.000 (degrees)
Calculation lag             =       5.000
Tolerance on distance       =      50.000 (Percent of the lag value)

For variable 1
       Rank     Npairs   Distance      Value
          1      5.000      5.298      0.023
          2      5.000      9.895      0.212
          3      9.000     14.755      1.136
          4      8.000     19.703      0.301
          5     10.000     24.800      0.495
          6     12.000     29.845      0.597
          7     11.000     34.600      0.874
          8      9.000     40.303      0.693
          9     11.000     44.188      0.843

Represent the variogram again with the number of pairs attached to each lag.

InĀ [13]:
res = gp.plot(vario, showPairs=True)
No description has been provided for this image

Performing the Estimation¶

InĀ [14]:
err = gl.kriging(data, grid, model, neighM)

Plotting the result

InĀ [15]:
gp.plot(grid, "*estim")
gp.plot(data)
gp.plot(faults)
gp.decoration(title="Kriging Estimate with Faults")
No description has been provided for this image
InĀ [16]:
gp.plot(grid, "*stdev")
gp.plot(data)
gp.plot(faults)
gp.decoration(title="St. Dev. with Faults")
No description has been provided for this image
InĀ [17]:
grid.display()
Data Base Grid Characteristics
==============================

Data Base Summary
-----------------
File is organized as a regular grid
Space dimension              = 2
Number of Columns            = 5
Total number of samples      = 10000

Grid characteristics:
---------------------
Origin :       0.000      0.000
Mesh   :       1.000      1.000
Number :         100        100

Variables
---------
Column = 0 - Name = rank - Locator = NA
Column = 1 - Name = x1 - Locator = x1
Column = 2 - Name = x2 - Locator = x2
Column = 3 - Name = Kriging.Data.estim - Locator = z1
Column = 4 - Name = Kriging.Data.stdev - Locator = NA