Skip to content

suunto_nautic: begin pressure = max reading (ignore transmitter dropout) - #3

Merged
latishab merged 1 commit into
mainfrom
fix/nautic-tank-begin-dropout
Sep 6, 2026
Merged

suunto_nautic: begin pressure = max reading (ignore transmitter dropout)#3
latishab merged 1 commit into
mainfrom
fix/nautic-tank-begin-dropout

Conversation

@latishab

@latishab latishab commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

On a dual-transmitter dive, a transmitter that hasn't paired yet reports a spurious low pressure (~9 bar) for the first minutes, then jumps to the real ~200 bar. The parser seeded begin pressure from the FIRST reading, so that tank showed a nonsensical 9 → 109 bar (a cylinder gaining pressure over the dive).

Fix: begin pressure = the highest reading seen. A cylinder only loses pressure during a dive, so the max is the true start, and an initial dropout is ignored.

Validated on @nandodiver's Air+Air dual-transmitter captures (deepsealabs/libdc-swift#29): the dropped transmitter's begin recovers from 9 bar to 207 bar; end pressures and the other transmitter are unchanged.

🤖 Generated with Claude Code

A cylinder only loses pressure during a dive, so the highest reading is the
true start pressure. The parser was seeding begin from the FIRST observed
reading, which on a dual-transmitter dive can be a pre-pairing dropout: a
transmitter that hasn't linked yet reports a spurious low value (~9 bar) for
the first minutes, then jumps to the real ~200 bar. That produced a
nonsensical tank that gained pressure over the dive (9 -> 109 bar).

Take the max over all readings for begin pressure instead. Validated on
nandodiver's Air+Air dual-transmitter dives (issue #29/#34): the dropped
transmitter's begin now recovers from 9 bar to the real 207 bar; end
pressures and the other transmitter are unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012VH1Magk9E9nWusjYQd4oe
@latishab
latishab merged commit 25633f1 into main Sep 6, 2026
6 of 18 checks passed
oyarzun pushed a commit to oyarzun/libdc-swift that referenced this pull request Sep 12, 2026
Bump libdivecomputer to the begin-pressure fix (deepsealabs/libdivecomputer#3):
a dual-transmitter dive where one transmitter hasn't paired yet reports a
spurious ~9 bar for the first minutes; begin pressure now takes the max
reading so it recovers to the real ~207 bar instead of showing a tank that
gains pressure.

Tests: the corpus cross-check now derives the expected begin as the max of
each app pressure curve (matching the parser) and uses a looser begin
tolerance (3 bar, vs 1.5 for end) to absorb raw-vs-app noise while still
catching a dropout-latched begin. Added nandodiver's two Air+Air
dual-transmitter captures (1788683271/272) to the hard-asserted set.

Validates deepsealabs#34 for the transmitter-dropout case.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012VH1Magk9E9nWusjYQd4oe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant