Skip to content

Index

subsurfaceio.site_investigation.analysis

Site investigation analysis (aggregation, parametric).

Classes:

Name Description
DepthArrange

Evenly spaced depth vector for aggregation.

DepthDiscrete

Explicit list of depths for aggregation.

DepthDiscreteItem

Single discrete depth for aggregation.

InSituTestParametricAnalysis

Parametric liquefaction analysis over PGA and magnitude grids.

InSituTestsAggregation

Aggregate in-situ test profiles onto a common depth vector.

DepthArrange pydantic-model

Bases: BaseModel

Evenly spaced depth vector for aggregation.

Fields:

depth_from pydantic-field

depth_from: float = 0.0

depth_step pydantic-field

depth_step: float = 0.2

depth_to pydantic-field

depth_to: float = 50.0

depth_vector property

depth_vector: list[float]

Evenly spaced depths from depth_from to depth_to.

type pydantic-field

type: Literal['arrange']

DepthDiscrete pydantic-model

Bases: BaseModel

Explicit list of depths for aggregation.

Fields:

depth pydantic-field

depth: list[DepthDiscreteItem]

depth_vector property

depth_vector: list[float]

Explicit depths in depth order.

type pydantic-field

type: Literal['discrete']

DepthDiscreteItem pydantic-model

Bases: BaseModel

Single discrete depth for aggregation.

Fields:

depth pydantic-field

depth: float = None

InSituTestParametricAnalysis pydantic-model

Bases: Model

Parametric liquefaction analysis over PGA and magnitude grids.

Fields:

meshgrid property

meshgrid: tuple[ndarray, ndarray]

PGA and magnitude mesh from x_range and y_range.

Raises:

Type Description
ValueError

When the mesh exceeds _max_meshgrid_size.

results property

results: Any

Liquefaction calculate-result mapping, indexed by field name.

x_field pydantic-field

x_field: Literal["peak_ground_acceleration"] = (
    "peak_ground_acceleration"
)

x_range pydantic-field

x_range: RangeParameters

y_field pydantic-field

y_field: Literal['moment_magnitude'] = 'moment_magnitude'

y_range pydantic-field

y_range: RangeParameters

calculate

calculate() -> Self

Run liquefaction over the PGA–magnitude grid and store results.

Returns:

Type Description
Self

This analysis spec, with results populated.

get_results_figure

get_results_figure(
    field: Literal[
        "lateral_displacement_index_sum",
        "lateral_spread_displacement_sum",
        "liquefaction_settlement_sum",
        "liquefaction_potential_index_sum",
        "liquefaction_severity_number_sum",
        "thickness_non_liquefiable_layer",
        "thickness_liquefiable_layer",
    ] = "liquefaction_potential_index_sum",
) -> go.Figure

Surface plot of a liquefaction scalar over the PGA–magnitude grid.

Parameters:

Name Type Description Default
field Literal['lateral_displacement_index_sum', 'lateral_spread_displacement_sum', 'liquefaction_settlement_sum', 'liquefaction_potential_index_sum', 'liquefaction_severity_number_sum', 'thickness_non_liquefiable_layer', 'thickness_liquefiable_layer']

Result field to plot on the z-axis.

'liquefaction_potential_index_sum'

Returns:

Type Description
Figure

Plotly 3-D surface figure.

Raises:

Type Description
ValueError

When calculate has not been run.

set_parent

set_parent(test: InSituTestWithLiquefaction) -> Self

Bind this analysis to an in-situ test that supports liquefaction.

Parameters:

Name Type Description Default
test InSituTestWithLiquefaction

Parent test whose liquefaction settings and data are used.

required

Returns:

Type Description
Self

This analysis spec.

InSituTestsAggregation pydantic-model

Bases: Model

Aggregate in-situ test profiles onto a common depth vector.

Fields:

aggregated_test pydantic-field

aggregated_test: InSituTest | None = None

aggregation pydantic-field

aggregation: Aggregation = 'mean'

depth_vector property

depth_vector: list[float]

Depth breaks from depths.

depths pydantic-field

depths: DepthArrange | DepthDiscrete = DepthArrange(
    type="arrange"
)

quantile pydantic-field

quantile: NullableFloat = 0.5

site property

site: SiteInvestigation

Site bound by attach_site.

test_type pydantic-field

test_type: Literal['BORH', 'CPT', 'DMT', 'IST'] = 'CPT'

test_type_site_investigation property

test_type_site_investigation: SiteInvestigation

Copy of the bound site containing only tests of test_type.

aggregate

aggregate(**kwargs: Any) -> Self

Bin and aggregate source traces onto depth_vector.

Parameters:

Name Type Description Default
**kwargs Any

Forwarded to the bin-aggregation helper.

{}

Returns:

Type Description
Self

This spec, with aggregated_test populated.

attach_site

attach_site(site: SiteInvestigation) -> Self

Bind this aggregation spec to a site investigation.

Parameters:

Name Type Description Default
site SiteInvestigation

Site whose tests of test_type are aggregated.

required

Returns:

Type Description
Self

This aggregation spec.

plot

plot(
    plot_module: Literal["plotly", "mpl"] = "plotly",
) -> Any

Plot source tests in gray with the aggregated test overlaid in black.

Builds a temporary site copy so the attached site is not mutated.

Parameters:

Name Type Description Default
plot_module Literal['plotly', 'mpl']

Figure backend.

'plotly'

Returns:

Type Description
Any

Plotly or matplotlib figure from

Any

Raises:

Type Description
ValueError

When aggregated_test has not been calculated.