Skip to content

soil_classification_uscs.py

subsurfaceio.functions.soil_classification_uscs

Soil classification functions.

Functions:

Name Description
decorate_coarse_description

Calculation function.

decorate_fine_description

Calculation function.

get_a_line_position

Calculation function.

get_coarse_graded_symbol

Calculation function.

get_coarse_group_symbol

Calculation function.

get_coarse_symbol

Calculation function.

get_description

Calculation function.

get_fine_symbol

Calculation function.

get_fine_symbol__moreno2018clay

Calculation function.

get_soil_classification_uscs__astm2017d2487

Calculation function.

get_symbol

Calculation function.

decorate_coarse_description

decorate_coarse_description(
    language,
    description,
    fines_content,
    percent_sand,
    percent_gravel,
    has_organic_fines,
)

Calculation function.

\[ \begin{array}{l} \mathbf{function} \ \mathrm{decorate\_coarse\_description}(\mathrm{language}, \mathrm{description}, FC, \mathrm{percent\_sand}, \mathrm{percent\_gravel}, \mathrm{has\_organic\_fines}) \\ \hspace{1em} \mathrm{symbology} \gets \mathrm{ReferenceDataSets}.\mathrm{SoilClassificationSymbology}.\mathrm{to\_index\_map} \mathopen{}\left( \textrm{"key"}, \mathrm{str} \mathopen{}\left( \mathrm{language} \mathclose{}\right) \mathclose{}\right) \\ \hspace{1em} \mathrm{concatenator} \gets \mathrm{np}.\mathrm{select} \mathopen{}\left( \mathopen{}\left[ \mathopen{}\left( FC < 5 \mathclose{}\right) \mathbin{|} \mathopen{}\left( FC > 12 \mathclose{}\right), \mathopen{}\left( 5 \le FC \mathclose{}\right) \mathbin{\&} \mathopen{}\left( FC \le 12 \mathclose{}\right) \mathclose{}\right], \mathopen{}\left[ \mathrm{symbology}_{\textrm{"concatenator\_for\_with"}}, \mathrm{symbology}_{\textrm{"concatenator\_for\_and"}} \mathclose{}\right] \mathclose{}\right) \\ \hspace{1em} \mathrm{suffix} \gets \mathrm{np}.\mathrm{select} \mathopen{}\left( \mathopen{}\left[ \mathopen{}\left( \mathrm{percent\_sand} < \mathrm{percent\_gravel} \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{percent\_sand} \ge 15 \mathclose{}\right), \mathopen{}\left( \mathrm{percent\_sand} \ge \mathrm{percent\_gravel} \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{percent\_gravel} \ge 15 \mathclose{}\right) \mathclose{}\right], \mathopen{}\left[ \mathrm{concatenator} + \textrm{" "} + \mathrm{symbology}_{\textrm{"S"}}, \mathrm{concatenator} + \textrm{" "} + \mathrm{symbology}_{\textrm{"G"}} \mathclose{}\right] \mathclose{}\right) \\ \hspace{1em} \mathrm{description} \gets \mathrm{np}.\mathrm{where} \mathopen{}\left( \mathrm{suffix}.\mathrm{astype} \mathopen{}\left( \mathrm{bool} \mathclose{}\right), \mathrm{description} + \textrm{" "} + \mathrm{suffix}, \mathrm{description} \mathclose{}\right) \\ \hspace{1em} \mathrm{description} \gets \mathrm{np}.\mathrm{where} \mathopen{}\left( \mathrm{has\_organic\_fines}, \mathrm{description} + \textrm{" with organic fines"}, \mathrm{description} \mathclose{}\right) \\ \hspace{1em} \mathbf{return} \ \mathrm{description} \\ \mathbf{end \ function} \end{array} \]

Parameters:

Name Type Description Default
language str

Language

required
description str

Description

required
fines_content float

Percentage of fines passing No. 200 sieve

required
percent_sand float

Sand percentage (% passing No. 4 sieve)

required
percent_gravel float

Gravel percentage (% retained on No. 4 sieve)

required
has_organic_fines bool

Indicates if the soil contains organic fines

required

Returns:

Name Type Description
uscs_description str

Unified Soil Classification System description

decorate_fine_description

decorate_fine_description(
    language,
    description,
    percent_sand,
    percent_gravel,
    fine_type,
)

Calculation function.

\[ \begin{array}{l} \mathbf{function} \ \mathrm{decorate\_fine\_description}(\mathrm{language}, \mathrm{description}, \mathrm{percent\_sand}, \mathrm{percent\_gravel}, \mathrm{fine\_type}) \\ \hspace{1em} \mathrm{symbology} \gets \mathrm{ReferenceDataSets}.\mathrm{SoilClassificationSymbology}.\mathrm{to\_index\_map} \mathopen{}\left( \textrm{"key"}, \mathrm{str} \mathopen{}\left( \mathrm{language} \mathclose{}\right) \mathclose{}\right) \\ \hspace{1em} \mathrm{coarse\_group\_symbol} \gets \mathrm{get\_coarse\_group\_symbol} \mathopen{}\left( \mathrm{percent\_sand}, \mathrm{percent\_gravel} \mathclose{}\right) \\ \hspace{1em} \mathrm{percent\_coarse} \gets \mathrm{percent\_sand} + \mathrm{percent\_gravel} \\ \hspace{1em} \mathrm{prefix\_abbreviation} \gets \mathrm{np}.\mathrm{select} \mathopen{}\left( \mathopen{}\left[ \mathopen{}\left( \mathrm{percent\_coarse} \ge 30 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{coarse\_group\_symbol} = \textrm{"S"} \mathclose{}\right), \mathopen{}\left( \mathrm{percent\_coarse} \ge 30 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{coarse\_group\_symbol} = \textrm{"G"} \mathclose{}\right) \mathclose{}\right], \mathopen{}\left[ \textrm{"S-ey"}, \textrm{"G-ey"} \mathclose{}\right] \mathclose{}\right) \\ \hspace{1em} \mathrm{suffix\_abbreviation} \gets \mathrm{np}.\mathrm{select} \mathopen{}\left( \mathopen{}\left[ \mathopen{}\left( \mathrm{percent\_coarse} \ge 15 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{percent\_coarse} < 30 \mathclose{}\right), \mathopen{}\left( \mathrm{percent\_coarse} \ge 30 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{coarse\_group\_symbol} = \textrm{"S"} \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{percent\_gravel} \ge 15 \mathclose{}\right), \mathopen{}\left( \mathrm{percent\_coarse} \ge 30 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{coarse\_group\_symbol} = \textrm{"G"} \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{percent\_sand} \ge 15 \mathclose{}\right) \mathclose{}\right], \mathopen{}\left[ \mathrm{coarse\_group\_symbol}, \textrm{"G"}, \textrm{"S"} \mathclose{}\right] \mathclose{}\right) \\ \hspace{1em} \mathrm{prefix} \gets \mathrm{replace\_from\_mapping} \mathopen{}\left( \mathrm{prefix\_abbreviation}, \mathrm{symbology} \mathclose{}\right) \\ \hspace{1em} \mathbf{if} \ \mathrm{language} = \textrm{"es"} \\ \hspace{2em} \mathrm{prefix} \gets \mathrm{np}.\mathrm{where} \mathopen{}\left( \mathrm{np}.\mathrm{isin} \mathopen{}\left( \mathrm{fine\_type}, \mathopen{}\left[ \textrm{"silt"}, \textrm{"organic\_silt"} \mathclose{}\right] \mathclose{}\right), \mathrm{np}.\mathrm{strings}.\mathrm{replace} \mathopen{}\left( \mathrm{prefix}, \textrm{"osa"}, \textrm{"oso"} \mathclose{}\right), \mathrm{prefix} \mathclose{}\right) \\ \hspace{1em} \mathbf{end \ if} \\ \hspace{1em} \mathrm{suffix} \gets \mathrm{replace\_from\_mapping} \mathopen{}\left( \mathrm{suffix\_abbreviation}, \mathrm{symbology} \mathclose{}\right) \\ \hspace{1em} \mathrm{concatenator\_for\_with} \gets \mathrm{symbology}_{\textrm{"concatenator\_for\_with"}} \\ \hspace{1em} \mathrm{description} \gets \mathrm{np}.\mathrm{where} \mathopen{}\left( \mathrm{prefix\_abbreviation}.\mathrm{astype} \mathopen{}\left( \mathrm{bool} \mathclose{}\right), \left\{ \begin{array}{ll} \mathrm{prefix} + \textrm{" "} + \mathrm{description}, & \mathrm{if} \ \mathrm{language} = \textrm{"en"} \\ \mathrm{description} + \textrm{" "} + \mathrm{prefix}, & \mathrm{otherwise} \end{array} \right., \mathrm{description} \mathclose{}\right) \\ \hspace{1em} \mathrm{description} \gets \mathrm{np}.\mathrm{where} \mathopen{}\left( \mathrm{suffix\_abbreviation}.\mathrm{astype} \mathopen{}\left( \mathrm{bool} \mathclose{}\right), \mathrm{description} + \textrm{" \{\} "}.\mathrm{format} \mathopen{}\left( \mathrm{concatenator\_for\_with} \mathclose{}\right) + \mathrm{suffix}, \mathrm{description} \mathclose{}\right) \\ \hspace{1em} \mathbf{return} \ \mathrm{description} \\ \mathbf{end \ function} \end{array} \]

Parameters:

Name Type Description Default
language str

Language

required
description str

Description

required
percent_sand float

Sand percentage (% passing No. 4 sieve)

required
percent_gravel float

Gravel percentage (% retained on No. 4 sieve)

required
fine_type str

Fine-grained soil type used internally for USCS classification

required

Returns:

Name Type Description
uscs_description str

Unified Soil Classification System description

get_a_line_position

get_a_line_position(liquid_limit, plasticity_index)

Calculation function.

\[ \begin{array}{l} \mathbf{function} \ \mathrm{get\_a\_line\_position}(LL, PI) \\ \hspace{1em} \textrm{" Returns the corresponding A line position "} \\ \hspace{1em} \mathrm{a\_line} \gets \mathrm{np}.\mathrm{where} \mathopen{}\left( LL \le 25.5, 4.0, 0.73 \mathopen{}\left( LL - 20 \mathclose{}\right) \mathclose{}\right) \\ \hspace{1em} \mathrm{condition\_1} \gets PI \ge \mathrm{a\_line} \\ \hspace{1em} \mathrm{choice\_1} \gets \textrm{"above"} \\ \hspace{1em} \mathrm{condition\_2} \gets PI < \mathrm{a\_line} \\ \hspace{1em} \mathrm{choice\_2} \gets \textrm{"below"} \\ \hspace{1em} \mathrm{a\_line\_position} \gets \mathrm{np}.\mathrm{select} \mathopen{}\left( \mathopen{}\left[ \mathrm{condition\_1}, \mathrm{condition\_2} \mathclose{}\right], \mathopen{}\left[ \mathrm{choice\_1}, \mathrm{choice\_2} \mathclose{}\right] \mathclose{}\right) \\ \hspace{1em} \mathbf{return} \ \mathrm{a\_line\_position} \\ \mathbf{end \ function} \end{array} \]

Parameters:

Name Type Description Default
liquid_limit float

Liquid limit of soil

required
plasticity_index float

Plasticity index of soil

required

Returns:

Name Type Description
a_line_position Any

a_line_position

get_coarse_graded_symbol

get_coarse_graded_symbol(
    group_symbol,
    uniformity_coefficient,
    curvature_coefficient,
)

Calculation function.

\[ \begin{array}{l} \mathbf{function} \ \mathrm{get\_coarse\_graded\_symbol}(\mathrm{group\_symbol}, C_u, C_c) \\ \hspace{1em} \textrm{" Returns the corresponding coarse graded symbol "} \\ \hspace{1em} \mathrm{condition\_1} \gets \mathopen{}\left( \mathrm{group\_symbol} = \textrm{"G"} \mathclose{}\right) \mathbin{\&} \mathopen{}\left( C_u \ge 4 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( 1 \le C_c \mathclose{}\right) \mathbin{\&} \mathopen{}\left( C_c \le 3 \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_1} \gets \textrm{"W"} \\ \hspace{1em} \mathrm{condition\_2} \gets \mathopen{}\left( \mathrm{group\_symbol} = \textrm{"G"} \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathopen{}\left( C_u < 4 \mathclose{}\right) \mathbin{|} \mathopen{}\left( C_c < 1 \mathclose{}\right) \mathbin{|} \mathopen{}\left( C_c > 3 \mathclose{}\right) \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_2} \gets \textrm{"P"} \\ \hspace{1em} \mathrm{condition\_3} \gets \mathopen{}\left( \mathrm{group\_symbol} = \textrm{"S"} \mathclose{}\right) \mathbin{\&} \mathopen{}\left( C_u \ge 6 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( 1 \le C_c \mathclose{}\right) \mathbin{\&} \mathopen{}\left( C_c \le 3 \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_3} \gets \textrm{"W"} \\ \hspace{1em} \mathrm{condition\_4} \gets \mathopen{}\left( \mathrm{group\_symbol} = \textrm{"S"} \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathopen{}\left( C_u < 6 \mathclose{}\right) \mathbin{|} \mathopen{}\left( C_c < 1 \mathclose{}\right) \mathbin{|} \mathopen{}\left( C_c > 3 \mathclose{}\right) \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_4} \gets \textrm{"P"} \\ \hspace{1em} \mathrm{graded\_symbol} \gets \mathrm{np}.\mathrm{select} \mathopen{}\left( \mathopen{}\left[ \mathrm{condition\_1}, \mathrm{condition\_2}, \mathrm{condition\_3}, \mathrm{condition\_4} \mathclose{}\right], \mathopen{}\left[ \mathrm{choice\_1}, \mathrm{choice\_2}, \mathrm{choice\_3}, \mathrm{choice\_4} \mathclose{}\right] \mathclose{}\right) \\ \hspace{1em} \mathbf{return} \ \mathrm{graded\_symbol} \\ \mathbf{end \ function} \end{array} \]

Parameters:

Name Type Description Default
group_symbol Any

group_symbol

required
uniformity_coefficient float

Uniformity coefficient for particle size distribution

required
curvature_coefficient float

Curvature coefficient for particle size distribution

required

Returns:

Name Type Description
graded_symbol Any

graded_symbol

get_coarse_group_symbol

get_coarse_group_symbol(percent_sand, percent_gravel)

Calculation function.

\[ \begin{array}{l} \mathbf{function} \ \mathrm{get\_coarse\_group\_symbol}(\mathrm{percent\_sand}, \mathrm{percent\_gravel}) \\ \hspace{1em} \textrm{" Returns the corresponding coarse group symbol "} \\ \hspace{1em} \mathrm{condition\_1} \gets \mathrm{percent\_sand} \ge \mathrm{percent\_gravel} \\ \hspace{1em} \mathrm{choice\_1} \gets \textrm{"S"} \\ \hspace{1em} \mathrm{condition\_2} \gets \mathrm{percent\_sand} < \mathrm{percent\_gravel} \\ \hspace{1em} \mathrm{choice\_2} \gets \textrm{"G"} \\ \hspace{1em} \mathrm{group\_symbol} \gets \mathrm{np}.\mathrm{select} \mathopen{}\left( \mathopen{}\left[ \mathrm{condition\_1}, \mathrm{condition\_2} \mathclose{}\right], \mathopen{}\left[ \mathrm{choice\_1}, \mathrm{choice\_2} \mathclose{}\right] \mathclose{}\right) \\ \hspace{1em} \mathbf{return} \ \mathrm{group\_symbol} \\ \mathbf{end \ function} \end{array} \]

Parameters:

Name Type Description Default
percent_sand float

Sand percentage (% passing No. 4 sieve)

required
percent_gravel float

Gravel percentage (% retained on No. 4 sieve)

required

Returns:

Name Type Description
group_symbol Any

group_symbol

get_coarse_symbol

get_coarse_symbol(
    fines_content,
    percent_sand,
    percent_gravel,
    fine_type,
    uniformity_coefficient: Any = float("nan"),
    curvature_coefficient: Any = float("nan"),
)

Calculation function.

\[ \begin{array}{l} \mathbf{function} \ \mathrm{get\_coarse\_symbol}(FC, \mathrm{percent\_sand}, \mathrm{percent\_gravel}, \mathrm{fine\_type}, C_u, C_c) \\ \hspace{1em} \mathrm{group\_symbol} \gets \mathrm{get\_coarse\_group\_symbol} \mathopen{}\left( \mathrm{percent\_sand}, \mathrm{percent\_gravel} \mathclose{}\right) \\ \hspace{1em} \mathrm{graded\_symbol} \gets \mathrm{get\_coarse\_graded\_symbol} \mathopen{}\left( \mathrm{group\_symbol}, C_u, C_c \mathclose{}\right) \\ \hspace{1em} \mathrm{is\_valid\_group} \gets \mathrm{group\_symbol} \ne \textrm{""} \\ \hspace{1em} \mathrm{is\_valid\_graded} \gets \mathrm{graded\_symbol} \ne \textrm{""} \\ \hspace{1em} \mathrm{is\_silt} \gets \mathrm{np}.\mathrm{isin} \mathopen{}\left( \mathrm{fine\_type}, \mathopen{}\left[ \textrm{"silt"}, \textrm{"organic\_silt"} \mathclose{}\right] \mathclose{}\right) \\ \hspace{1em} \mathrm{is\_clay} \gets \mathrm{np}.\mathrm{isin} \mathopen{}\left( \mathrm{fine\_type}, \mathopen{}\left[ \textrm{"clay"}, \textrm{"organic\_clay"} \mathclose{}\right] \mathclose{}\right) \\ \hspace{1em} \mathrm{is\_dual} \gets \mathrm{fine\_type} = \textrm{"dual"} \\ \hspace{1em} \mathrm{condition\_1} \gets \mathrm{is\_valid\_group} \mathbin{\&} \mathrm{is\_valid\_graded} \mathbin{\&} \mathopen{}\left( FC < 5 \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_1} \gets \mathrm{group\_symbol} + \mathrm{graded\_symbol} \\ \hspace{1em} \mathrm{condition\_2} \gets \mathrm{is\_valid\_group} \mathbin{\&} \mathrm{is\_valid\_graded} \mathbin{\&} \mathopen{}\left( 5 \le FC \mathclose{}\right) \mathbin{\&} \mathopen{}\left( FC \le 12 \mathclose{}\right) \mathbin{\&} \mathrm{is\_silt} \\ \hspace{1em} \mathrm{choice\_2} \gets \mathrm{group\_symbol} + \mathrm{graded\_symbol} + \textrm{"-"} + \mathrm{group\_symbol} + \textrm{"M"} \\ \hspace{1em} \mathrm{condition\_3} \gets \mathrm{is\_valid\_group} \mathbin{\&} \mathrm{is\_valid\_graded} \mathbin{\&} \mathopen{}\left( 5 \le FC \mathclose{}\right) \mathbin{\&} \mathopen{}\left( FC \le 12 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{is\_clay} \mathbin{|} \mathrm{is\_dual} \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_3} \gets \mathrm{group\_symbol} + \mathrm{graded\_symbol} + \textrm{"-"} + \mathrm{group\_symbol} + \textrm{"C"} \\ \hspace{1em} \mathrm{condition\_4} \gets \mathrm{is\_valid\_group} \mathbin{\&} \mathopen{}\left( FC > 12 \mathclose{}\right) \mathbin{\&} \mathrm{is\_silt} \\ \hspace{1em} \mathrm{choice\_4} \gets \mathrm{group\_symbol} + \textrm{"M"} \\ \hspace{1em} \mathrm{condition\_5} \gets \mathrm{is\_valid\_group} \mathbin{\&} \mathopen{}\left( FC > 12 \mathclose{}\right) \mathbin{\&} \mathrm{is\_clay} \\ \hspace{1em} \mathrm{choice\_5} \gets \mathrm{group\_symbol} + \textrm{"C"} \\ \hspace{1em} \mathrm{condition\_6} \gets \mathrm{is\_valid\_group} \mathbin{\&} \mathopen{}\left( FC > 12 \mathclose{}\right) \mathbin{\&} \mathrm{is\_dual} \\ \hspace{1em} \mathrm{choice\_6} \gets \mathrm{group\_symbol} + \textrm{"C"} + \textrm{"-"} + \mathrm{group\_symbol} + \textrm{"M"} \\ \hspace{1em} \mathrm{symbol} \gets \mathrm{np}.\mathrm{select} \mathopen{}\left( \mathopen{}\left[ \mathrm{condition\_1}, \mathrm{condition\_2}, \mathrm{condition\_3}, \mathrm{condition\_4}, \mathrm{condition\_5}, \mathrm{condition\_6} \mathclose{}\right], \mathopen{}\left[ \mathrm{choice\_1}, \mathrm{choice\_2}, \mathrm{choice\_3}, \mathrm{choice\_4}, \mathrm{choice\_5}, \mathrm{choice\_6} \mathclose{}\right] \mathclose{}\right) \\ \hspace{1em} \mathrm{symbol} \gets \mathrm{symbol}.\mathrm{astype} \mathopen{}\left( \mathrm{np}.\mathrm{dtypes}.\mathrm{StringDType} \mathopen{}\left( \mathclose{}\right) \mathclose{}\right) \\ \hspace{1em} \mathbf{return} \ \mathrm{symbol} \\ \mathbf{end \ function} \end{array} \]

Parameters:

Name Type Description Default
fines_content float

Percentage of fines passing No. 200 sieve

required
percent_sand float

Sand percentage (% passing No. 4 sieve)

required
percent_gravel float

Gravel percentage (% retained on No. 4 sieve)

required
fine_type str

Fine-grained soil type used internally for USCS classification

required
uniformity_coefficient float

Uniformity coefficient for particle size distribution

float('nan')
curvature_coefficient float

Curvature coefficient for particle size distribution

float('nan')

Returns:

Name Type Description
uscs_symbol str

Unified Soil Classification System symbol

get_description

get_description(
    language,
    uscs_symbol,
    fines_content,
    percent_sand,
    percent_gravel,
    has_organic_fines,
    fine_type,
)

Calculation function.

\[ \begin{array}{l} \mathbf{function} \ \mathrm{get\_description}(\mathrm{language}, \mathrm{uscs\_symbol}, FC, \mathrm{percent\_sand}, \mathrm{percent\_gravel}, \mathrm{has\_organic\_fines}, \mathrm{fine\_type}) \\ \hspace{1em} \mathrm{symbology} \gets \mathrm{ReferenceDataSets}.\mathrm{SoilClassificationSymbology}.\mathrm{to\_index\_map} \mathopen{}\left( \textrm{"key"}, \mathrm{str} \mathopen{}\left( \mathrm{language} \mathclose{}\right) \mathclose{}\right) \\ \hspace{1em} \mathrm{symbol\_for\_description} \gets \mathrm{np}.\mathrm{select} \mathopen{}\left( \mathopen{}\left[ \mathopen{}\left( \mathrm{uscs\_symbol} = \textrm{"OL"} \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{fine\_type} = \textrm{"organic\_clay"} \mathclose{}\right), \mathopen{}\left( \mathrm{uscs\_symbol} = \textrm{"OL"} \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{fine\_type} = \textrm{"organic\_silt"} \mathclose{}\right), \mathopen{}\left( \mathrm{uscs\_symbol} = \textrm{"OH"} \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{fine\_type} = \textrm{"organic\_clay"} \mathclose{}\right), \mathopen{}\left( \mathrm{uscs\_symbol} = \textrm{"OH"} \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{fine\_type} = \textrm{"organic\_silt"} \mathclose{}\right) \mathclose{}\right], \mathopen{}\left[ \textrm{"OL-c"}, \textrm{"OL-m"}, \textrm{"OH-c"}, \textrm{"OH-m"} \mathclose{}\right] \mathclose{}\right) \\ \hspace{1em} \mathrm{description} \gets \mathrm{replace\_from\_mapping} \mathopen{}\left( \mathrm{symbol\_for\_description}, \mathrm{symbology} \mathclose{}\right) \\ \hspace{1em} \mathrm{condition\_1} \gets FC < 50 \\ \hspace{1em} \mathrm{description\_1} \gets \mathrm{decorate\_coarse\_description} \mathopen{}\left( \mathrm{language}, \mathrm{description}.\mathrm{copy} \mathopen{}\left( \mathclose{}\right), FC, \mathrm{percent\_sand}, \mathrm{percent\_gravel}, \mathrm{has\_organic\_fines} \mathclose{}\right) \\ \hspace{1em} \mathrm{condition\_2} \gets FC \ge 50 \\ \hspace{1em} \mathrm{description\_2} \gets \mathrm{decorate\_fine\_description} \mathopen{}\left( \mathrm{language}, \mathrm{description}.\mathrm{copy} \mathopen{}\left( \mathclose{}\right), \mathrm{percent\_sand}, \mathrm{percent\_gravel}, \mathrm{fine\_type} \mathclose{}\right) \\ \hspace{1em} \mathrm{description} \gets \mathrm{np}.\mathrm{select} \mathopen{}\left( \mathopen{}\left[ \mathrm{condition\_1}, \mathrm{condition\_2} \mathclose{}\right], \mathopen{}\left[ \mathrm{description\_1}, \mathrm{description\_2} \mathclose{}\right] \mathclose{}\right) \\ \hspace{1em} \mathrm{description} \gets \mathrm{np}.\mathrm{strings}.\mathrm{capitalize} \mathopen{}\left( \mathrm{description} \mathclose{}\right) \\ \hspace{1em} \mathbf{return} \ \mathrm{description} \\ \mathbf{end \ function} \end{array} \]

Parameters:

Name Type Description Default
language str

Language

required
uscs_symbol str

Unified Soil Classification System symbol

required
fines_content float

Percentage of fines passing No. 200 sieve

required
percent_sand float

Sand percentage (% passing No. 4 sieve)

required
percent_gravel float

Gravel percentage (% retained on No. 4 sieve)

required
has_organic_fines bool

Indicates if the soil contains organic fines

required
fine_type str

Fine-grained soil type used internally for USCS classification

required

Returns:

Name Type Description
uscs_description str

Unified Soil Classification System description

get_fine_symbol

get_fine_symbol(
    liquid_limit, plasticity_index, has_organic_fines=False
)

Calculation function.

\[ \begin{array}{l} \mathbf{function} \ \mathrm{get\_fine\_symbol}(LL, PI, \mathrm{has\_organic\_fines}) \\ \hspace{1em} \mathrm{has\_organic\_fines} \gets \mathrm{np}.\mathrm{asarray} \mathopen{}\left( \mathrm{has\_organic\_fines} \mathclose{}\right) \\ \hspace{1em} \mathrm{a\_line\_position} \gets \mathrm{get\_a\_line\_position} \mathopen{}\left( LL, PI \mathclose{}\right) \\ \hspace{1em} \mathrm{condition\_1} \gets \mathopen{}\left( LL < 50 \mathclose{}\right) \mathbin{\&} \mathord{\sim} \mathrm{has\_organic\_fines} \mathbin{\&} \mathopen{}\left( PI > 7 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{a\_line\_position} = \textrm{"above"} \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_1} \gets \textrm{"CL"} \\ \hspace{1em} \mathrm{type\_1} \gets \textrm{"clay"} \\ \hspace{1em} \mathrm{condition\_2} \gets \mathopen{}\left( LL < 50 \mathclose{}\right) \mathbin{\&} \mathord{\sim} \mathrm{has\_organic\_fines} \mathbin{\&} \mathopen{}\left( PI \ge 4 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( PI \le 7 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{a\_line\_position} = \textrm{"above"} \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_2} \gets \textrm{"CL-ML"} \\ \hspace{1em} \mathrm{type\_2} \gets \textrm{"dual"} \\ \hspace{1em} \mathrm{condition\_3} \gets \mathopen{}\left( LL < 50 \mathclose{}\right) \mathbin{\&} \mathord{\sim} \mathrm{has\_organic\_fines} \mathbin{\&} \mathopen{}\left( \mathopen{}\left( PI < 4 \mathclose{}\right) \mathbin{|} \mathopen{}\left( \mathrm{a\_line\_position} = \textrm{"below"} \mathclose{}\right) \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_3} \gets \textrm{"ML"} \\ \hspace{1em} \mathrm{type\_3} \gets \textrm{"silt"} \\ \hspace{1em} \mathrm{condition\_4} \gets \mathopen{}\left( LL < 50 \mathclose{}\right) \mathbin{\&} \mathrm{has\_organic\_fines} \mathbin{\&} \mathopen{}\left( \mathrm{a\_line\_position} = \textrm{"above"} \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_4} \gets \textrm{"OL"} \\ \hspace{1em} \mathrm{type\_4} \gets \textrm{"organic\_clay"} \\ \hspace{1em} \mathrm{condition\_5} \gets \mathopen{}\left( LL < 50 \mathclose{}\right) \mathbin{\&} \mathrm{has\_organic\_fines} \mathbin{\&} \mathopen{}\left( \mathrm{a\_line\_position} = \textrm{"below"} \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_5} \gets \textrm{"OL"} \\ \hspace{1em} \mathrm{type\_5} \gets \textrm{"organic\_silt"} \\ \hspace{1em} \mathrm{condition\_6} \gets \mathopen{}\left( LL \ge 50 \mathclose{}\right) \mathbin{\&} \mathord{\sim} \mathrm{has\_organic\_fines} \mathbin{\&} \mathopen{}\left( \mathrm{a\_line\_position} = \textrm{"above"} \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_6} \gets \textrm{"CH"} \\ \hspace{1em} \mathrm{type\_6} \gets \textrm{"clay"} \\ \hspace{1em} \mathrm{condition\_7} \gets \mathopen{}\left( LL \ge 50 \mathclose{}\right) \mathbin{\&} \mathord{\sim} \mathrm{has\_organic\_fines} \mathbin{\&} \mathopen{}\left( \mathrm{a\_line\_position} = \textrm{"below"} \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_7} \gets \textrm{"MH"} \\ \hspace{1em} \mathrm{type\_7} \gets \textrm{"silt"} \\ \hspace{1em} \mathrm{condition\_8} \gets \mathopen{}\left( LL \ge 50 \mathclose{}\right) \mathbin{\&} \mathrm{has\_organic\_fines} \mathbin{\&} \mathopen{}\left( \mathrm{a\_line\_position} = \textrm{"above"} \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_8} \gets \textrm{"OH"} \\ \hspace{1em} \mathrm{type\_8} \gets \textrm{"organic\_clay"} \\ \hspace{1em} \mathrm{condition\_9} \gets \mathopen{}\left( LL \ge 50 \mathclose{}\right) \mathbin{\&} \mathrm{has\_organic\_fines} \mathbin{\&} \mathopen{}\left( \mathrm{a\_line\_position} = \textrm{"below"} \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_9} \gets \textrm{"OH"} \\ \hspace{1em} \mathrm{type\_9} \gets \textrm{"organic\_silt"} \\ \hspace{1em} \mathrm{symbol} \gets \mathrm{np}.\mathrm{select} \mathopen{}\left( \mathopen{}\left[ \mathrm{condition\_1}, \mathrm{condition\_2}, \mathrm{condition\_3}, \mathrm{condition\_4}, \mathrm{condition\_5}, \mathrm{condition\_6}, \mathrm{condition\_7}, \mathrm{condition\_8}, \mathrm{condition\_9} \mathclose{}\right], \mathopen{}\left[ \mathrm{choice\_1}, \mathrm{choice\_2}, \mathrm{choice\_3}, \mathrm{choice\_4}, \mathrm{choice\_5}, \mathrm{choice\_6}, \mathrm{choice\_7}, \mathrm{choice\_8}, \mathrm{choice\_9} \mathclose{}\right] \mathclose{}\right) \\ \hspace{1em} \mathrm{fine\_type} \gets \mathrm{np}.\mathrm{select} \mathopen{}\left( \mathopen{}\left[ \mathrm{condition\_1}, \mathrm{condition\_2}, \mathrm{condition\_3}, \mathrm{condition\_4}, \mathrm{condition\_5}, \mathrm{condition\_6}, \mathrm{condition\_7}, \mathrm{condition\_8}, \mathrm{condition\_9} \mathclose{}\right], \mathopen{}\left[ \mathrm{type\_1}, \mathrm{type\_2}, \mathrm{type\_3}, \mathrm{type\_4}, \mathrm{type\_5}, \mathrm{type\_6}, \mathrm{type\_7}, \mathrm{type\_8}, \mathrm{type\_9} \mathclose{}\right] \mathclose{}\right) \\ \hspace{1em} \mathrm{symbol} \gets \mathrm{symbol}.\mathrm{astype} \mathopen{}\left( \mathrm{np}.\mathrm{dtypes}.\mathrm{StringDType} \mathopen{}\left( \mathclose{}\right) \mathclose{}\right) \\ \hspace{1em} \mathrm{fine\_type} \gets \mathrm{fine\_type}.\mathrm{astype} \mathopen{}\left( \mathrm{np}.\mathrm{dtypes}.\mathrm{StringDType} \mathopen{}\left( \mathclose{}\right) \mathclose{}\right) \\ \hspace{1em} \mathbf{return} \ \mathopen{}\left( \mathrm{symbol}, \mathrm{fine\_type} \mathclose{}\right) \\ \mathbf{end \ function} \end{array} \]

Parameters:

Name Type Description Default
liquid_limit float

Liquid limit of soil

required
plasticity_index float

Plasticity index of soil

required
has_organic_fines bool

Indicates if the soil contains organic fines

False

Returns:

Name Type Description
uscs_symbol str

Unified Soil Classification System symbol

fine_type str

Fine-grained soil type used internally for USCS classification

get_fine_symbol__moreno2018clay

get_fine_symbol__moreno2018clay(
    liquid_limit, plasticity_index
)

Calculation function.

\[ \begin{array}{l} \mathbf{function} \ \mathrm{get\_fine\_symbol\_\_moreno2018clay}(LL, PI) \\ \hspace{1em} \mathrm{c\_line\_value} \gets \frac{LL}{2} \\ \hspace{1em} \mathrm{m\_line\_value} \gets \frac{LL}{3} \\ \hspace{1em} \mathrm{condition\_1} \gets \mathopen{}\left( LL < 50 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( PI > \mathrm{c\_line\_value} \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_1} \gets \textrm{"CL"} \\ \hspace{1em} \mathrm{type\_1} \gets \textrm{"clay"} \\ \hspace{1em} \mathrm{condition\_2} \gets \mathopen{}\left( LL < 50 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( PI > \mathrm{m\_line\_value} \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_2} \gets \textrm{"CL-ML"} \\ \hspace{1em} \mathrm{type\_2} \gets \textrm{"dual"} \\ \hspace{1em} \mathrm{condition\_3} \gets \mathopen{}\left( LL < 50 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( PI \le \mathrm{m\_line\_value} \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_3} \gets \textrm{"ML"} \\ \hspace{1em} \mathrm{type\_3} \gets \textrm{"silt"} \\ \hspace{1em} \mathrm{condition\_4} \gets \mathopen{}\left( LL \ge 50 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( PI > \mathrm{c\_line\_value} \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_4} \gets \textrm{"CH"} \\ \hspace{1em} \mathrm{type\_4} \gets \textrm{"clay"} \\ \hspace{1em} \mathrm{condition\_5} \gets \mathopen{}\left( LL \ge 50 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( PI > \mathrm{m\_line\_value} \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_5} \gets \textrm{"CH-MH"} \\ \hspace{1em} \mathrm{type\_5} \gets \textrm{"dual"} \\ \hspace{1em} \mathrm{condition\_6} \gets \mathopen{}\left( LL \ge 50 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( PI \le \mathrm{m\_line\_value} \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_6} \gets \textrm{"MH"} \\ \hspace{1em} \mathrm{type\_6} \gets \textrm{"silt"} \\ \hspace{1em} \mathrm{symbol} \gets \mathrm{np}.\mathrm{select} \mathopen{}\left( \mathopen{}\left[ \mathrm{condition\_1}, \mathrm{condition\_2}, \mathrm{condition\_3}, \mathrm{condition\_4}, \mathrm{condition\_5}, \mathrm{condition\_6} \mathclose{}\right], \mathopen{}\left[ \mathrm{choice\_1}, \mathrm{choice\_2}, \mathrm{choice\_3}, \mathrm{choice\_4}, \mathrm{choice\_5}, \mathrm{choice\_6} \mathclose{}\right] \mathclose{}\right) \\ \hspace{1em} \mathrm{fine\_type} \gets \mathrm{np}.\mathrm{select} \mathopen{}\left( \mathopen{}\left[ \mathrm{condition\_1}, \mathrm{condition\_2}, \mathrm{condition\_3}, \mathrm{condition\_4}, \mathrm{condition\_5}, \mathrm{condition\_6} \mathclose{}\right], \mathopen{}\left[ \mathrm{type\_1}, \mathrm{type\_2}, \mathrm{type\_3}, \mathrm{type\_4}, \mathrm{type\_5}, \mathrm{type\_6} \mathclose{}\right] \mathclose{}\right) \\ \hspace{1em} \mathrm{symbol} \gets \mathrm{symbol}.\mathrm{astype} \mathopen{}\left( \mathrm{np}.\mathrm{dtypes}.\mathrm{StringDType} \mathopen{}\left( \mathclose{}\right) \mathclose{}\right) \\ \hspace{1em} \mathrm{fine\_type} \gets \mathrm{fine\_type}.\mathrm{astype} \mathopen{}\left( \mathrm{np}.\mathrm{dtypes}.\mathrm{StringDType} \mathopen{}\left( \mathclose{}\right) \mathclose{}\right) \\ \hspace{1em} \mathbf{return} \ \mathopen{}\left( \mathrm{symbol}, \mathrm{fine\_type} \mathclose{}\right) \\ \mathbf{end \ function} \end{array} \]

Parameters:

Name Type Description Default
liquid_limit float

Liquid limit of soil

required
plasticity_index float

Plasticity index of soil

required

Returns:

Name Type Description
uscs_symbol str

Unified Soil Classification System symbol

fine_type str

Fine-grained soil type used internally for USCS classification

get_soil_classification_uscs__astm2017d2487

get_soil_classification_uscs__astm2017d2487(
    language,
    fines_content,
    percent_sand,
    percent_gravel,
    liquid_limit: Any = float("nan"),
    plasticity_index: Any = float("nan"),
    uniformity_coefficient: Any = float("nan"),
    curvature_coefficient: Any = float("nan"),
    non_plastic=False,
    has_organic_fines=False,
    moreno_alonso_plasticity_modification=False,
)

Calculation function.

\[ \begin{array}{l} \mathbf{function} \ \mathrm{get\_soil\_classification\_uscs\_\_astm2017d2487}(\mathrm{language}, FC, \mathrm{percent\_sand}, \mathrm{percent\_gravel}, LL, PI, C_u, C_c, NP, \mathrm{has\_organic\_fines}, \mathrm{moreno\_alonso\_plasticity\_modification}) \\ \hspace{1em} PI \gets \mathrm{np}.\mathrm{where} \mathopen{}\left( NP, 0, PI \mathclose{}\right) \\ \hspace{1em} LL \gets \mathrm{np}.\mathrm{where} \mathopen{}\left( NP \mathbin{\&} \mathrm{np}.\mathrm{isnan} \mathopen{}\left( LL \mathclose{}\right), 0, LL \mathclose{}\right) \\ \hspace{1em} \mathrm{sum\_to\_validate} \gets FC + \mathrm{percent\_sand} + \mathrm{percent\_gravel} \\ \hspace{1em} \mathrm{sum\_to\_validate} \gets \mathrm{np}.\mathrm{asarray} \mathopen{}\left( \mathrm{sum\_to\_validate} \mathclose{}\right) \\ \hspace{1em} \mathbf{if} \ \mathrm{np}.\mathrm{any} \mathopen{}\left( \mathord{\sim} \mathrm{np}.\mathrm{isclose} \mathopen{}\left( \mathrm{sum\_to\_validate}_{\mathord{\sim} \mathrm{np}.\mathrm{isnan} \mathopen{}\left( \mathrm{sum\_to\_validate} \mathclose{}\right)}, 100 \mathclose{}\right) \mathclose{}\right) \\ \hspace{2em} \mathrm{raise\_value\_error} \mathopen{}\left( \textrm{"Sum of fines, sand \& gravel \% not close to 100\%"} \mathclose{}\right) \\ \hspace{1em} \mathbf{end \ if} \\ \hspace{1em} \mathopen{}\left( \mathrm{symbol}, \mathrm{fine\_type} \mathclose{}\right) \gets \mathrm{get\_symbol} \mathopen{}\left( FC, \mathrm{percent\_sand}, \mathrm{percent\_gravel}, LL, PI, C_u, C_c, \mathrm{has\_organic\_fines}, \mathrm{moreno\_alonso\_plasticity\_modification} \mathclose{}\right) \\ \hspace{1em} \mathrm{description} \gets \mathrm{get\_description} \mathopen{}\left( \mathrm{language}, \mathrm{symbol}, FC, \mathrm{percent\_sand}, \mathrm{percent\_gravel}, \mathrm{has\_organic\_fines}, \mathrm{fine\_type} \mathclose{}\right) \\ \hspace{1em} \mathbf{return} \ \mathopen{}\left( \mathrm{symbol}, \mathrm{description} \mathclose{}\right) \\ \mathbf{end \ function} \end{array} \]

Parameters:

Name Type Description Default
language str

Language

required
fines_content float

Percentage of fines passing No. 200 sieve

required
percent_sand float

Sand percentage (% passing No. 4 sieve)

required
percent_gravel float

Gravel percentage (% retained on No. 4 sieve)

required
liquid_limit float

Liquid limit of soil

float('nan')
plasticity_index float

Plasticity index of soil

float('nan')
uniformity_coefficient float

Uniformity coefficient for particle size distribution

float('nan')
curvature_coefficient float

Curvature coefficient for particle size distribution

float('nan')
non_plastic bool

Indicates non-plastic soil (PI=0)

False
has_organic_fines bool

Indicates if the soil contains organic fines

False
moreno_alonso_plasticity_modification bool

Plasticity chart modification per Moreno & Alonso (2018)

False

Returns:

Name Type Description
uscs_symbol str

Unified Soil Classification System symbol

uscs_description str

Unified Soil Classification System description

get_symbol

get_symbol(
    fines_content,
    percent_sand,
    percent_gravel,
    liquid_limit: Any = float("nan"),
    plasticity_index: Any = float("nan"),
    uniformity_coefficient: Any = float("nan"),
    curvature_coefficient: Any = float("nan"),
    has_organic_fines=False,
    moreno_alonso_plasticity_modification=False,
)

Calculation function.

\[ \begin{array}{l} \mathbf{function} \ \mathrm{get\_symbol}(FC, \mathrm{percent\_sand}, \mathrm{percent\_gravel}, LL, PI, C_u, C_c, \mathrm{has\_organic\_fines}, \mathrm{moreno\_alonso\_plasticity\_modification}) \\ \hspace{1em} \mathbf{if} \ \mathrm{moreno\_alonso\_plasticity\_modification} \\ \hspace{2em} \mathopen{}\left( \mathrm{fine\_symbol}, \mathrm{fine\_type} \mathclose{}\right) \gets \mathrm{get\_fine\_symbol\_\_moreno2018clay} \mathopen{}\left( LL, PI \mathclose{}\right) \\ \hspace{1em} \mathbf{else} \\ \hspace{2em} \mathopen{}\left( \mathrm{fine\_symbol}, \mathrm{fine\_type} \mathclose{}\right) \gets \mathrm{get\_fine\_symbol} \mathopen{}\left( LL, PI, \mathrm{has\_organic\_fines} \mathclose{}\right) \\ \hspace{1em} \mathbf{end \ if} \\ \hspace{1em} \mathrm{condition\_1} \gets FC < 50 \\ \hspace{1em} \mathrm{symbol\_1} \gets \mathrm{get\_coarse\_symbol} \mathopen{}\left( FC, \mathrm{percent\_sand}, \mathrm{percent\_gravel}, \mathrm{fine\_type}, C_u, C_c \mathclose{}\right) \\ \hspace{1em} \mathrm{condition\_2} \gets FC \ge 50 \\ \hspace{1em} \mathrm{symbol\_2} \gets \mathrm{fine\_symbol} \\ \hspace{1em} \mathrm{symbol} \gets \mathrm{np}.\mathrm{select} \mathopen{}\left( \mathopen{}\left[ \mathrm{condition\_1}, \mathrm{condition\_2} \mathclose{}\right], \mathopen{}\left[ \mathrm{symbol\_1}, \mathrm{symbol\_2} \mathclose{}\right] \mathclose{}\right) \\ \hspace{1em} \mathbf{return} \ \mathopen{}\left( \mathrm{symbol}, \mathrm{fine\_type} \mathclose{}\right) \\ \mathbf{end \ function} \end{array} \]

Parameters:

Name Type Description Default
fines_content float

Percentage of fines passing No. 200 sieve

required
percent_sand float

Sand percentage (% passing No. 4 sieve)

required
percent_gravel float

Gravel percentage (% retained on No. 4 sieve)

required
liquid_limit float

Liquid limit of soil

float('nan')
plasticity_index float

Plasticity index of soil

float('nan')
uniformity_coefficient float

Uniformity coefficient for particle size distribution

float('nan')
curvature_coefficient float

Curvature coefficient for particle size distribution

float('nan')
has_organic_fines bool

Indicates if the soil contains organic fines

False
moreno_alonso_plasticity_modification bool

Plasticity chart modification per Moreno & Alonso (2018)

False

Returns:

Name Type Description
uscs_symbol str

Unified Soil Classification System symbol

fine_type str

Fine-grained soil type used internally for USCS classification