GSLib algorithms¶
This module is wrapper on top of GSLib to run its algorithms inside a jupyter notebook in a seamless integration with pyLPM.
Cell declustering¶
-
pyLPM.gslib.declus(df, x, y, z, var, tmin=-1e+21, tmax=1e+21, summary_file='pyLPM/gslib90/tmp/tmpsum.dat', output_file='pyLPM/gslib90/tmp/tmpfile.dat', x_anis=1, z_anis=1, n_cell=10, min_size=1, max_size=20, keep_min=True, number_offsets=4, usewine=False)[source]¶ cell declustering algortihm. This function shows the declustering reults summary and writes weights to the DataFrame.
Parameters: - df (DataFrame) – points data DataFrame
- x (str) – x coordinates column name
- y (str) – y coordinates column name
- z (str) – z coordinates column name
- var (str) – variable column name
- tmin (float, optional) – minimum triming limit. Defaults to -1.0e21.
- tmax (float, optional) – maximum triming limit. Defaults to 1.0e21.
- summary_file (str, optional) – output summary file path. Defaults to ‘pyLPM/gslib90/tmp/tmpsum.dat’.
- output_file (str, optional) – output file path. Defaults to ‘pyLPM/gslib90/tmp/tmpfile.dat’.
- x_anis (float, optional) – the anisotropy factors to consider rectangular cells. The cell size in the x direction is multiplied by these factors to get the cell size in the y and z directions, e.g., if a cell size of 10 is being considered and anisy2 and anisz3 then the cell size in the y direction is 20 and the cell size in the z direction is 30.. Defaults to 1.
- z_anis (float, optional) – anisotropy factor. Defaults to 1.
- n_cell (int, optional) – number of cells. Defaults to 10.
- min_size (float, optional) – minimum size. Defaults to 1.
- max_size (float, optional) – maximum size. Defaults to 20.
- keep_min (bool, optional) – an boolean flag that specifies whether a minimum mean value (True) or maximum mean value (False) is being looked for. Defaults to True.
- number_offsets (int, optional) – the number of origin offsets. Each of the ncell cell sizes are considered with noff different original starting points. This avoids erratic results caused by extreme values falling into specific cells. A good number is 4 in 2-D and 8 in 3-D. A short description of the program. Defaults to 4.
- usewine (bool, optional) – use wine flag. Defaults to False.
Kriging¶
-
pyLPM.gslib.kt3d(df, dh, x, y, z, var, grid, variogram, min_samples, max_samples, max_oct, search_radius, search_ang=[0, 0, 0], discretization=[5, 5, 1], krig_type='OK', sk_mean=0, tmin=-1e+21, tmax=1e+21, option='grid', debug_level=0, debug_file='pyLPM/gslib90/tmp/debug.out', output_file='pyLPM/gslib90/tmp/output.out', usewine=False)[source]¶ Kriging algorithm. This function will show cross validation results if
option = 'cross'oroption = 'jackknife'or it will return estimated values and variace arrays ifoption = 'grid'.Parameters: - df (DataFrame) – points data DataFrame
- x (str) – x coordinates column name
- y (str) – y coordinates column name
- z (str) – z coordinates column name
- var (str) – variable column name
- grid (dict) – grid definitions dictionary
- variogram (dict) – variogram dictionary
- min_samples (int) – minimum samples
- max_samples (int) – maximum number of samples
- max_oct (int) – maximum number of samples per octant
- search_radius (list) – range1, ramge2, range3 values list
- search_ang (list, optional) – azimuth, dip, rake values list. Defaults to [0,0,0].
- discretization (list, optional) – block discretization. Defaults to [5,5,1].
- krig_type (str, optional) – ‘SK’ or ‘OK’ flag. Defaults to ‘OK’.
- sk_mean (float, optional) – simple kriging mean. Defaults to 0.
- tmin (float, optional) – minimum trimming limit. Defaults to -1.0e21.
- tmax (float, optional) – maximum trimming limit. Defaults to 1.0e21.
- option (str, optional) – cross validation ‘cross’, jackknife ‘jackknife’ or estimation ‘grid’ flag . Defaults to ‘grid’.
- debug_level (int, optional) – debug level. Defaults to 0.
- debug_file (str, optional) – debug file path. Defaults to ‘pyLPM/gslib90/tmp/debug.out’.
- output_file (str, optional) – output file path. Defaults to ‘pyLPM/gslib90/tmp/output.out’.
- usewine (bool, optional) – use wine flag. Defaults to False.