SMP surface detection & slope-normal depths
Corrects how SnowMicroPen profiles enter WEAC layers, and adds an optional surface marker for new snow.
- Slope-normal SMP depths: The SnowMicroPen is driven normal to the slope, so recorded depths are already slope-normal.
SMPParser.extract_layersno longer acceptsslope_angle_degand no longer scales thickness bycos(phi). SnowScope and SnowPilot stay plumb: passslope_angle_degthere to scaleLayer.h. - Knappe surface detection:
SMPParser(..., surface_method="knappe")places the snow surface with a 1 mm moving force-gradient detector (Hanning-smoothed, thresholded against the quietest air window in the top 100 mm)."snowmicropyn"remains the default."manual"(or anysurface_mm) sets the marker directly. - Plot depth axis: Force-penetration plots take
depth_axis="plumb"(SnowScope, compressed bycos(phi)) or"slope-normal"(SMP, recorded depth used as-is). Passing a non-zero slope angle to an SMP plot raises. The parser demo notebook compares the two surface markers and the plumb vs slope-normal panels.
⚠️ Breaking changes
slope_angle_deg is removed from SMPParser.extract_layers and from the SMP plotting helpers (plot_smp_penetration_parser, and plot_force_penetration_parser when given an SMPParser). Callers that passed a slope angle into the SMP path should drop that argument. Profiles extracted with a non-zero angle under v3.3.0 were scaled as if the probe were plumb; those thicknesses were too thin by cos(phi). Re-extract SMP layers without the angle.
SnowScope is unchanged: slope_angle_deg still converts plumb depth to slope-normal Layer.h.
🛠️ Code Maintenance
Version bump to v3.3.1.
🧪 Testing
SMP surface-method coverage: Knappe vs snowmicropyn on the sample .PNT, surface_mm overriding surface_method, manual surface requiring surface_mm, unknown method rejection, and Knappe fallback when the profile is shorter than the gradient window.
📦 Pull Requests Included
- PR #58: SMP is already slope-normal / Knappe surface detection for
.PNTfiles
Full Changelog: v3.3.0...v3.3.1