weac.utils.snowpilot_parser module

Utilizes the snowpylot library to convert a CAAML file to a WEAC ModelInput.

The snowpylot library is used to parse the CAAML file and extract the snowpit. The snowpit is then converted to a List of WEAC ModelInput.

Based on the different stability tests performed, several scenarios are created. Each scenario is a WEAC ModelInput.

The scenarios are created based on the following logic: - For each PropSawTest, a scenario is created with the cut length and a standard segment. - For each ExtColumnTest, a scenario is created with a standard segment. - For each ComprTest, a scenario is created with a standard segment. - For each RBlockTest, a scenario is created with a standard segment.

The a standard segment is a segment with a length of 1000 mm and a foundation of True.

The the cut length is the cut length of the PropSawTest. The the column length is the column length of the PropSawTest.

weac.utils.snowpilot_parser.vertical_to_slope_normal_depth_scale(phi_deg)[source]

Scale vertical (plumb) depth/thickness to distance along slope normal.

CAAML / SnowPilot report depths from the surface along the vertical. WEAC slab layer thicknesses are measured normal to the slope. Following the convention used for SnowPilot import here, the plumb-line depth d_v is converted to slope-normal depth d_n by d_n = d_v * cos(phi), where phi is the slope angle from horizontal.

Parameters:

phi_deg (float)

Return type:

float

class weac.utils.snowpilot_parser.SnowPilotParser(file_path)[source]

Bases: object

Parser for SnowPilot files using the snowpylot library.

Parameters:

file_path (str)

__init__(file_path)[source]
Parameters:

file_path (str)

pit_slope_angle_deg()[source]

Slope angle from CAAML validSlopeAngle if present, else None.

Return type:

float | None

extract_layers(slope_angle_deg=0.0)[source]

Extract layers from snowpit.

Depths and thicknesses in CAAML are measured along the vertical. For WEAC, pass the same slope angle (degrees from horizontal) as ScenarioConfig.phi; thicknesses and matching depths are scaled to slope-normal by cos(phi). The default 0 leaves depths unchanged (vertical equals slope-normal on flat terrain). To use the angle stored in the pit file, pass slope_angle_deg=parser.pit_slope_angle_deg() or 0.0.

Parameters:

slope_angle_deg (float)

Return type:

tuple[list[Layer], list[str]]

get_density_for_layer_range(layer_top_mm, layer_bottom_mm, sp_density_layers, *, depth_scale=1.0)[source]

Public wrapper for _get_density_for_layer_range().

Parameters:
  • layer_top_mm (float)

  • layer_bottom_mm (float)

  • sp_density_layers (list[DensityObs])

  • depth_scale (float)

Return type:

float | None