Skip to content

site_class.py

subsurfaceio.functions.site_class

Site class functions.

Functions:

Name Description
get_average_blow_count

Calculation function.

get_average_shear_velocity

Calculation function.

get_average_undrained_shear_strength

Calculation function.

get_site_class

Calculation function.

get_site_class_average

Calculation function.

get_site_class_average_blow_count

Calculation function.

get_site_class_average_shear_velocity

Calculation function.

get_site_class_average_undrained_shear_strength

Calculation function.

get_site_class_label

Calculation function.

get_site_period

Calculation function.

get_average_blow_count

get_average_blow_count(
    depth,
    blow_count,
    average_top_depth=0.0,
    average_bottom_depth=30.0,
)

Calculation function.

\[ \begin{array}{l} \mathbf{function} \ \mathrm{get\_average\_blow\_count}(z, N, z_{top}, z_{bottom}) \\ \hspace{1em} N \gets \mathrm{np}.\mathrm{clip} \mathopen{}\left( N, \mathrm{None}, 100 \mathclose{}\right) \\ \hspace{1em} N_{30} \gets \mathrm{get\_site\_class\_average} \mathopen{}\left( N, z, z_{top}, z_{bottom} \mathclose{}\right) \\ \hspace{1em} \mathbf{return} \ N_{30} \\ \mathbf{end \ function} \end{array} \]

Parameters:

Name Type Description Default
depth float

Depth below ground surface to bottom of layer

required
blow_count float

SPT measured blow count

required
average_top_depth float

Special average top depth

0.0
average_bottom_depth float

Special average bottom depth

30.0

Returns:

Name Type Description
average_blow_count float

Average SPT blow count to 30 m depth

get_average_shear_velocity

get_average_shear_velocity(
    depth,
    shear_velocity,
    average_top_depth=0.0,
    average_bottom_depth=30.0,
    shallow_velocity_extrapolation_method=None,
)

Calculation function.

\[ \begin{array}{l} \mathbf{function} \ \mathrm{get\_average\_shear\_velocity}(z, V_s, z_{top}, z_{bottom}, \mathrm{shallow\_velocity\_extrapolation\_method}) \\ \hspace{1em} \mathrm{valid\_flag} \gets \mathord{\sim} \mathopen{}\left( \mathrm{np}.\mathrm{isnan} \mathopen{}\left( V_s \mathclose{}\right) \mathbin{|} \mathopen{}\left( V_s = 0 \mathclose{}\right) \mathclose{}\right) \\ \hspace{1em} \mathrm{depth\_valid} \gets \mathrm{np}.\mathrm{extract} \mathopen{}\left( \mathrm{valid\_flag}, z \mathclose{}\right) \\ \hspace{1em} \mathbf{if} \ \mathrm{depth\_valid}.\mathrm{size} = 0 \\ \hspace{2em} \mathrm{depth\_max} \gets 0 \\ \hspace{1em} \mathbf{else} \\ \hspace{2em} \mathrm{depth\_max} \gets \mathrm{np}.\mathrm{max} \mathopen{}\left( \mathrm{depth\_valid} \mathclose{}\right) \\ \hspace{1em} \mathbf{end \ if} \\ \hspace{1em} \mathbf{if} \ \mathrm{shallow\_velocity\_extrapolation\_method} = \textrm{"Boore04"} \land \mathopen{}\left( \mathrm{depth\_max} \ge 10 \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{depth\_max} < 30 \mathclose{}\right) \\ \hspace{2em} \mathrm{vsd} \gets \mathrm{get\_site\_class\_average} \mathopen{}\left( V_s, z \mathclose{}\right) \\ \hspace{2em} \mathrm{table2} \gets \mathrm{ReferenceDataSets}.\mathrm{Boore04Table2} \\ \hspace{2em} \mathrm{idx} \gets \mathrm{np}.\mathrm{clip} \mathopen{}\left( \mathrm{np}.\mathrm{searchsorted} \mathopen{}\left( \mathrm{table2}_{\textrm{"depth"}}, \mathrm{depth\_max} \mathclose{}\right), \mathrm{None}, 19 \mathclose{}\right) \\ \hspace{2em} \mathopen{}\left( a, b \mathclose{}\right) \gets \mathopen{}\left( \mathrm{table2}_{\textrm{"a"}, \mathrm{idx}}, \mathrm{table2}_{\textrm{"b"}, \mathrm{idx}} \mathclose{}\right) \\ \hspace{2em} V_{s30} \gets 10^{a + b \cdot \log_{10} \mathrm{vsd}} \\ \hspace{1em} \mathbf{else} \\ \hspace{2em} V_{s30} \gets \mathrm{get\_site\_class\_average} \mathopen{}\left( V_s, z, z_{top}, z_{bottom} \mathclose{}\right) \\ \hspace{1em} \mathbf{end \ if} \\ \hspace{1em} \mathbf{return} \ V_{s30} \\ \mathbf{end \ function} \end{array} \]

Parameters:

Name Type Description Default
depth float

Depth below ground surface to bottom of layer

required
shear_velocity float

Shear wave velocity of soil

required
average_top_depth float

Special average top depth

0.0
average_bottom_depth float

Special average bottom depth

30.0
shallow_velocity_extrapolation_method str

Method for shallow velocity extrapolation

None

Returns:

Name Type Description
average_shear_velocity float

Average shear wave velocity to 30 m depth

get_average_undrained_shear_strength

get_average_undrained_shear_strength(
    depth,
    undrained_shear_strength,
    average_top_depth=0.0,
    average_bottom_depth=30.0,
)

Calculation function.

\[ \begin{array}{l} \mathbf{function} \ \mathrm{get\_average\_undrained\_shear\_strength}(z, S_u, z_{top}, z_{bottom}) \\ \hspace{1em} S_u \gets \mathrm{np}.\mathrm{clip} \mathopen{}\left( S_u, \mathrm{None}, 250 \mathclose{}\right) \\ \hspace{1em} S_{u30} \gets \mathrm{get\_site\_class\_average} \mathopen{}\left( S_u, z, z_{top}, z_{bottom} \mathclose{}\right) \\ \hspace{1em} \mathbf{return} \ S_{u30} \\ \mathbf{end \ function} \end{array} \]

Parameters:

Name Type Description Default
depth float

Depth below ground surface to bottom of layer

required
undrained_shear_strength float

Undrained shear strength of soil

required
average_top_depth float

Special average top depth

0.0
average_bottom_depth float

Special average bottom depth

30.0

Returns:

Name Type Description
average_undrained_shear_strength float

Average undrained shear strength to 30 m depth

get_site_class

get_site_class(
    is_e_site_class=False,
    is_f1_site_class=False,
    is_f2_site_class=False,
    is_f3_site_class=False,
    is_f4_site_class=False,
)

Calculation function.

\[ \begin{array}{l} \mathbf{function} \ \mathrm{get\_site\_class}(\mathrm{is\_e\_site\_class}, \mathrm{is\_f1\_site\_class}, \mathrm{is\_f2\_site\_class}, \mathrm{is\_f3\_site\_class}, \mathrm{is\_f4\_site\_class}) \\ \hspace{1em} \mathrm{is\_f\_site\_class} \gets \mathrm{is\_f1\_site\_class} \mathbin{|} \mathrm{is\_f2\_site\_class} \mathbin{|} \mathrm{is\_f3\_site\_class} \mathbin{|} \mathrm{is\_f4\_site\_class} \\ \hspace{1em} \mathrm{site\_class} \gets \mathrm{STRING\_DTYPE\_NA} \\ \hspace{1em} \mathbf{if} \ \mathrm{np}.\mathrm{any} \mathopen{}\left( \mathrm{is\_f\_site\_class} \mathclose{}\right) \\ \hspace{2em} \mathrm{site\_class} \gets \textrm{"F"} \\ \hspace{1em} \mathbf{end \ if} \\ \hspace{1em} \mathbf{if} \ \mathrm{np}.\mathrm{any} \mathopen{}\left( \mathrm{is\_e\_site\_class} \mathclose{}\right) \\ \hspace{2em} \mathrm{site\_class} \gets \textrm{"E"} \\ \hspace{1em} \mathbf{end \ if} \\ \hspace{1em} \mathbf{return} \ \mathrm{site\_class} \\ \mathbf{end \ function} \end{array} \]

Parameters:

Name Type Description Default
is_e_site_class bool

Thickness of clay with [PI (%) > 20 & wc (%) ≥ 40 & Su (kPa) < 24] > 3

False
is_f1_site_class bool

Soils vulnerable to potential failure / collapse under seismic loading: liquefiable soils, quick / highly sensitive clays, collapsible weakly cemented soils

False
is_f2_site_class bool

Thickness of Peat and/or highly organic clays > 3

False
is_f3_site_class bool

Thickness of Very high plasticity clays [PI (%) > 75] > 8

False
is_f4_site_class bool

Thickness of Very thick, soft/medium stiff clays [Su (kPa) < 50] > 36

False

Returns:

Name Type Description
site_class str

Seismic site class

get_site_class_average

get_site_class_average(
    values_to_average,
    depth,
    average_top_depth=0.0,
    average_bottom_depth=30.0,
)

Calculation function.

\[ \begin{array}{l} \mathbf{function} \ \mathrm{get\_site\_class\_average}(\mathrm{values\_to\_average}, z, z_{top}, z_{bottom}) \\ \hspace{1em} \mathrm{values\_to\_average} \gets \mathrm{np}.\mathrm{atleast\_1d} \mathopen{}\left( \mathrm{values\_to\_average} \mathclose{}\right) \\ \hspace{1em} z \gets \mathrm{np}.\mathrm{atleast\_1d} \mathopen{}\left( z \mathclose{}\right) \\ \hspace{1em} \mathbf{if} \ \mathrm{np}.\mathrm{isnan} \mathopen{}\left( z_{bottom} \mathclose{}\right) \\ \hspace{2em} \mathrm{raise\_value\_error} \mathopen{}\left( \textrm{"average\_bottom\_depth is null"} \mathclose{}\right) \\ \hspace{1em} \mathbf{end \ if} \\ \hspace{1em} \mathrm{valid\_flag} \gets \mathopen{}\left( \mathrm{values\_to\_average} > 0 \mathclose{}\right) \mathbin{\&} \mathord{\sim} \mathrm{np}.\mathrm{isnan} \mathopen{}\left( \mathrm{values\_to\_average} \mathclose{}\right) \\ \hspace{1em} \mathbf{if} \ \mathrm{np}.\mathrm{any} \mathopen{}\left( \mathord{\sim} \mathrm{valid\_flag} \mathclose{}\right) \\ \hspace{2em} \mathrm{raise\_value\_error} \mathopen{}\left( \textrm{"site\_class\_average: only positive, non-null values supported"} \mathclose{}\right) \\ \hspace{1em} \mathbf{end \ if} \\ \hspace{1em} \mathrm{depth\_valid} \gets \mathrm{np}.\mathrm{extract} \mathopen{}\left( \mathrm{valid\_flag}, z \mathclose{}\right) \\ \hspace{1em} \mathrm{depth\_max} \gets \mathrm{np}.\mathrm{max} \mathopen{}\left( \mathrm{depth\_valid} \mathclose{}\right) \\ \hspace{1em} \mathbf{if} \ z_{bottom} > \mathrm{depth\_max} \\ \hspace{2em} \mathrm{raise\_value\_error} \mathopen{}\left( \textrm{"average\_bottom\_depth=\{\} is greater than depth\_max=\{\}"}.\mathrm{format} \mathopen{}\left( z_{bottom}, \mathrm{depth\_max} \mathclose{}\right) \mathclose{}\right) \\ \hspace{1em} \mathbf{end \ if} \\ \hspace{1em} \mathrm{depth\_in\_window} \gets \mathrm{np}.\mathrm{r\_}_{\mathopen{}\left( z_{top}, \mathrm{np}.\mathrm{extract} \mathopen{}\left( \mathopen{}\left( \mathrm{depth\_valid} > z_{top} \mathclose{}\right) \mathbin{\&} \mathopen{}\left( \mathrm{depth\_valid} < z_{bottom} \mathclose{}\right), \mathrm{depth\_valid} \mathclose{}\right), z_{bottom} \mathclose{}\right)} \\ \hspace{1em} \mathrm{values\_to\_average\_in\_window} \gets \mathrm{values\_to\_average}_{\mathrm{np}.\mathrm{searchsorted} \mathopen{}\left( \mathrm{depth\_valid}, \mathrm{depth\_in\_window} \mathclose{}\right)} \\ \hspace{1em} H \gets \mathrm{get\_thickness} \mathopen{}\left( \mathrm{depth\_in\_window} - z_{top} \mathclose{}\right) \\ \hspace{1em} \mathrm{site\_class\_average} \gets \frac{\sum H}{\sum \mathopen{}\left( \frac{H}{\mathrm{values\_to\_average\_in\_window}} \mathclose{}\right)} \\ \hspace{1em} \mathbf{return} \ \mathrm{site\_class\_average} \\ \mathbf{end \ function} \end{array} \]

Parameters:

Name Type Description Default
values_to_average float

Values used for averaging

required
depth float

Depth below ground surface to bottom of layer

required
average_top_depth float

Special average top depth

0.0
average_bottom_depth float

Special average bottom depth

30.0

Returns:

Name Type Description
site_class_average float

Special average for site class determination

get_site_class_average_blow_count

get_site_class_average_blow_count(average_blow_count)

Calculation function.

\[ \begin{array}{l} \mathbf{function} \ \mathrm{get\_site\_class\_average\_blow\_count}(N_{30}) \\ \hspace{1em} \mathrm{site\_class} \gets \mathrm{parameter\_registry}.\mathrm{bin\_data} \mathopen{}\left( \textrm{"average\_blow\_count"}, N_{30}, \textrm{"site\_class"} \mathclose{}\right) \\ \hspace{1em} \mathbf{return} \ \mathrm{site\_class} \\ \mathbf{end \ function} \end{array} \]

Parameters:

Name Type Description Default
average_blow_count float

Average SPT blow count to 30 m depth

required

Returns:

Name Type Description
site_class str

Seismic site class

get_site_class_average_shear_velocity

get_site_class_average_shear_velocity(
    average_shear_velocity,
)

Calculation function.

\[ \begin{array}{l} \mathbf{function} \ \mathrm{get\_site\_class\_average\_shear\_velocity}(V_{s30}) \\ \hspace{1em} \mathrm{site\_class} \gets \mathrm{parameter\_registry}.\mathrm{bin\_data} \mathopen{}\left( \textrm{"average\_shear\_velocity"}, V_{s30}, \textrm{"site\_class"} \mathclose{}\right) \\ \hspace{1em} \mathbf{return} \ \mathrm{site\_class} \\ \mathbf{end \ function} \end{array} \]

Parameters:

Name Type Description Default
average_shear_velocity float

Average shear wave velocity to 30 m depth

required

Returns:

Name Type Description
site_class str

Seismic site class

get_site_class_average_undrained_shear_strength

get_site_class_average_undrained_shear_strength(
    average_undrained_shear_strength,
)

Calculation function.

\[ \begin{array}{l} \mathbf{function} \ \mathrm{get\_site\_class\_average\_undrained\_shear\_strength}(S_{u30}) \\ \hspace{1em} \mathrm{site\_class} \gets \mathrm{parameter\_registry}.\mathrm{bin\_data} \mathopen{}\left( \textrm{"average\_undrained\_shear\_strength"}, S_{u30}, \textrm{"site\_class"} \mathclose{}\right) \\ \hspace{1em} \mathbf{return} \ \mathrm{site\_class} \\ \mathbf{end \ function} \end{array} \]

Parameters:

Name Type Description Default
average_undrained_shear_strength float

Average undrained shear strength to 30 m depth

required

Returns:

Name Type Description
site_class str

Seismic site class

get_site_class_label

get_site_class_label(site_class)

Calculation function.

\[ \begin{array}{l} \mathbf{function} \ \mathrm{get\_site\_class\_label}(\mathrm{site\_class}) \\ \hspace{1em} \mathrm{site\_class\_label} \gets \mathrm{replace\_from\_mapping} \mathopen{}\left( \mathrm{site\_class}, \mathrm{parameter\_registry}.\mathrm{get\_pair\_discrete\_field\_mapping} \mathopen{}\left( \textrm{"site\_class"}, \textrm{"site\_class\_label"} \mathclose{}\right) \mathclose{}\right) \\ \hspace{1em} \mathbf{return} \ \mathrm{site\_class\_label} \\ \mathbf{end \ function} \end{array} \]

Parameters:

Name Type Description Default
site_class str

Seismic site class

required

Returns:

Name Type Description
site_class_label str

Label for seismic site class

get_site_period

get_site_period(
    shear_velocity,
    depth,
    site_period_method="weighted average",
)

Calculation function.

\[ \begin{array}{l} \mathbf{function} \ \mathrm{get\_site\_period}(V_s, z, \mathrm{site\_period\_method}) \\ \hspace{1em} H \gets \mathrm{get\_thickness} \mathopen{}\left( z \mathclose{}\right) \\ \hspace{1em} T_n \gets \mathrm{None} \\ \hspace{1em} \mathbf{if} \ \mathrm{site\_period\_method} = \textrm{"weighted average"} \\ \hspace{2em} \mathrm{depth\_max} \gets \mathrm{np}.\mathrm{max} \mathopen{}\left( z \mathclose{}\right) \\ \hspace{2em} \mathrm{vs\_asterisk} \gets \frac{\sum \mathopen{}\left( V_s \cdot H \mathclose{}\right)}{\mathrm{depth\_max}} \\ \hspace{2em} T_n \gets \frac{4 \mathrm{depth\_max}}{\mathrm{vs\_asterisk}} \\ \hspace{1em} \mathbf{else} \\ \hspace{2em} \mathbf{if} \ \mathrm{site\_period\_method} = \textrm{"sum of periods"} \\ \hspace{3em} T_n \gets 4 \sum \mathopen{}\left( \frac{H}{V_s} \mathclose{}\right) \\ \hspace{2em} \mathbf{end \ if} \\ \hspace{1em} \mathbf{end \ if} \\ \hspace{1em} \mathbf{return} \ T_n \\ \mathbf{end \ function} \end{array} \]

Parameters:

Name Type Description Default
shear_velocity float

Shear wave velocity of soil

required
depth float

Depth below ground surface to bottom of layer

required
site_period_method Any

site_period_method

'weighted average'

Returns:

Name Type Description
site_period float

Natural period of site