soil_classification_usda.py
subsurfaceio.functions.soil_classification_usda
Soil classification functions.
Classes:
| Name | Description |
|---|---|
ReferenceFigureRegistry |
Pre-instantiated reference figures |
Functions:
| Name | Description |
|---|---|
get_soil_classification__usda1993soil |
Calculation function. |
get_soil_classification_usda__moreno2018clay |
Calculation function. |
ReferenceFigureRegistry
Pre-instantiated reference figures
get_soil_classification__usda1993soil
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_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 |