weac.parser.plotting.force_penetration_plot module¶
SMP and SnowScope penetration-resistance debug plotting (unified entry points).
Penetration parsers record penetration resistance first, then derive sample
density (SnowMicroPen via snowmicropyn; SnowScope via a semilog hardness model).
SnowPilot pits are layer lists only — they do not expose this resistance–depth
signal, so this package does not apply to
SnowPilotParser.
Four depth-aligned panels (see plot_force_penetration_layers()):
Penetration resistance vs recorded depth.
Sample density vs recorded depth.
Sample density vs slope-normal depth. SnowScope records plumb depth, so this panel compresses by
cos(phi). SMP records slope-normal depth already, so this panel matches the recorded axis.Segmented WEAC layers (
binorgradient) vs slope-normal depth, with the slope-normal density faintly overlaid.
Parser-specific extract-and-plot helpers live in
weac.parser.plotting.smp_penetration_plot and
weac.parser.plotting.snowscope_penetration_plot.
- class weac.parser.plotting.force_penetration_plot.ForcePenetrationParser(*args, **kwargs)[source]¶
Bases:
ProtocolSMP or SnowScope parser with
extract_profile/extract_layers.- __init__(*args, **kwargs)¶
- class weac.parser.plotting.force_penetration_plot.ForcePenetrationProfile(*args, **kwargs)[source]¶
Bases:
ProtocolProfile from SMP or SnowScope (resistance–depth signal plus derived density).
- depth_mm: ndarray¶
- penetration_resistance_kPa: ndarray¶
- density_kg_m3: ndarray¶
- density_method: str¶
- __init__(*args, **kwargs)¶
- weac.parser.plotting.force_penetration_plot.plot_force_penetration_layers(profile, layers, *, slope_angle_deg=0.0, depth_axis='plumb', title=None, layer_label='layers', save_path=None, show=True, figsize=(13.0, 6.5))[source]¶
Plot penetration resistance, density, slope-normal density, and layers on a depth axis.
- Parameters:
profile (ForcePenetrationProfile) –
SMPProfileorSnowScopeProfile(must exposedepth_mm,penetration_resistance_kPa,density_kg_m3,density_method).layers (list[Layer]) – WEAC layers ordered surface -> ground (from
extract_layers).Layer.his slope-normal, so the reconstructed staircase is drawn on the slope-normal axis (panels 3-4). For a plumb profile, pass the sameslope_angle_degused to extract the layers so the slope-normal density panel and the staircase share one axis. The staircase bottom overshoots the last sample by one cell because the binning helpers repeat the final sample spacing (an intentional part of their cell model, seelayer_binning).slope_angle_deg (float) – Slope angle [deg] for a plumb profile; sets the
cos(phi)compression of the slope-normal depth axis. Ignored whendepth_axisis"slope-normal"(must stay0).depth_axis (Literal['plumb', 'slope-normal']) –
"plumb"(SnowScope) compresses panels 3-4 bycos(phi)."slope-normal"(SMP) uses the recorded depth as the slope-normal axis with no further scaling.title (str | None) – Figure suptitle; defaults to the density method name.
layer_label (str) – Legend/title label for the segmented panel.
save_path (str | Path | None) – If given, save the figure (PNG) to this path.
show (bool) – Call
plt.show()before returning (defaultTrue).figsize (tuple[float, float]) – Figure size in inches.
- Returns:
The created
Figure.- Return type:
Figure
- weac.parser.plotting.force_penetration_plot.plot_force_penetration_parser(parser, *, method='bin', slope_angle_deg=0.0, density_method=None, semilog_slope=None, semilog_intercept=None, layer_thickness_mm=None, gradient_threshold=12.0, **plot_kwargs)[source]¶
Extract from an SMP or SnowScope parser and plot the debug view.
Dispatches to
plot_smp_penetration_parser()orplot_snowscope_penetration_parser().semilog_slope/semilog_interceptandslope_angle_degapply only to SnowScope (SMP depths are already slope-normal).**plot_kwargs(e.g.title,save_path,show) pass through toplot_force_penetration_layers().- Parameters:
parser (ForcePenetrationParser)
method (Literal['bin', 'gradient'])
slope_angle_deg (float)
density_method (str | None)
semilog_slope (float | None)
semilog_intercept (float | None)
layer_thickness_mm (float | None)
gradient_threshold (float)
- Return type:
Figure
- weac.parser.plotting.force_penetration_plot.plot_smp_penetration_parser(parser, *, method='bin', density_method=None, layer_thickness_mm=None, gradient_threshold=12.0, **plot_kwargs)[source]¶
Extract from an SMP parser and plot the penetration-resistance debug view.
SMP depths are already slope-normal, so this does not accept
slope_angle_degand does not compress the depth axis.- Parameters:
parser (SMPParser)
method (Literal['bin', 'gradient'])
density_method (Literal['P2015', 'CR2020', 'K2020a', 'K2020b'] | None)
layer_thickness_mm (float | None)
gradient_threshold (float)
- Return type:
Figure
- weac.parser.plotting.force_penetration_plot.plot_snowscope_penetration_parser(parser, *, method='bin', slope_angle_deg=0.0, density_method=None, semilog_slope=None, semilog_intercept=None, layer_thickness_mm=None, gradient_threshold=12.0, **plot_kwargs)[source]¶
Extract from a SnowScope parser and plot the penetration-resistance debug view.
- Parameters:
parser (SnowScopeParser)
method (Literal['bin', 'gradient'])
slope_angle_deg (float)
density_method (Literal['HAGENMULLER2018'] | None)
semilog_slope (float | None)
semilog_intercept (float | None)
layer_thickness_mm (float | None)
gradient_threshold (float)
- Return type:
Figure