shearwater_tissues.py (481B)
1 # SPDX-License-Identifier: GPL-2.0-only 2 """Starting tissues logged by the Shearwater (records 0x70-0x74). Usage: python3 -I shearwater_tissues.py dives.json""" 3 import json, struct, sys 4 for d in json.load(open(sys.argv[1])): 5 raw = b"".join(bytes.fromhex(d["raw_opening"][k])[4:32] for k in ("70", "71", "72", "73", "74") if k in d["raw_opening"]) if "70" in d["raw_opening"] else b"" 6 print(d["number"], d["date"], "surf", d["surface_mbar"], sorted(d["raw_opening"].keys()))