watex.utils.geotools.get_thick_from_range#
- watex.utils.geotools.get_thick_from_range(rthick, /, sep=':-', flatten_range=False, mode='strict', raise_warn=True)[source]#
Computes the thickness from depth range passed in litteral string.
Collect values where thickness range is explicitly specified then compute the thickness. Note that if sep is not supplied or empty, value can yield an expected bad thickness calculation. Note that when the layer thicknesses are given as numeric values only, uses
get_thick_from_values()instead.- Parameters:
rthick (str) –
Text value of thick range composed of layer thickness declaration. Each layer depth range must be separated with spaces. For instance the depth range of layer A and B should be:
v='42-52 63-85'
where
'42-52'is the layer A thickness range with 42 (m) as the top and 52(m) the bottom i.e. the thickness of layer A equals to 10m. Idem, the thickness of layer B equals to 22(m) with top starts at 63 (m) and end at 85 (m) (bottom).sep (str, default=':-') –
The separator used to differenciate the top and bottom values of the layer. For example:
sep =':-' --> '25:50' or '25-50'
where 25 and 50 corresponds to top (roof) and bottom ( wall) of the layer/stratum respectively. Both
'':-'are valid to make this distinction. Any other character can be used provided that it is specified as an argument of `sep`parameter.flatten (bool, default=False,) –
If
Truereturn the value of layer top and bottom into a single list. For example:['20-33', '58:125']-> [['20', '33'], ['58', '125']] --> ['20', '33', '58', '125']
mode (str, bool ='strict') – Mode to retrieve, arrange and compute the layer thicknesses. In
strictmode, any bad arrangement of misimputed of thickness values should raise an error. However, in ‘soft’, the bad arrangement is systematically dropped especially when top and bottom values of the layers are null.raise_warn (bool, default=True) – Warn user about the layer ranking and thickness calculation.
- Returns:
thick_range (List of layer thickness flattened or not)
thickness (list - The calculated thickness of each stratum.)
Examples
>>> from watex.utils.geotools import get_thick_from_range >>> get_thick_from_range ('20-33 58:125', sep =':-') Out[88]: ([array([20., 33.]), array([ 58., 125.])], [13.0, 67.0]) >>> # when mixed values are given >>> get_thick_from ( "99 0-15 15.2-18.8 40.0-70.7", mode='soft') Out[89]: ([array([ 0., 15.]), array([15.2, 18.8]), array([40. , 70.7])], [15.0, 3.6000000000000014, 30.700000000000003])