Soil lab
subsurfaceio.functions.soil_lab
Soil lab functions.
Functions:
get_a_parameter
Calculation function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
temperature
|
float
|
Temperature during testing |
required |
specific_gravity
|
float
|
Specific gravity of soil solids |
required |
Returns:
| Name | Type | Description |
|---|---|---|
a_parameter |
float
|
Hydrometer parameter dependent on temperature and specific gravity |
get_corrected_hydrometer_reading
Calculation function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hydrometer_reading
|
float
|
Hydrometer reading (151H: specific gravity, 152H: grams per liter) |
required |
temperature_correction
|
float
|
Correction for hydrometer test temperature (not 20°C) |
required |
zero_correction
|
float
|
Hydrometer zero correction for deflocculating agent |
required |
Returns:
| Name | Type | Description |
|---|---|---|
corrected_hydrometer_reading |
float
|
Corrected hydrometer reading for percent finer calculation |
get_cumulative_mass_retained
Calculation function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mass_retained_sieve
|
float
|
Mass of soil retained on each sieve |
required |
Returns:
| Name | Type | Description |
|---|---|---|
cumulative_mass_retained |
float
|
Cumulative mass of soil retained on sieves |
get_curvature_coefficient
get_curvature_coefficient(
diameter_at_10_percent_finer,
diameter_at_30_percent_finer,
diameter_at_60_percent_finer,
)
Calculation function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
diameter_at_10_percent_finer
|
float
|
Diameter at 10% finer from sieve analysis |
required |
diameter_at_30_percent_finer
|
float
|
Diameter at 30% finer from sieve analysis |
required |
diameter_at_60_percent_finer
|
float
|
Diameter at 60% finer from sieve analysis |
required |
Returns:
| Name | Type | Description |
|---|---|---|
curvature_coefficient |
float
|
Curvature coefficient for particle size distribution |
get_dry_soil_mass
Calculation function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
can_mass
|
float
|
Mass of soil sample can |
required |
can_plus_dry_soil_mass
|
float
|
Mass of soil sample can plus dry soil |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dry_soil_mass |
float
|
Dry soil mass in sample |
get_effective_length
Calculation function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
effective_length_corrected_reading
|
float
|
Corrected reading for effective length determination |
required |
hydrometer_type
|
str
|
Type of hydrometer used |
required |
Returns:
| Name | Type | Description |
|---|---|---|
effective_length |
float
|
Effective length for hydrometer particle size calculation |
get_effective_length_corrected_reading
Calculation function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hydrometer_reading
|
float
|
Hydrometer reading (151H: specific gravity, 152H: grams per liter) |
required |
meniscus_correction
|
float
|
Meniscus correction for hydrometer readings (always positive) |
required |
Returns:
| Name | Type | Description |
|---|---|---|
effective_length_corrected_reading |
float
|
Corrected reading for effective length determination |
get_hydrometer_percent_finer
Calculation function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
percent_finer_uncorrected
|
float
|
Uncorrected percentage finer from sieve analysis |
required |
fines_content
|
float
|
Percentage of fines passing No. 200 sieve |
required |
Returns:
| Name | Type | Description |
|---|---|---|
percent_finer |
float
|
Percentage of material finer than a given size |
get_liquid_limit
Calculation function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
liquid_limit_method
|
str
|
Method used for liquid limit determination |
required |
liquid_limit_blows
|
int
|
Number of blows in liquid limit test |
required |
water_content_trials
|
float
|
Natural water content for each trial |
required |
Returns:
| Name | Type | Description |
|---|---|---|
liquid_limit |
float
|
Liquid limit of soil |
flow_index |
float
|
Slope of liquid limit flow line |
get_liquidity_index
Calculation function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
water_content
|
float
|
Natural water content of soil |
required |
liquid_limit
|
float
|
Liquid limit of soil |
required |
plasticity_index
|
float
|
Plasticity index of soil |
required |
is_fine_soil
|
bool
|
Indicates if soil is fine-grained |
required |
Returns:
| Name | Type | Description |
|---|---|---|
liquidity_index |
float
|
Liquidity index of soil |
get_moisture_mass
Calculation function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
can_plus_wet_soil_mass
|
float
|
Mass of soil sample can plus wet soil |
required |
can_plus_dry_soil_mass
|
float
|
Mass of soil sample can plus dry soil |
required |
Returns:
| Name | Type | Description |
|---|---|---|
moisture_mass |
float
|
Mass of moisture in soil sample |
get_particle_size
Calculation function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
effective_length
|
float
|
Effective length for hydrometer particle size calculation |
required |
hydrometer_time
|
float
|
Elapsed time for hydrometer test |
required |
a_parameter
|
float
|
Hydrometer parameter dependent on temperature and specific gravity |
required |
Returns:
| Name | Type | Description |
|---|---|---|
particle_size |
float
|
Particle size from sieve or hydrometer analysis |
get_particle_size_from_sieve_number
Calculation function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sieve_number
|
str
|
Sieve number for particle size analysis (SI units) |
required |
Returns:
| Name | Type | Description |
|---|---|---|
particle_size |
float
|
Particle size from sieve or hydrometer analysis |
get_percent_clay
Calculation function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
particle_size
|
float
|
Particle size from sieve or hydrometer analysis |
required |
percent_finer
|
float
|
Percentage of material finer than a given size |
required |
silt_clay_particle_size_breakpoint
|
float
|
Breakpoint for silt and clay particle size |
0.005
|
Returns:
| Name | Type | Description |
|---|---|---|
percent_clay |
float
|
Clay percentage for USDA classification |
get_percent_finer
Calculation function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dry_soil_mass
|
float
|
Dry soil mass in sample |
required |
cumulative_mass_retained
|
float
|
Cumulative mass of soil retained on sieves |
required |
Returns:
| Name | Type | Description |
|---|---|---|
percent_finer |
float
|
Percentage of material finer than a given size |
get_percent_finer_at_sieve_number
Calculation function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sieve_number
|
str
|
Sieve number for particle size analysis (SI units) |
required |
percent_finer
|
float
|
Percentage of material finer than a given size |
required |
Returns:
| Name | Type | Description |
|---|---|---|
percent_passing_3in4 |
float
|
Percentage passing 3/4 " sieve |
percent_passing_no4 |
float
|
Percentage passing No. 4 sieve |
percent_passing_no10 |
float
|
Percentage passing No. 10 sieve |
percent_passing_no40 |
float
|
Percentage passing No. 40 sieve |
fines_content |
float
|
Percentage of fines passing No. 200 sieve |
get_percent_finer_diameters
get_percent_finer_diameters(
particle_size,
percent_finer,
fines_content,
extrapolate_max_percent_finer=None,
)
Calculation function.
$$ \begin{array}{l} \mathbf{function} \ \mathrm{get_percent_finer_diameters}(D, \mathrm{percent_finer}, FC, \mathrm{extrapolate_max_percent_finer}) \ \hspace{1em} \textrm{"Compute D60, D50, D30, and D10 from sieve data.
Each D-value is the particle size where the PSD polyline crosses the target
percent finer (see ``\_diameter\_at\_percent\_finer\_on\_polyline``). Segment-wise
crossing matches what is plotted and is required whenever plateaus exist;
deduplicating percent-finer values before inverse interpolation is incorrect.
"} \\ \hspace{1em} \mathrm{percent\_finer\_targets} \gets \mathrm{np}.\mathrm{asarray} \mathopen{}\left( \mathopen{}\left[ 60.0, 50.0, 30.0, 10.0 \mathclose{}\right] \mathclose{}\right) \\ \hspace{1em} \mathbf{if} \ \lnot \mathopen{}\left( FC \le 50 \mathclose{}\right) \\ \hspace{2em} \mathbf{return} \ \mathopen{}\left( \mathrm{np}.\mathrm{nan} \mathclose{}\right) \mathrm{len} \mathopen{}\left( \mathrm{percent\_finer\_targets} \mathclose{}\right) \\ \hspace{1em} \mathbf{end \ if} \\ \hspace{1em} \mathrm{percent\_finer} \gets \mathrm{np}.\mathrm{atleast\_1d} \mathopen{}\left( \mathrm{percent\_finer} \mathclose{}\right) \\ \hspace{1em} D \gets \mathrm{np}.\mathrm{atleast\_1d} \mathopen{}\left( D \mathclose{}\right) \\ \hspace{1em} \mathrm{diameters} \gets \mathrm{np}.\mathrm{array} \mathopen{}\left( \mathopen{}\left[ \mathrm{\_diameter\_at\_percent\_finer\_on\_polyline} \mathopen{}\left( D, \mathrm{percent\_finer}, \mathrm{target} \mathclose{}\right) \mid \mathrm{target} \in \mathrm{percent\_finer\_targets} \mathclose{}\right] \mathclose{}\right) \\ \hspace{1em} \mathrm{min\_percent\_finer} \gets \mathrm{np}.\mathrm{nanmin} \mathopen{}\left( \mathrm{percent\_finer} \mathclose{}\right) \\ \hspace{1em} \mathbf{if} \ \mathrm{extrapolate\_max\_percent\_finer} \not\equiv \mathrm{None} \land \mathrm{min\_percent\_finer} \le \mathrm{extrapolate\_max\_percent\_finer} \\ \hspace{2em} \mathrm{fine\_end\_miss} \gets \mathrm{np}.\mathrm{isnan} \mathopen{}\left( \mathrm{diameters} \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{percent\_finer\_targets} < \mathrm{min\_percent\_finer} \mathclose{}\right) \\ \hspace{2em} \mathbf{for} \ i \in \mathrm{np}.\mathrm{flatnonzero} \mathopen{}\left( \mathrm{fine\_end\_miss} \mathclose{}\right) \ \mathbf{do} \\ \hspace{3em} \mathrm{diameters}_{i} \gets \mathrm{\_extrapolate\_diameter\_below\_fine\_end} \mathopen{}\left( D, \mathrm{percent\_finer}, \mathrm{percent\_finer\_targets}_{i} \mathclose{}\right) \\ \hspace{2em} \mathbf{end \ for} \\ \hspace{1em} \mathbf{end \ if} \\ \hspace{1em} \mathbf{return} \ \mathrm{tuple} \mathopen{}\left( \mathrm{diameters} \mathclose{}\right) \\ \mathbf{end \ function} \end{array}
$$
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
particle_size
|
float
|
Particle size from sieve or hydrometer analysis |
required |
percent_finer
|
float
|
Percentage of material finer than a given size |
required |
fines_content
|
float
|
Percentage of fines passing No. 200 sieve |
required |
extrapolate_max_percent_finer
|
float
|
Maximum measured percent finer at which fine-end diameter extrapolation is allowed when resolving D-sizes (e.g. D10). None disables extrapolation. Typical near-miss value: 12. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
diameter_at_60_percent_finer |
float
|
Diameter at 60% finer from sieve analysis |
diameter_at_50_percent_finer |
float
|
Diameter at 50% finer from sieve analysis |
diameter_at_30_percent_finer |
float
|
Diameter at 30% finer from sieve analysis |
diameter_at_10_percent_finer |
float
|
Diameter at 10% finer from sieve analysis |
get_percent_finer_uncorrected
get_percent_finer_uncorrected(
corrected_hydrometer_reading,
dry_soil_mass,
specific_gravity_correction,
)
Calculation function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
corrected_hydrometer_reading
|
float
|
Corrected hydrometer reading for percent finer calculation |
required |
dry_soil_mass
|
float
|
Dry soil mass in sample |
required |
specific_gravity_correction
|
float
|
Correction for specific gravity (hydrometer calibrated for G_s = 2.65) |
required |
Returns:
| Name | Type | Description |
|---|---|---|
percent_finer_uncorrected |
float
|
Uncorrected percentage finer from sieve analysis |
get_percent_fraction
get_percent_fraction(
percent_passing_3in4,
percent_passing_no4,
percent_passing_no10,
percent_passing_no40,
fines_content,
)
Calculation function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
percent_passing_3in4
|
float
|
Percentage passing 3/4 " sieve |
required |
percent_passing_no4
|
float
|
Percentage passing No. 4 sieve |
required |
percent_passing_no10
|
float
|
Percentage passing No. 10 sieve |
required |
percent_passing_no40
|
float
|
Percentage passing No. 40 sieve |
required |
fines_content
|
float
|
Percentage of fines passing No. 200 sieve |
required |
Returns:
| Name | Type | Description |
|---|---|---|
percent_gravel |
float
|
Gravel percentage (% retained on No. 4 sieve) |
percent_coarse_gravel |
float
|
Coarse gravel percentage (% retained on 3/4 " sieve) |
percent_fine_gravel |
float
|
Fine gravel percentage (% passing 3/4 " sieve, retained on No. 4) |
percent_sand |
float
|
Sand percentage (% passing No. 4 sieve) |
percent_coarse_sand |
float
|
Coarse sand percentage (% passing No. 4 sieve, retained on No. 10) |
percent_medium_sand |
float
|
Medium sand percentage (% passing No. 10 sieve, retained on No. 40) |
percent_fine_sand |
float
|
Fine sand percentage (% passing No. 40 sieve, retained on No. 200) |
get_percent_passing_at_standard_sieves
Calculation function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
particle_size
|
float
|
Particle size from sieve or hydrometer analysis |
required |
percent_finer
|
float
|
Percentage of material finer than a given size |
required |
Returns:
| Name | Type | Description |
|---|---|---|
percent_passing_3in4 |
float
|
Percentage passing 3/4 " sieve |
percent_passing_no4 |
float
|
Percentage passing No. 4 sieve |
percent_passing_no10 |
float
|
Percentage passing No. 10 sieve |
percent_passing_no40 |
float
|
Percentage passing No. 40 sieve |
fines_content |
float
|
Percentage of fines passing No. 200 sieve |
get_percent_silt
Calculation function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fines_content
|
float
|
Percentage of fines passing No. 200 sieve |
required |
percent_clay
|
float
|
Clay percentage for USDA classification |
required |
Returns:
| Name | Type | Description |
|---|---|---|
percent_silt |
float
|
Silt percentage for USDA classification |
get_plastic_limit
Calculation function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
water_content_trials
|
float
|
Natural water content for each trial |
required |
Returns:
| Name | Type | Description |
|---|---|---|
plastic_limit |
float
|
Plastic limit of soil |
get_plasticity_index
Calculation function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
liquid_limit
|
float
|
Liquid limit of soil |
required |
plastic_limit
|
float
|
Plastic limit of soil |
required |
Returns:
| Name | Type | Description |
|---|---|---|
plasticity_index |
float
|
Plasticity index of soil |
get_specific_gravity_correction
Calculation function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
specific_gravity
|
float
|
Specific gravity of soil solids |
required |
Returns:
| Name | Type | Description |
|---|---|---|
specific_gravity_correction |
float
|
Correction for specific gravity (hydrometer calibrated for G_s = 2.65) |
get_temperature_correction
Calculation function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
temperature
|
float
|
Temperature during testing |
required |
Returns:
| Name | Type | Description |
|---|---|---|
temperature_correction |
float
|
Correction for hydrometer test temperature (not 20°C) |
get_uniformity_coefficient
Calculation function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
diameter_at_10_percent_finer
|
float
|
Diameter at 10% finer from sieve analysis |
required |
diameter_at_60_percent_finer
|
float
|
Diameter at 60% finer from sieve analysis |
required |
Returns:
| Name | Type | Description |
|---|---|---|
uniformity_coefficient |
float
|
Uniformity coefficient for particle size distribution |
get_water_content
Calculation function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
water_content_trials
|
float
|
Natural water content for each trial |
required |
Returns:
| Name | Type | Description |
|---|---|---|
water_content |
float
|
Natural water content of soil |
get_water_content_liquid_limit_ratio
Calculation function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
water_content
|
float
|
Natural water content of soil |
required |
liquid_limit
|
float
|
Liquid limit of soil |
required |
Returns:
| Name | Type | Description |
|---|---|---|
water_content_liquid_limit_ratio |
float
|
Ratio of water content to liquid limit |
get_water_content_trials
Calculation function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
moisture_mass
|
float
|
Mass of moisture in soil sample |
required |
dry_soil_mass
|
float
|
Dry soil mass in sample |
required |
Returns:
| Name | Type | Description |
|---|---|---|
water_content_trials |
float
|
Natural water content for each trial |