1 parent a01554b commit 00a0041Copy full SHA for 00a0041
1 file changed
oceanstream/echodata/calibrate/ecs.py
@@ -70,6 +70,15 @@ def _normalize_ecs_text(text: str) -> str:
70
stripped = line.rstrip("\r\n")
71
# Only rewrite top-level headers (no leading whitespace).
72
if not stripped or line.startswith((" ", "\t")):
73
+ # Filter out commented param lines with empty/invalid values
74
+ # e.g. " # SoundSpeed = # (meters per second)..."
75
+ # These crash echopype's PARAM_MATCHER
76
+ trimmed = stripped.lstrip()
77
+ if trimmed.startswith("#"):
78
+ # Check if it's a commented param with "= #" (empty value)
79
+ if "= #" in trimmed or "= \n" in line or trimmed.endswith("="):
80
+ # Skip this line entirely — it's a no-op comment
81
+ continue
82
out_lines.append(line)
83
continue
84
nl = line[len(stripped):] or "\n"
0 commit comments