Skip to content

soil_classification.py

subsurfaceio.functions.soil_classification

Soil classification functions.

Classes:

Name Description
ReferenceFigureRegistry

Pre-instantiated reference figures

Functions:

Name Description
get_a_line_position

Calculation function.

get_aashto_group_index

Calculation function.

get_aashto_symbol_coarse

Calculation function.

get_aashto_symbol_fine

Calculation function.

get_coarse_graded_symbol

Calculation function.

get_coarse_group_symbol

Calculation function.

get_soil_classification__usda1993soil

Calculation function.

get_soil_classification_aashto__astm2015d3282

Calculation function.

get_soil_classification_uscs__astm2017d2487

Calculation function.

get_soil_classification_uscs_coarse__astm2017d2487

Calculation function.

get_soil_classification_uscs_fine__astm2017d2487

Calculation function.

get_soil_classification_usda__moreno2018clay

Calculation function.

ReferenceFigureRegistry

Pre-instantiated reference figures

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_aashto_group_index

get_aashto_group_index(
    aashto_symbol,
    fines_content,
    plasticity_index,
    liquid_limit,
    non_plastic,
)

Calculation function.

\[ \begin{array}{l} \mathbf{function} \ \mathrm{get\_aashto\_group\_index}(\mathrm{aashto\_symbol}, FC, PI, LL, NP) \\ \hspace{1em} \textrm{"Values are rounded to nearest integer, with 0.5 rounding up to 1"} \\ \hspace{1em} PI \gets \mathrm{np}.\mathrm{where} \mathopen{}\left( NP, 0, PI \mathclose{}\right) \\ \hspace{1em} \mathrm{condition\_1} \gets \mathrm{np}.\mathrm{isin} \mathopen{}\left( \mathrm{aashto\_symbol}, \mathopen{}\left[ \textrm{"A-1-a"}, \textrm{"A-1-b"}, \textrm{"A-3"}, \textrm{"A-2-4"}, \textrm{"A-2-5"} \mathclose{}\right] \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_1} \gets 0 \\ \hspace{1em} \mathrm{condition\_2} \gets \mathopen{}\left( PI = 0 \mathclose{}\right) \mathbin{\&} \mathrm{np}.\mathrm{isnan} \mathopen{}\left( LL \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_2} \gets 0 \\ \hspace{1em} \mathrm{group\_index\_plasticity\_index\_portion} \gets 0.01 \mathopen{}\left( FC - 15 \mathclose{}\right) \mathopen{}\left( PI - 10 \mathclose{}\right) \\ \hspace{1em} \mathrm{condition\_3} \gets \mathrm{np}.\mathrm{isin} \mathopen{}\left( \mathrm{aashto\_symbol}, \mathopen{}\left[ \textrm{"A-2-6"}, \textrm{"A-2-7"} \mathclose{}\right] \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_3} \gets \mathrm{group\_index\_plasticity\_index\_portion} \\ \hspace{1em} \mathrm{default} \gets \mathopen{}\left( FC - 35 \mathclose{}\right) \mathopen{}\left( 0.2 + 0.005 \mathopen{}\left( LL - 40 \mathclose{}\right) \mathclose{}\right) + \mathrm{group\_index\_plasticity\_index\_portion} \\ \hspace{1em} \mathrm{group\_index} \gets \mathrm{np}.\mathrm{select} \mathopen{}\left( \mathopen{}\left[ \mathrm{condition\_1}, \mathrm{condition\_2}, \mathrm{condition\_3} \mathclose{}\right], \mathopen{}\left[ \mathrm{choice\_1}, \mathrm{choice\_2}, \mathrm{choice\_3} \mathclose{}\right] \mathclose{}\right) \\ \hspace{1em} \mathrm{group\_index} \gets \mathrm{np}.\mathrm{clip} \mathopen{}\left( \mathrm{group\_index}, 0, \mathrm{None} \mathclose{}\right) \\ \hspace{1em} \mathrm{group\_index} \gets \mathopen{}\left\lceil \mathrm{group\_index} - 0.5 \mathclose{}\right\rceil \\ \hspace{1em} \mathbf{return} \ \mathrm{group\_index} \\ \mathbf{end \ function} \end{array} \]

Parameters:

Name Type Description Default
aashto_symbol str

AASHTO classification system symbol

required
fines_content float

Percentage of fines passing No. 200 sieve

required
plasticity_index float

Plasticity index of soil

required
liquid_limit float

Liquid limit of soil

required
non_plastic bool

Indicates non-plastic soil (PI=0)

required

Returns:

Name Type Description
aashto_group_index int

AASHTO classification system group index

get_aashto_symbol_coarse

get_aashto_symbol_coarse(
    fines_content,
    percent_passing_no10,
    percent_passing_no40,
    liquid_limit,
    plasticity_index,
    non_plastic,
)

Calculation function.

\[ \begin{array}{l} \mathbf{function} \ \mathrm{get\_aashto\_symbol\_coarse}(FC, P_{10}, P_{40}, LL, PI, NP) \\ \hspace{1em} PI \gets \mathrm{np}.\mathrm{where} \mathopen{}\left( NP, 0, PI \mathclose{}\right) \\ \hspace{1em} \mathrm{condition\_1} \gets \mathopen{}\left( P_{10} \le 50 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( P_{40} \le 30 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( FC \le 15 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( PI \le 6 \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_1} \gets \textrm{"A-1-a"} \\ \hspace{1em} \mathrm{condition\_2} \gets \mathopen{}\left( P_{40} \le 50 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( FC \le 25 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( PI \le 6 \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_2} \gets \textrm{"A-1-b"} \\ \hspace{1em} \mathrm{condition\_3} \gets \mathopen{}\left( P_{40} > 50 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( FC \le 10 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( PI = 0 \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_3} \gets \textrm{"A-3"} \\ \hspace{1em} \mathrm{condition\_4} \gets \mathopen{}\left( LL \le 40 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( PI \le 10 \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_4} \gets \textrm{"A-2-4"} \\ \hspace{1em} \mathrm{condition\_5} \gets \mathopen{}\left( LL > 40 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( PI \le 10 \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_5} \gets \textrm{"A-2-5"} \\ \hspace{1em} \mathrm{condition\_6} \gets \mathopen{}\left( LL \le 40 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( PI > 10 \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_6} \gets \textrm{"A-2-6"} \\ \hspace{1em} \mathrm{condition\_7} \gets \mathopen{}\left( LL > 40 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( PI > 10 \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_7} \gets \textrm{"A-2-7"} \\ \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} \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} \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_passing_no10 float

Percentage passing No. 10 sieve

required
percent_passing_no40 float

Percentage passing No. 40 sieve

required
liquid_limit float

Liquid limit of soil

required
plasticity_index float

Plasticity index of soil

required
non_plastic bool

Indicates non-plastic soil (PI=0)

required

Returns:

Name Type Description
aashto_symbol str

AASHTO classification system symbol

get_aashto_symbol_fine

get_aashto_symbol_fine(plasticity_index, liquid_limit)

Calculation function.

\[ \begin{array}{l} \mathbf{function} \ \mathrm{get\_aashto\_symbol\_fine}(PI, LL) \\ \hspace{1em} \mathrm{condition\_1} \gets \mathopen{}\left( LL \le 40 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( PI \le 10 \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_1} \gets \textrm{"A-4"} \\ \hspace{1em} \mathrm{condition\_2} \gets \mathopen{}\left( LL > 40 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( PI \le 10 \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_2} \gets \textrm{"A-5"} \\ \hspace{1em} \mathrm{condition\_3} \gets \mathopen{}\left( LL \le 40 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( PI > 10 \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_3} \gets \textrm{"A-6"} \\ \hspace{1em} \mathrm{condition\_4} \gets \mathopen{}\left( LL > 40 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( PI > 10 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( PI \le LL - 30 \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_4} \gets \textrm{"A-7-5"} \\ \hspace{1em} \mathrm{condition\_5} \gets \mathopen{}\left( LL > 40 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( PI > 10 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( PI > LL - 30 \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_5} \gets \textrm{"A-7-6"} \\ \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} \mathclose{}\right], \mathopen{}\left[ \mathrm{choice\_1}, \mathrm{choice\_2}, \mathrm{choice\_3}, \mathrm{choice\_4}, \mathrm{choice\_5} \mathclose{}\right] \mathclose{}\right) \\ \hspace{1em} \mathbf{return} \ \mathrm{symbol} \\ \mathbf{end \ function} \end{array} \]

Parameters:

Name Type Description Default
plasticity_index float

Plasticity index of soil

required
liquid_limit float

Liquid limit of soil

required

Returns:

Name Type Description
aashto_symbol str

AASHTO classification system symbol

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( C_u < 4 \mathclose{}\right) \mathbin{|} \mathopen{}\left( 1 > C_c \mathclose{}\right) \mathbin{|} \mathopen{}\left( C_c > 3 \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( C_u < 6 \mathclose{}\right) \mathbin{|} \mathopen{}\left( 1 > C_c \mathclose{}\right) \mathbin{|} \mathopen{}\left( C_c > 3 \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_soil_classification__usda1993soil

get_soil_classification__usda1993soil(
    language, percent_sand, percent_clay
)

Calculation function.

\[ \begin{array}{l} \mathbf{function} \ \mathrm{get\_soil\_classification\_\_usda1993soil}(\mathrm{language}, \mathrm{percent\_sand}, \mathrm{percent\_clay}) \\ \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} \mathbf{if} \ \mathrm{np}.\mathrm{any} \mathopen{}\left( \mathrm{percent\_sand} + \mathrm{percent\_clay} > 100 \mathclose{}\right) \\ \hspace{2em} \mathrm{raise\_value\_error} \mathopen{}\left( \textrm{"Sum of sand \& clay \% can't be > 100\%"} \mathclose{}\right) \\ \hspace{1em} \mathbf{end \ if} \\ \hspace{1em} \mathrm{percent\_silt} \gets 100 - \mathrm{percent\_sand} - \mathrm{percent\_clay} \\ \hspace{1em} \mathrm{condition\_1} \gets \mathrm{percent\_silt} + 1.5 \mathrm{percent\_clay} < 15 \\ \hspace{1em} \mathrm{choice\_1} \gets \textrm{"Sa"} \\ \hspace{1em} \mathrm{condition\_2} \gets \mathopen{}\left( \mathrm{percent\_silt} + 1.5 \mathrm{percent\_clay} \ge 15 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{percent\_silt} + 2 \mathrm{percent\_clay} < 30 \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_2} \gets \textrm{"LoSa"} \\ \hspace{1em} \mathrm{condition\_3} \gets \mathopen{}\left( 7 \le \mathrm{percent\_clay} \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{percent\_clay} < 20 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{percent\_sand} > 52 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{percent\_silt} + 2 \mathrm{percent\_clay} \ge 30 \mathclose{}\right) \mathbin{|} \mathopen{}\left( \mathrm{percent\_clay} < 7 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{percent\_silt} < 50 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{percent\_silt} + 2 \mathrm{percent\_clay} \ge 30 \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_3} \gets \textrm{"SaLo"} \\ \hspace{1em} \mathrm{condition\_4} \gets \mathopen{}\left( 7 \le \mathrm{percent\_clay} \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{percent\_clay} < 27 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( 28 \le \mathrm{percent\_silt} \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{percent\_silt} < 50 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{percent\_sand} \le 52 \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_4} \gets \textrm{"Lo"} \\ \hspace{1em} \mathrm{condition\_5} \gets \mathopen{}\left( \mathrm{percent\_silt} \ge 50 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( 12 \le \mathrm{percent\_clay} \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{percent\_clay} < 27 \mathclose{}\right) \mathbin{|} \mathopen{}\left( 50 \le \mathrm{percent\_silt} \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{percent\_silt} < 80 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{percent\_clay} < 12 \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_5} \gets \textrm{"SiLo"} \\ \hspace{1em} \mathrm{condition\_6} \gets \mathopen{}\left( \mathrm{percent\_silt} \ge 80 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{percent\_clay} < 12 \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_6} \gets \textrm{"Si"} \\ \hspace{1em} \mathrm{condition\_7} \gets \mathopen{}\left( 20 \le \mathrm{percent\_clay} \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{percent\_clay} < 35 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{percent\_silt} < 28 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{percent\_sand} > 45 \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_7} \gets \textrm{"SaClLo"} \\ \hspace{1em} \mathrm{condition\_8} \gets \mathopen{}\left( 27 \le \mathrm{percent\_clay} \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{percent\_clay} < 40 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( 20 < \mathrm{percent\_sand} \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{percent\_sand} \le 45 \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_8} \gets \textrm{"ClLo"} \\ \hspace{1em} \mathrm{condition\_9} \gets \mathopen{}\left( 27 \le \mathrm{percent\_clay} \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{percent\_clay} < 40 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{percent\_sand} \le 20 \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_9} \gets \textrm{"SiClLo"} \\ \hspace{1em} \mathrm{condition\_10} \gets \mathopen{}\left( \mathrm{percent\_clay} \ge 35 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{percent\_sand} > 45 \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_10} \gets \textrm{"SaCl"} \\ \hspace{1em} \mathrm{condition\_11} \gets \mathopen{}\left( \mathrm{percent\_clay} \ge 40 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{percent\_silt} \ge 40 \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_11} \gets \textrm{"SiCl"} \\ \hspace{1em} \mathrm{condition\_12} \gets \mathopen{}\left( \mathrm{percent\_clay} \ge 40 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( 40 > \mathrm{percent\_silt} \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{percent\_sand} \le 45 \mathclose{}\right) \\ \hspace{1em} \mathrm{choice\_12} \gets \textrm{"Cl"} \\ \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}, \mathrm{condition\_10}, \mathrm{condition\_11}, \mathrm{condition\_12} \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}, \mathrm{choice\_10}, \mathrm{choice\_11}, \mathrm{choice\_12} \mathclose{}\right] \mathclose{}\right) \\ \hspace{1em} \mathrm{description} \gets \mathrm{replace\_from\_mapping} \mathopen{}\left( \mathrm{symbol}, \mathrm{symbology} \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
percent_sand float

Sand percentage (% passing No. 4 sieve)

required
percent_clay float

Clay percentage for USDA classification

required

Returns:

Name Type Description
usda_symbol str

USDA soil classification symbol

usda_description str

USDA soil classification description

get_soil_classification_aashto__astm2015d3282

get_soil_classification_aashto__astm2015d3282(
    language,
    fines_content,
    percent_passing_no10: Any = float("nan"),
    percent_passing_no40: Any = float("nan"),
    liquid_limit: Any = float("nan"),
    plasticity_index: Any = float("nan"),
    non_plastic=False,
)

Calculation function.

\[ \begin{array}{l} \mathbf{function} \ \mathrm{get\_soil\_classification\_aashto\_\_astm2015d3282}(\mathrm{language}, FC, P_{10}, P_{40}, LL, PI, NP) \\ \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} PI \gets \mathrm{np}.\mathrm{where} \mathopen{}\left( NP, 0, PI \mathclose{}\right) \\ \hspace{1em} \mathrm{condition\_1} \gets FC \le 35 \\ \hspace{1em} \mathrm{choice\_1} \gets \mathrm{get\_aashto\_symbol\_coarse} \mathopen{}\left( FC, P_{10}, P_{40}, LL, PI, NP \mathclose{}\right) \\ \hspace{1em} \mathrm{condition\_2} \gets FC > 35 \\ \hspace{1em} \mathrm{choice\_2} \gets \mathrm{get\_aashto\_symbol\_fine} \mathopen{}\left( PI, LL \mathclose{}\right) \\ \hspace{1em} \mathrm{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} \mathrm{description} \gets \mathrm{replace\_from\_mapping} \mathopen{}\left( \mathrm{symbol}, \mathrm{symbology} \mathclose{}\right) \\ \hspace{1em} \mathrm{group\_index} \gets \mathrm{get\_aashto\_group\_index} \mathopen{}\left( \mathrm{symbol}, FC, PI, LL, NP \mathclose{}\right) \\ \hspace{1em} \mathbf{return} \ \mathopen{}\left( \mathrm{symbol}, \mathrm{group\_index}, \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_passing_no10 float

Percentage passing No. 10 sieve

float('nan')
percent_passing_no40 float

Percentage passing No. 40 sieve

float('nan')
liquid_limit float

Liquid limit of soil

float('nan')
plasticity_index float

Plasticity index of soil

float('nan')
non_plastic bool

Indicates non-plastic soil (PI=0)

False

Returns:

Name Type Description
aashto_symbol str

AASHTO classification system symbol

aashto_group_index int

AASHTO classification system group index

aashto_description str

AASHTO classification system description

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,
    moreno_alonso_plasticity_modification=False,
    has_organic_fines=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{moreno\_alonso\_plasticity\_modification}, \mathrm{has\_organic\_fines}) \\ \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} \mathrm{condition\_1} \gets FC < 50 \\ \hspace{1em} \mathopen{}\left( \mathrm{symbol\_1}, \mathrm{description\_1} \mathclose{}\right) \gets \mathrm{get\_soil\_classification\_uscs\_coarse\_\_astm2017d2487} \mathopen{}\left( \mathrm{language}, FC, \mathrm{percent\_sand}, \mathrm{percent\_gravel}, C_u, C_c, LL, PI, \mathrm{moreno\_alonso\_plasticity\_modification}, \mathrm{has\_organic\_fines} \mathclose{}\right) \\ \hspace{1em} \mathrm{condition\_2} \gets FC \ge 50 \\ \hspace{1em} \mathopen{}\left( \mathrm{symbol\_2}, \mathrm{description\_2} \mathclose{}\right) \gets \mathrm{get\_soil\_classification\_uscs\_fine\_\_astm2017d2487} \mathopen{}\left( \mathrm{language}, LL, PI, \mathrm{percent\_sand}, \mathrm{percent\_gravel}, \mathrm{has\_organic\_fines}, \mathrm{moreno\_alonso\_plasticity\_modification} \mathclose{}\right) \\ \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} \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} \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
moreno_alonso_plasticity_modification bool

Plasticity chart modification per Moreno & Alonso (2018)

False
has_organic_fines bool

Indicates if the soil contains organic fines

False

Returns:

Name Type Description
uscs_symbol str

Unified Soil Classification System symbol

uscs_description str

Unified Soil Classification System description

get_soil_classification_uscs_coarse__astm2017d2487

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

Calculation function.

\[ \begin{array}{l} \mathbf{function} \ \mathrm{get\_soil\_classification\_uscs\_coarse\_\_astm2017d2487}(\mathrm{language}, FC, \mathrm{percent\_sand}, \mathrm{percent\_gravel}, C_u, C_c, LL, PI, \mathrm{moreno\_alonso\_plasticity\_modification}, \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{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} \mathopen{}\left( \mathrm{fine\_symbol}, \mathrm{fine\_description} \mathclose{}\right) \gets \mathrm{get\_soil\_classification\_uscs\_fine\_\_astm2017d2487} \mathopen{}\left( \mathrm{language}, LL, PI, \mathrm{percent\_sand}, \mathrm{percent\_gravel}, \mathrm{False}, \mathrm{moreno\_alonso\_plasticity\_modification} \mathclose{}\right) \\ \hspace{1em} \mathrm{is\_silt} \gets \mathrm{np}.\mathrm{isin} \mathopen{}\left( \mathrm{fine\_symbol}, \mathopen{}\left[ \textrm{"ML"}, \textrm{"MH"} \mathclose{}\right] \mathclose{}\right) \\ \hspace{1em} \mathrm{is\_clay} \gets \mathrm{np}.\mathrm{isin} \mathopen{}\left( \mathrm{fine\_symbol}, \mathopen{}\left[ \textrm{"CL"}, \textrm{"CH"} \mathclose{}\right] \mathclose{}\right) \\ \hspace{1em} \mathrm{is\_dual} \gets \mathrm{np}.\mathrm{isin} \mathopen{}\left( \mathrm{fine\_symbol}, \mathopen{}\left[ \textrm{"CL-ML"}, \textrm{"CH-MH"} \mathclose{}\right] \mathclose{}\right) \\ \hspace{1em} \mathrm{condition\_1} \gets FC < 5 \\ \hspace{1em} \mathrm{choice\_1} \gets \mathrm{group\_symbol} + \mathrm{graded\_symbol} \\ \hspace{1em} \mathrm{condition\_2} \gets \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 \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 \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 \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 \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{description} \gets \mathrm{replace\_from\_mapping} \mathopen{}\left( \mathrm{symbol}, \mathrm{symbology} \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{group\_symbol} = \textrm{"G"} \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{percent\_sand} \ge 15 \mathclose{}\right), \mathopen{}\left( \mathrm{group\_symbol} = \textrm{"S"} \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} \mathrm{description} \gets \mathrm{np}.\mathrm{strings}.\mathrm{capitalize} \mathopen{}\left( \mathrm{description} \mathclose{}\right) \\ \hspace{1em} \mathrm{is\_valid} \gets \mathrm{np}.\mathrm{isin} \mathopen{}\left( \mathrm{symbol}, \mathrm{get\_args} \mathopen{}\left( \mathrm{Literals}.\mathrm{USCSSymbol} \mathclose{}\right) \mathclose{}\right) \\ \hspace{1em} \mathrm{np}.\mathrm{putmask} \mathopen{}\left( \mathrm{symbol}, \mathord{\sim} \mathrm{is\_valid}, \mathrm{STRING\_DTYPE\_NA} \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
uniformity_coefficient float

Uniformity coefficient for particle size distribution

float('nan')
curvature_coefficient float

Curvature coefficient for particle size distribution

float('nan')
liquid_limit float

Liquid limit of soil

float('nan')
plasticity_index float

Plasticity index of soil

float('nan')
moreno_alonso_plasticity_modification bool

Plasticity chart modification per Moreno & Alonso (2018)

False
has_organic_fines bool

Indicates if the soil contains organic fines

False

Returns:

Name Type Description
uscs_symbol str

Unified Soil Classification System symbol

uscs_description str

Unified Soil Classification System description

get_soil_classification_uscs_fine__astm2017d2487

get_soil_classification_uscs_fine__astm2017d2487(
    language,
    liquid_limit,
    plasticity_index,
    percent_sand,
    percent_gravel,
    has_organic_fines=False,
    moreno_alonso_plasticity_modification=False,
)

Calculation function.

\[ \begin{array}{l} \mathbf{function} \ \mathrm{get\_soil\_classification\_uscs\_fine\_\_astm2017d2487}(\mathrm{language}, LL, PI, \mathrm{percent\_sand}, \mathrm{percent\_gravel}, \mathrm{has\_organic\_fines}, \mathrm{moreno\_alonso\_plasticity\_modification}) \\ \hspace{1em} \mathrm{has\_organic\_fines} \gets \mathrm{np}.\mathrm{asarray} \mathopen{}\left( \mathrm{has\_organic\_fines} \mathclose{}\right) \\ \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} \mathbf{if} \ \mathrm{moreno\_alonso\_plasticity\_modification} \\ \hspace{2em} \mathrm{c\_line\_value} \gets \frac{LL}{2} \\ \hspace{2em} \mathrm{m\_line\_value} \gets \frac{LL}{3} \\ \hspace{2em} \mathrm{condition\_1} \gets \mathopen{}\left( LL < 50 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( PI > \mathrm{c\_line\_value} \mathclose{}\right) \\ \hspace{2em} \mathrm{choice\_1} \gets \textrm{"CL"} \\ \hspace{2em} \mathrm{condition\_2} \gets \mathopen{}\left( LL < 50 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( PI > \mathrm{m\_line\_value} \mathclose{}\right) \\ \hspace{2em} \mathrm{choice\_2} \gets \textrm{"CL-ML"} \\ \hspace{2em} \mathrm{condition\_3} \gets \mathopen{}\left( LL < 50 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( PI \le \mathrm{m\_line\_value} \mathclose{}\right) \\ \hspace{2em} \mathrm{choice\_3} \gets \textrm{"ML"} \\ \hspace{2em} \mathrm{condition\_4} \gets \mathopen{}\left( LL \ge 50 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( PI > \mathrm{c\_line\_value} \mathclose{}\right) \\ \hspace{2em} \mathrm{choice\_4} \gets \textrm{"CH"} \\ \hspace{2em} \mathrm{condition\_5} \gets \mathopen{}\left( LL \ge 50 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( PI > \mathrm{m\_line\_value} \mathclose{}\right) \\ \hspace{2em} \mathrm{choice\_5} \gets \textrm{"CH-MH"} \\ \hspace{2em} \mathrm{condition\_6} \gets \mathopen{}\left( LL \ge 50 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( PI \le \mathrm{m\_line\_value} \mathclose{}\right) \\ \hspace{2em} \mathrm{choice\_6} \gets \textrm{"MH"} \\ \hspace{2em} \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} \mathbf{else} \\ \hspace{2em} \mathrm{a\_line\_position} \gets \mathrm{get\_a\_line\_position} \mathopen{}\left( LL, PI \mathclose{}\right) \\ \hspace{2em} \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{2em} \mathrm{choice\_1} \gets \textrm{"CL"} \\ \hspace{2em} \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{2em} \mathrm{choice\_2} \gets \textrm{"CL-ML"} \\ \hspace{2em} \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{2em} \mathrm{choice\_3} \gets \textrm{"ML"} \\ \hspace{2em} \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{2em} \mathrm{choice\_4} \gets \textrm{"OL-c"} \\ \hspace{2em} \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{2em} \mathrm{choice\_5} \gets \textrm{"OL-m"} \\ \hspace{2em} \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{2em} \mathrm{choice\_6} \gets \textrm{"CH"} \\ \hspace{2em} \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{2em} \mathrm{choice\_7} \gets \textrm{"MH"} \\ \hspace{2em} \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{2em} \mathrm{choice\_8} \gets \textrm{"OH-c"} \\ \hspace{2em} \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{2em} \mathrm{choice\_9} \gets \textrm{"OH-m"} \\ \hspace{2em} \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} \mathbf{end \ if} \\ \hspace{1em} \mathrm{description} \gets \mathrm{replace\_from\_mapping} \mathopen{}\left( \mathrm{symbol}, \mathrm{symbology} \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{symbol}, \mathopen{}\left[ \textrm{"ML"}, \textrm{"MH"}, \textrm{"OL-m"}, \textrm{"OH-m"} \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} \mathrm{symbol} \gets \mathrm{symbol}.\mathrm{astype} \mathopen{}\left( \mathrm{np}.\mathrm{dtypes}.\mathrm{StringDType} \mathopen{}\left( \mathclose{}\right) \mathclose{}\right) \\ \hspace{1em} \mathrm{is\_valid} \gets \mathrm{symbol} \ne \mathrm{STRING\_DTYPE\_NA} \\ \hspace{1em} \mathrm{symbol}_{\mathrm{is\_valid}} \gets \mathrm{np}.\mathrm{strings}.\mathrm{replace} \mathopen{}\left( \mathrm{symbol}_{\mathrm{is\_valid}}, \textrm{"-m"}, \textrm{""} \mathclose{}\right) \\ \hspace{1em} \mathrm{symbol}_{\mathrm{is\_valid}} \gets \mathrm{np}.\mathrm{strings}.\mathrm{replace} \mathopen{}\left( \mathrm{symbol}_{\mathrm{is\_valid}}, \textrm{"-c"}, \textrm{""} \mathclose{}\right) \\ \hspace{1em} \mathrm{symbol} \gets \mathrm{symbol}.\mathrm{astype} \mathopen{}\left( \mathrm{object} \mathclose{}\right) \\ \hspace{1em} \mathrm{description} \gets \mathrm{np}.\mathrm{strings}.\mathrm{capitalize} \mathopen{}\left( \mathrm{description} \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
liquid_limit float

Liquid limit of soil

required
plasticity_index float

Plasticity index of soil

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

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_soil_classification_usda__moreno2018clay

get_soil_classification_usda__moreno2018clay(
    language,
    percent_sand,
    liquid_limit,
    plasticity_index,
    non_plastic=False,
)

Calculation function.

\[ \begin{array}{l} \mathbf{function} \ \mathrm{get\_soil\_classification\_usda\_\_moreno2018clay}(\mathrm{language}, \mathrm{percent\_sand}, LL, PI, NP) \\ \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} PI \gets \mathrm{np}.\mathrm{where} \mathopen{}\left( NP, 0, PI \mathclose{}\right) \\ \hspace{1em} \mathrm{symbol} \gets \mathrm{ReferenceFigureRegistry}.\mathrm{USDAMoreno2018Chart}.\mathrm{assign\_polygons\_labels\_from\_xy\_data} \mathopen{}\left( \mathrm{percent\_sand}, \mathrm{np}.\mathrm{clip} \mathopen{}\left( \frac{PI}{LL}, 0.0001, 1 \mathclose{}\right) \mathclose{}\right) \\ \hspace{1em} \mathrm{description} \gets \mathrm{replace\_from\_mapping} \mathopen{}\left( \mathrm{symbol}, \mathrm{symbology} \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
percent_sand float

Sand percentage (% passing No. 4 sieve)

required
liquid_limit float

Liquid limit of soil

required
plasticity_index float

Plasticity index of soil

required
non_plastic bool

Indicates non-plastic soil (PI=0)

False

Returns:

Name Type Description
usda_symbol str

USDA soil classification symbol

usda_description str

USDA soil classification description