diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bb5bd8..ab3ba31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,71 @@ All notable changes to seismo-relay are documented here. ## Unreleased +### Fixed +- **A Blastware file's geophone range comes from its setup, so Sensitive + events no longer read 8× high.** + - **Where it is:** in the setup's channel blocks, the byte 29 after each + geophone label. `0x00` is Normal (10 in/s full scale), `0x01` is Sensitive + (1.25 in/s). SFM's live 1A read has the same byte at label+33. + - **Measured:** it matches Blastware's GeoRange on 70,042 / 70,042 DL2 + events, all three channels agreeing on every one (35 Sensitive). + - **Before:** SFM assumed Normal, so every Sensitive event's peaks, vector + sum and `.h5` samples read 8× high. + - **`Event.geo_range`** is new: 0 or 1, or None when it isn't read (the + channels disagree, an unknown value, or a missing block). None comes with + a `decode_problems` entry, and peaks then assume Normal as before. + - **`decode_blastware_bytes`** scales peaks and the histogram vector sum by + the range. + - **`event_hdf5.write_event_hdf5`:** `geo_range` now defaults to None, + meaning the event's own range, else Normal. An explicit argument still + wins. + - **`waveform_store.save_imported_bw` and `scripts/backfill_sidecars.py`** + no longer force `"normal"`. The `waveform_store` line was agreed with the + parity session, which owns that file. + - **Decode checker:** GeoRange 70,042 / 70,042, and geophone samples exact + on **6,524 / 6,524** waveforms (was 6,491). PPV mismatches about halved, + and 10 of 88 fields fully match (was 6). 70,287 comparisons fixed, 0 + regressions. + - ⚠ **Codec change: bump `TOOL_VERSION` at the next release.** The backfill + (`backfill_sidecars.py` then `backfill_event_shape.py`) rewrites stored + Sensitive events' peaks and `.h5` files. No schema change. + +## v0.33.0 — 2026-11-01 + +**SFM reads Series-3 events from the file alone, and proves it against +Blastware.** + +**What was broken.** A Blastware event that reached SFM without its ASCII +report used to come in half-decoded: +- no sample rate +- a "70 s" record time, which was really the record-type byte +- blank notes +- every histogram typed as a waveform +- a histogram vector sum built from channel peaks taken at different moments +- a mic reading about 95× low in psi + +That matters more now: every DL2 event from before 2025 arrives with no report, +and SFM's own download and call-in paths never have one. + +**What this release does.** It reads all of those from the event file itself, +and adds the decode checker that proves it. The checker compares SFM's +file-only decode, field by field and sample by sample, with Blastware's own +`_XML.XML` event reports for the 70,042 DL2 events that have one (2016–2026). + +**Where that stands now:** +- sample rate, record time, pre-trigger, notes and event type match on every + event +- geophone samples are exact on 6,491 / 6,524 waveforms (the 33 others are on + the 1.250 in/s range, which SFM cannot read from the file yet) +- the histogram vector sum matches on 69,919 +- the mic matches on all but a few dozen + +Events imported with an ASCII report are unchanged on prod; the report still +overlays. + +⚠ **This release owes prod a backfill.** It does not move stored event times; +see *Migration* below. + ### Fixed - **The mic in psi was ~95× low: one MicL count is 0.25 Pa.** - SFM converted mic counts with a "~0.5 psi full-scale" guess (0.0125 / @@ -163,6 +228,9 @@ All notable changes to seismo-relay are documented here. - job number, ZC frequency, acceleration, displacement, time of peak, sensor check, battery, calibration, range, units and monitor log are not read yet + - Later in this release, the record type (#41), the histogram vector sum + and the mic conversion were fixed. See their entries above; each was + proven by a full checker run with 0 regressions. - It replaces `scratch/verify_bw_fields_against_xml.py`, added and removed within this release. - **Operational consequence: none.** Nothing on the ingest path changes. @@ -191,6 +259,45 @@ All notable changes to seismo-relay are documented here. The old section stays below the banner as history. Docs only: no code or schema change, no migration, `TOOL_VERSION` unchanged. +### Migration + +⚠ **This release owes prod a backfill.** It does not move stored event times. + +**Before you start:** +- `TOOL_VERSION` is bumped to **0.33.0**, which gates the regeneration, so no + `--force` is needed. +- No parser change, so no `--reparse-txt` is needed. +- No schema change. +- **Back up `seismo_relay.db` first.** + +**Then, in the `sfm` container, in this order** (the scripts default to +`bridges/captures/seismo_relay.db` and its `waveforms/`): + +1. `python scripts/backfill_sidecars.py` re-decodes every Series-3 event file + whose sidecar predates 0.33.0. Sidecars and `.h5` files regenerate, and each + DB row refreshes in place (id and review kept). ⚠ **~2 h on the NAS.** + - **Report-less events** pick up the new values: sample rate, record time, + pre-trigger, notes, record type, histogram vector sum, mic. + - **Report-paired events** keep the report's values. + - **The record type** stays the same for every ACH file (`…W` / `…H`). Only a + histogram stored under a 3-character manual-download name flips from + Waveform to Histogram. +2. `python scripts/backfill_event_shape.py --db-path bridges/captures/seismo_relay.db + --store-root bridges/captures/waveforms` recomputes the shape and offset + metrics from the regenerated files. + +Series-4 (Thor) events are untouched; nothing in their decode changed. + +**Not rehearsed on a prod snapshot** (v0.32.0 was). The risk is lower: +- Event times do not move, so every row is matched in place. +- No row is created or removed. +- The full decode checker ran clean against all 70,112 DL2 event files before + release. + +**Afterwards**, the DL2 watcher can be widened for the 2016–2024 backfill: +`MAX_EVENT_AGE_DAYS = 2130` reaches 2021. Set it back to 365 when done, +because the same setting widens the heartbeat's scan. + --- ## v0.32.0 — 2026-10-27 diff --git a/CLAUDE.md b/CLAUDE.md index 42695d5..6080f7f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -2,7 +2,7 @@ Ground-up Python replacement for **Blastware**, Instantel's Windows-only software for managing MiniMate Plus seismographs. Connects over direct RS-232 or cellular modem -(Sierra Wireless RV50 / RV55). Current version: **v0.32.0**. +(Sierra Wireless RV50 / RV55). Current version: **v0.33.0**. Stack-level context — which repo owns what, and how the three project versions pair — lives in `../terra-view/docs/tmi-stack.md`, which is also loaded as @@ -10,36 +10,42 @@ pair — lives in `../terra-view/docs/tmi-stack.md`, which is also loaded as --- -## Where things stand (updated 2026-10-26) +## Where things stand (updated 2026-11-01) Read this first when picking the project back up. -- **🔑 The Series-3 decode checker (2026-10-29).** Goal: SFM produces everything - Blastware reports, from the event file alone (spec/plan in `docs/superpowers/`). - Run it with `scratch/check_s3_decode.py ~/dl2-archive/files ~/dl2-archive/xml`. - It decodes each event from its bytes only (no filename, no report) and - compares every field, sample and interval with Blastware's `_XML.XML`: 70,042 - events, 2016–2026, ~22 min at `--jobs 4`. Run output (`summary.md`, - `details.json`, `changes.md`) goes to `~/dl2-archive/checker-runs/` and is - never committed. The rule: every mismatch is SFM's bug unless a carve-out - with evidence covers it. - **First full run:** - - ✅ Sample rate, record time, pre-trigger and notes match everywhere. - - ✅ Geophone samples are exact on 6,491 / 6,524 waveforms in every year. The - 33 others are the 1.250 in/s range, 8× under SFM's Normal-range assumption. - - ❌ Every histogram reads as a waveform without its filename (#41), and - their start times are 1 s early (#51). - - ❌ Open findings: - - histogram PVS: SFM takes the vector magnitude of each channel's interval - peak (peaks that may come from different moments); Blastware takes the - per-interval vector sum - - mic psi conversion - - mic dB off by 0.05–0.1 on ~1,000 events +- **🔑 The Series-3 decode checker (2026-10-29; v0.33.0).** + - **Goal:** SFM produces everything Blastware reports, from the event file + alone (spec and plan in `docs/superpowers/`). + - **Running it:** `scratch/check_s3_decode.py ~/dl2-archive/files + ~/dl2-archive/xml` decodes each event from its bytes only (no filename, no + report). It compares every field, sample and interval with Blastware's + `_XML.XML`: 70,042 events, 2016–2026, ~22 min at `--jobs 4`. + - **Output** (`summary.md`, `details.json`, `changes.md`) goes to + `~/dl2-archive/checker-runs/` and is never committed. + - **The rule:** every mismatch is SFM's bug unless a carve-out with evidence + covers it. + + **As of v0.33.0:** + - ✅ **Match on every event:** sample rate, record time, pre-trigger, notes, + and event type (#41, from STRT[18]). + - ✅ **Geophone samples** are exact on 6,491 / 6,524 waveforms in every year. + The 33 others are the 1.250 in/s range, 8× under SFM's Normal-range + assumption. + - ✅ **Histogram PVS** = the stored per-interval PVS²: 69,919 / 70,042. + - ✅ **Mic: one count = 0.25 Pa,** with Blastware's dB offset at 81.9384. It + fails on only a few dozen events. + - ❌ **Open:** + - histogram start times are 1 s early (#51) - 35 sub-minute (5 s / 2 s) histograms decode wrongly, plus 2 one-minute no-mic histograms (`R352HFZ7`-shaped, likely a separate cause) - 26 histogram start dates are a day off - - ⬜ Not read yet: job number, ZC frequency, acceleration, displacement, time - of peak, sensor check, battery, calibration, range, units, monitor log. + - the per-interval PVS is not stored + - Blastware prints `OORANGE` when the vector sum alone exceeds the range + (a carve-out to prove) + - ⬜ **Not read yet:** job number, ZC frequency, acceleration, displacement, + time of peak, sensor check, battery, calibration, range, units, monitor + log. - **The Series-4 LIVE wire protocol is reverse-engineered end to end (2026-09-25).** `docs/micromate_protocol_reference.md` is the Series-4 Rosetta Stone, sibling to `instantel_protocol_reference.md`. **A Micromate diff --git a/README.md b/README.md index 8a0c170..0f60513 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# seismo-relay `v0.32.0` +# seismo-relay `v0.33.0` A ground-up replacement for **Blastware** — Instantel's aging Windows-only software for managing seismographs. Supports both the **MiniMate Plus @@ -74,6 +74,27 @@ over direct RS-232 or cellular modem (Sierra Wireless RV50 / RV55). > > ⚠ The deploy owes a backfill and moves stored waveform times; see the > changelog's *Migration*. +> +> **v0.33.0 (2026-11-01)** reads Series-III events from the file alone, and +> proves it. +> - **Fields now read from the event file** when no Blastware report comes with +> the event: +> - sample rate, record time, pre-trigger and the four notes (#44/#45) +> - the event type (#41) +> - a histogram's peak vector sum, which the unit stores per interval +> - the mic, at one count = 0.25 Pa (it read ~95× low in psi) +> +> This matters for every DL2 event from before 2025, and for SFM's own +> download and call-in paths, none of which have a report. +> - **The decode checker** (`scratch/check_s3_decode.py`) compares SFM's +> file-only decode with Blastware's `_XML.XML` event reports, field by field +> and sample by sample, for 70,042 DL2 events back to 2016: +> - every setup field, the notes and the event type match on every event +> - geophone samples are exact on 6,491 / 6,524 waveforms +> - the histogram vector sum matches on 69,919 +> +> ⚠ The deploy owes a backfill; it does not move event times. See the +> changelog's *Migration*. > See [CHANGELOG.md](CHANGELOG.md) for full version history. --- @@ -615,7 +636,16 @@ Implementation steps (concrete): ### High-impact (unblocks product features) -- [ ] **Series III waveform body codec reverse-engineering.** The 5A bulk-stream body is some kind of compressed/encoded format (not raw int16 LE as previously assumed — see §7.6.1 retraction in `docs/instantel_protocol_reference.md`). Structural framing is ~50% decoded on branch `claude/codec-re-cBGNe` (tagged-block walker, segment counters); per-byte sample mapping is still open. Until this lands, the in-app waveform viewer renders garbage and BW-import peak values fall back to `_peaks_from_samples()` saturation noise. Workaround: pair every BW-imported event with its `_ASCII.TXT` so the device-authoritative peaks land in the DB regardless of codec. +- [x] **Series III waveform body codec reverse-engineering.** ✅ The body codec is fully decoded (`minimateplus/waveform_codec.py`, `histogram_codec.py`), and verified per-sample against Blastware's own exports. As of v0.33.0, geophone samples are exact on 6,491 / 6,524 DL2 waveforms against their `_XML.XML` reports, across 2016–2026. +- [ ] **SFM produces everything Blastware reports, from the event file alone.** The four-piece plan: + 1. the decode checker ✅ v0.33.0 + 2. complete the file-only decode, one field group at a time, each proven by the checker + 3. flip ingest so reports are kept only for checking + 4. stop the watchers forwarding reports + + **Done so far:** setup fields, notes, event type, histogram PVS, mic. + + **Next:** histogram start times (#51), the 37 histograms that decode wrongly, the job number, the geophone range (Sensitive-range events read 8×), and the values Blastware computes itself (ZC frequency, acceleration, displacement, time of peak), plus the sensor check, battery, calibration and monitor log. Design: `docs/superpowers/specs/2026-10-29-s3-decode-checker-design.md`. - [x] **Series IV (Thor IDF) binary codec reverse-engineering.** ✅ v0.21.0 — `micromate/idf_file.read_idf_file()` decodes both IDFW (waveform body at offset `0x0f1f`, reusing `decode_waveform_v2()`; 87–99% sample fidelity on quiet events) and IDFH (dedicated segment-based decoder: all 859 corpus files decode, 181,071 intervals, peaks within ~1.8% of sidecar values). `WaveformStore.save_imported_idf` now also projects parsed Thor data into a `bw_report` block via `micromate/idf_to_bw_report.py` so Thor events render in the existing Event Report PDF pipeline without a separate renderer. - [ ] **In-app waveform viewer accuracy.** Depends on Series III codec decode. Plot.v1 JSON pipeline + viewer skeleton already exist; will start showing real waveforms automatically once `_decode_a5_waveform` produces correct samples. Series IV waveforms come online when the IDF codec lands. - [ ] **Series IV live-device support.** Once the IDF binary is decoded, extend `micromate/` with `transport.py` / `framing.py` / `protocol.py` / `client.py` mirroring the `minimateplus/` package layout — depends on capturing Thor's wire protocol (TCP / RS-232 captures TBD). diff --git a/minimateplus/decode_check.py b/minimateplus/decode_check.py index 871b48e..6133d77 100644 --- a/minimateplus/decode_check.py +++ b/minimateplus/decode_check.py @@ -18,12 +18,13 @@ from dataclasses import dataclass from typing import Callable, Optional, Sequence from .bw_xml_report import XmlReport -from .event_file_io import _GEO_INT16_FS, _GEO_NORMAL_FS_INS, _MIC_PSI_PER_COUNT, decode_blastware_bytes +from .event_file_io import (_GEO_FS_BY_RANGE, _GEO_INT16_FS, _GEO_NORMAL_FS_INS, _MIC_PSI_PER_COUNT, + decode_blastware_bytes) from .models import Event from .waveform_codec import mic_count_to_db -# SFM's conversion: it cannot yet read the geophone range from the file, and -# assumes Normal (10 in/s full scale = 32000 counts). +# SFM's conversion at the Normal range (10 in/s full scale = 32000 counts), +# which SFM assumes when it cannot read the event's range from the file. GEO_IPS_PER_COUNT: float = _GEO_NORMAL_FS_INS / _GEO_INT16_FS _CHANNELS = ("Tran", "Vert", "Long", "MicL") @@ -38,6 +39,7 @@ class SfmSide: job_number: Optional[str] # None until the decoder reads it channels: list[str] # channels with decoded data, in Tran/Vert/Long/MicL order counts: dict[str, list[int]] # waveform samples or histogram interval peaks + geo_ips_per_count: float = GEO_IPS_PER_COUNT # at the event's range, as SFM read it def sfm_side(raw: bytes) -> SfmSide: @@ -55,6 +57,7 @@ def sfm_side(raw: bytes) -> SfmSide: # SFM's interval count is its decoded entry count; the reference # carries this field for histograms only. "NumberofIntervals": len(counts["Tran"]) or None, + "GeoRange": _GEO_FS_BY_RANGE.get(ev.geo_range), } if ts is not None: date = f"{ts.year:04d}-{ts.month:02d}-{ts.day:02d}" @@ -78,6 +81,7 @@ def sfm_side(raw: bytes) -> SfmSide: job_number=None, channels=[ch for ch in _CHANNELS if counts[ch]], counts=counts, + geo_ips_per_count=_GEO_FS_BY_RANGE.get(ev.geo_range, _GEO_NORMAL_FS_INS) / _GEO_INT16_FS, ) @@ -184,19 +188,20 @@ def _series_result(field: str, n_bw: int, n_sfm: int, diffs: list[tuple[int, flo ) -def _sample_converters(ref: XmlReport) -> dict[str, Callable[[int], float]]: - convert: dict[str, Callable[[int], float]] = {ch: (lambda c: c * GEO_IPS_PER_COUNT) for ch in _GEO} +def _sample_converters(sfm: SfmSide, ref: XmlReport) -> dict[str, Callable[[int], float]]: + k = sfm.geo_ips_per_count + convert: dict[str, Callable[[int], float]] = {ch: (lambda c: c * k) for ch in _GEO} mic = _mic_converter(ref) if mic is not None: convert["MicL"] = mic return convert -def _interval_converter(title: str) -> Optional[Callable[[int], float]]: +def _interval_converter(title: str, sfm: SfmSide) -> Optional[Callable[[int], float]]: """SFM keeps each interval's peaks; it drops their frequencies and geo PVS.""" ch, _, rest = title.partition(" ") if rest.startswith("Peak") and ch in _GEO: - return lambda c: c * GEO_IPS_PER_COUNT + return lambda c: c * sfm.geo_ips_per_count if ch == "MicL" and rest == "Peak dB(L)": return mic_count_to_db if ch == "MicL" and rest == "Peak psi(L)": @@ -215,7 +220,7 @@ def series_pairs(sfm: SfmSide, ref: XmlReport, a row whose cell count differs is a disagreement for every channel.""" if field.startswith("samples."): ch = field[len("samples."):] - convert = _sample_converters(ref).get(ch) + convert = _sample_converters(sfm, ref).get(ch) counts = sfm.counts.get(ch, []) if convert is None or not counts: return None @@ -232,7 +237,7 @@ def series_pairs(sfm: SfmSide, ref: XmlReport, if field.startswith("intervals."): title = field[len("intervals."):] columns = ref.interval_columns or [] - convert = _interval_converter(title) + convert = _interval_converter(title, sfm) counts = sfm.counts.get(title.partition(" ")[0], []) if convert is None or not counts or title not in columns: return None diff --git a/minimateplus/event_file_io.py b/minimateplus/event_file_io.py index 6bb4a3f..7907e29 100644 --- a/minimateplus/event_file_io.py +++ b/minimateplus/event_file_io.py @@ -51,7 +51,7 @@ SIDECAR_KIND = "sfm.event" # bumped without a `pip install` re-run — leading to confusing stale # version stamps in sidecars. Bump this constant and CHANGELOG.md # together at release time. -TOOL_VERSION = "0.32.0" # waveform times from the event record, report dates, histogram reader; gates the backfill regen +TOOL_VERSION = "0.33.0" # setup + notes, record type, histogram PVS and mic from the file; gates the backfill regen try: # Best-effort: prefer the installed metadata when it's NEWER than the @@ -704,9 +704,11 @@ _INT16_FS = 32768.0 # sfm.event_hdf5._GEO_INT16_FS or sidecar peaks disagree with the plotted # waveform by 2.3%. Confirmed 2026-08-25 against the BW ASCII corpus. _GEO_INT16_FS = 32000.0 -# A histogram's geo values are in decoder units of 16 counts = 0.005 in/s at -# the Normal range (the same assumption as the samples above). -_HIST_GEO_UNIT_INS = 16 * _GEO_NORMAL_FS_INS / _GEO_INT16_FS +# Full scale per geo_range: 0 Normal, 1 Sensitive. +_GEO_FS_BY_RANGE = {0: _GEO_NORMAL_FS_INS, 1: _GEO_SENSITIVE_FS_INS} +# A histogram's geo values are decoder units of 16 counts: 0.005 in/s at the +# Normal range, scaled by the range's full scale like the samples above. +_HIST_GEO_COUNTS_PER_UNIT = 16 # Microphone scale factor, psi per MicL count: one count is 0.25 Pa # (waveform_codec.MIC_PA_PER_COUNT, measured against Blastware's psi(L) on @@ -749,17 +751,19 @@ def _decode_samples_4ch_int16_le(stream: bytes) -> dict[str, list[int]]: } -def _peaks_from_samples(samples: dict[str, list[int]]) -> PeakValues: +def _peaks_from_samples(samples: dict[str, list[int]], + geo_fs_ins: float = _GEO_NORMAL_FS_INS) -> PeakValues: """ - Compute approximate peaks from raw int16 samples assuming Normal-range - geophone sensitivity. Used by the BW-importer when the 0C waveform - record (the device's authoritative peaks) is unavailable. + Compute peaks from raw int16 samples at the given geophone full scale + (Normal, 10 in/s, unless the file's range says otherwise). Used by the + BW-importer when the 0C waveform record (the device's authoritative peaks) + is unavailable. """ def _peak_ins(ch: list[int]) -> float: if not ch: return 0.0 m = max(abs(int(v)) for v in ch) - return m / _GEO_INT16_FS * _GEO_NORMAL_FS_INS + return m / _GEO_INT16_FS * geo_fs_ins tran = _peak_ins(samples.get("Tran", [])) vert = _peak_ins(samples.get("Vert", [])) @@ -773,7 +777,7 @@ def _peaks_from_samples(samples: dict[str, list[int]]) -> PeakValues: pvs = 0.0 n = min(len(samples.get("Tran", [])), len(samples.get("Vert", [])), len(samples.get("Long", []))) if n: - scale = _GEO_NORMAL_FS_INS / _GEO_INT16_FS + scale = geo_fs_ins / _GEO_INT16_FS T = samples["Tran"]; V = samples["Vert"]; L = samples["Long"] for i in range(n): t = T[i] * scale @@ -996,6 +1000,32 @@ def _setup_notes(raw: bytes) -> ProjectInfo: operator=operator, sensor_location=location) +# The geophone range sits in the setup's channel blocks, which follow the +# notes: the byte 29 after each geophone label (`00 00 01 Tran ...`). 0x00 is +# Normal, 0x01 Sensitive -- Blastware's GeoRange on 70,042 / 70,042 DL2 events, +# all three channels agreeing on every one (measured 2026-11-01). SFM's live +# 1A read has the same byte at label+33. +_RANGE_AFTER_LABEL = 29 +_CHANNEL_BLOCK_SPAN = 2000 # how far past the setup name the blocks may sit + + +def _setup_geo_range(raw: bytes) -> tuple[Optional[int], Optional[str]]: + """(geo_range, problem): 0 Normal or 1 Sensitive when all three geophone + channels say the same, else None and why.""" + k = _setup_name_at(raw) + if k is None: + return None, "no recording-setup block to read the geophone range from" + found = {} + for label in (b"Tran", b"Vert", b"Long"): + i = raw.find(b"\x00\x00\x01" + label, k, k + _CHANNEL_BLOCK_SPAN) + p = i + 3 + _RANGE_AFTER_LABEL + found[label.decode()] = raw[p] if i >= 0 and p < len(raw) else None + values = set(found.values()) + if len(values) == 1 and values <= {0, 1}: + return values.pop(), None + return None, f"geophone range not read: channel range bytes {found}" + + def read_blastware_file(path: Union[str, Path], *, name: Optional[str] = None) -> Event: """Parse a Blastware event file into an Event: `decode_blastware_bytes` on its bytes, `name` defaulting to the file's own (see there -- never a time source).""" @@ -1156,6 +1186,9 @@ def decode_blastware_bytes(raw: bytes, *, name: Optional[str] = None) -> Event: # every waveform used to read "70 s". A histogram has no record time or # pre-trigger -- Blastware reports neither. ev.sample_rate = _setup_sample_rate(raw) + ev.geo_range, range_problem = _setup_geo_range(raw) + if range_problem: + ev.decode_problems.append(range_problem + "; peaks assume the Normal range") if is_waveform_body: ev.rectime_seconds = _setup_record_time(raw) ev.total_samples = len(samples["Tran"]) or None @@ -1244,14 +1277,17 @@ def decode_blastware_bytes(raw: bytes, *, name: Optional[str] = None) -> Event: # None, and ``apply_report_to_event`` overlays from a paired ASCII # report when one is supplied. has_samples = any(samples.get(ch) for ch in ("Tran", "Vert", "Long", "MicL")) - ev.peak_values = _peaks_from_samples(samples) if has_samples else None + # The geophone full scale is the file's range; Normal when it wasn't read. + geo_fs = _GEO_FS_BY_RANGE.get(ev.geo_range, _GEO_NORMAL_FS_INS) + ev.peak_values = _peaks_from_samples(samples, geo_fs) if has_samples else None if not is_waveform_body and ev.peak_values is not None: # A histogram stores each interval's vector sum (squared); the event's # is the largest. Combining the channel peaks instead read high on 86% # of DL2's histograms -- they can come from different moments. pvs = interval_pvs(body) if pvs: - ev.peak_values.peak_vector_sum = max(pvs) * _HIST_GEO_UNIT_INS + ev.peak_values.peak_vector_sum = ( + max(pvs) * _HIST_GEO_COUNTS_PER_UNIT * geo_fs / _GEO_INT16_FS) ev._a5_frames = None # not recoverable from BW file return ev diff --git a/minimateplus/models.py b/minimateplus/models.py index a38bcad..abd5d1a 100644 --- a/minimateplus/models.py +++ b/minimateplus/models.py @@ -543,6 +543,9 @@ class Event: total_samples: Optional[int] = None # from STRT record: expected total sample-sets pretrig_samples: Optional[int] = None # from STRT record: pre-trigger sample count rectime_seconds: Optional[int] = None # from STRT record: record duration (seconds) + # Geophone range from the recording setup, as ComplianceConfig.geo_range: + # 0 Normal (10 in/s full scale), 1 Sensitive (1.25 in/s). None: not read. + geo_range: Optional[int] = None # Sensor self-check traces keyed by channel label — the short diagnostic # waveforms the unit records when it pulses each sensor before monitoring diff --git a/pyproject.toml b/pyproject.toml index 0f3a8c0..e03f473 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "seismo-relay" -version = "0.32.0" +version = "0.33.0" description = "Python client and REST server for MiniMate Plus seismographs" requires-python = ">=3.10" dependencies = [ diff --git a/scripts/backfill_sidecars.py b/scripts/backfill_sidecars.py index 366b854..ed6d9a6 100644 --- a/scripts/backfill_sidecars.py +++ b/scripts/backfill_sidecars.py @@ -428,8 +428,7 @@ def main(argv=None) -> int: try: event_hdf5.write_event_hdf5( hdf5_path, ev, - serial=serial, - geo_range="normal", + serial=serial, # range: the event's own, from its setup source_kind=source_kind, ) hdf5_filename = hdf5_path.name diff --git a/sfm/event_hdf5.py b/sfm/event_hdf5.py index e5f4b8c..bde0e28 100644 --- a/sfm/event_hdf5.py +++ b/sfm/event_hdf5.py @@ -180,7 +180,7 @@ def write_event_hdf5( event: Event, *, serial: str, - geo_range = "normal", + geo_range = None, source_kind: str = "sfm-live", tool_version: Optional[str] = None, captured_at: Optional[datetime.datetime] = None, @@ -190,6 +190,9 @@ def write_event_hdf5( """ Persist a decoded Event as an HDF5 file with samples in physical units. + ``geo_range`` left as None takes the event's own (``event.geo_range``, + which a Blastware file's decode reads from its setup block), else Normal. + ``geo_ips_per_count`` overrides the range-derived MiniMate count scale for sources whose counts differ — Thor IDF imports pass ``micromate.idf_file._GEO_LSB_IPS`` (issue #42). @@ -202,6 +205,8 @@ def write_event_hdf5( pv = event.peak_values pi = event.project_info + if geo_range is None: + geo_range = event.geo_range if getattr(event, "geo_range", None) is not None else "normal" geo_fs = _resolve_geo_full_scale(geo_range) geo_range_str = _normalise_range(geo_range) captured_at = captured_at or datetime.datetime.utcnow() diff --git a/sfm/waveform_store.py b/sfm/waveform_store.py index 69314dd..7bce4e8 100644 --- a/sfm/waveform_store.py +++ b/sfm/waveform_store.py @@ -298,7 +298,7 @@ class WaveformStore: serial_hint: Optional[str] = None, bw_report_text: Optional[Union[str, bytes]] = None, source_kind: str = "bw-import", - geo_range: Union[str, int] = "normal", + geo_range: Optional[Union[str, int]] = None, ) -> tuple[Event, dict]: """ Ingest a Blastware event file produced by an external tool @@ -417,8 +417,9 @@ class WaveformStore: event_hdf5.write_event_hdf5( hdf5_path, ev, serial=serial, - # The BW file doesn't carry the range (yet); an import assumes Normal, - # a live download passes the unit's own (event_ingest). + # None (an import): the event's own range, read from the file's + # setup (ev.geo_range), else Normal. An explicit value -- a live + # download's (event_ingest) -- wins. geo_range=geo_range, source_kind="bw-import", ) diff --git a/tests/fixtures/geo-range-11-01-26/K557J1KB.RQ0W b/tests/fixtures/geo-range-11-01-26/K557J1KB.RQ0W new file mode 100755 index 0000000..459781e Binary files /dev/null and b/tests/fixtures/geo-range-11-01-26/K557J1KB.RQ0W differ diff --git a/tests/fixtures/geo-range-11-01-26/K557J1KB_RQ0W_XML.XML b/tests/fixtures/geo-range-11-01-26/K557J1KB_RQ0W_XML.XML new file mode 100755 index 0000000..dab938a --- /dev/null +++ b/tests/fixtures/geo-range-11-01-26/K557J1KB_RQ0W_XML.XML @@ -0,0 +1,3207 @@ + + +8.0 +Full Waveform +BE9557 +V 10.72-8.17 MiniMate Plus +K557J1KB.RQ0W +09:02:14 +2021-06-28 + +Tran +Vert +Long +MicL + +Manual +1.0 sec. +Fixed +1024 sps +6.7 Volts +February 14, 2020 by Instantel +in/s and dB(L) +Lawton Street Bridge - 50 South Mill St +Lobar Site Development +Terra-Mechanics, Inc. - D. Harrison +Loc #1 - 50 South Mill St. + +1.250 +in/s + + +0.019 +in/s + + +0.055 +in/s + + +0.019 +in/s + + +3.0 +Hz + + +3.0 +Hz + + +2.8 +Hz + + +0.345 +s + + +0.333 +s + + +0.336 +s + + +0.007 +g + + +0.017 +g + + +0.005 +g + + +0.001 +in + + +0.002 +in + + +0.001 +in + + +0.061 +in/s + + +0.333 +s + +Linear Weighting + +88.0 +dB(L) + + +0.296 +s + + +>100 +Hz + +7.9 Hz. +3.4 +Passed +7.4 Hz. +3.7 +Passed +7.7 Hz. +3.8 +Passed +20.1 Hz. +559 mv +Passed + + +2021-06-28 09:02:12 - 2021-06-28 09:02:15 "Event Recorded " + + + + +-0.0010.0000.0020.000 + + +-0.0010.0010.0030.000 + + +-0.0010.0000.0030.000 + + +-0.0020.0010.002-81.94 + + +-0.0020.0010.0020.000 + + +-0.0030.0020.0040.000 + + +-0.0020.0020.0040.000 + + +-0.0020.0020.004-81.94 + + +-0.0030.0020.0040.000 + + +-0.0030.0040.0040.000 + + +-0.0020.0050.0030.000 + + +-0.0020.0060.0020.000 + + +-0.0020.0070.0020.000 + + +-0.0010.0060.0030.000 + + +-0.0010.0060.0020.000 + + +-0.0010.0030.0020.000 + + +0.0010.0020.0030.000 + + +0.0000.0010.0010.000 + + +0.0010.0000.0020.000 + + +0.0010.0010.0020.000 + + +0.0010.0010.0020.000 + + +0.0010.0010.0020.000 + + +0.0000.0010.0020.000 + + +0.000-0.0010.0020.000 + + +0.000-0.0010.002-81.94 + + +0.000-0.0010.0020.000 + + +-0.001-0.0020.0010.000 + + +-0.001-0.0010.002-81.94 + + +-0.001-0.0020.002-81.94 + + +-0.002-0.0030.003-81.94 + + +-0.002-0.0040.004-81.94 + + +-0.002-0.0040.0030.000 + + +-0.002-0.0040.0040.000 + + +-0.003-0.0050.0040.000 + + +-0.002-0.0060.004-81.94 + + +-0.004-0.0070.004-81.94 + + +-0.005-0.0080.0040.000 + + +-0.004-0.0090.0040.000 + + +-0.004-0.0090.0040.000 + + +-0.003-0.0110.0040.000 + + +-0.003-0.0100.0050.000 + + +-0.004-0.0100.0040.000 + + +-0.004-0.0110.003-81.94 + + +-0.003-0.0110.003-81.94 + + +-0.004-0.0110.002-81.94 + + +-0.003-0.0110.004-81.94 + + +-0.004-0.0110.0020.000 + + +-0.003-0.0110.0020.000 + + +-0.002-0.0110.002-81.94 + + +-0.002-0.0120.002-81.94 + + +-0.002-0.0120.001-81.94 + + +-0.002-0.0110.001-81.94 + + +-0.001-0.0120.001-81.94 + + +-0.001-0.0120.001-81.94 + + +-0.001-0.0130.000-81.94 + + +0.001-0.0140.000-81.94 + + +0.000-0.0140.001-81.94 + + +0.000-0.013-0.001-81.94 + + +0.001-0.0140.001-81.94 + + +0.000-0.0140.001-81.94 + + +-0.001-0.0140.000-81.94 + + +-0.001-0.013-0.001-81.94 + + +-0.001-0.0130.000-81.94 + + +-0.001-0.0120.000-81.94 + + +-0.001-0.011-0.001-81.94 + + +-0.001-0.0100.001-81.94 + + +-0.002-0.0090.002-81.94 + + +-0.002-0.0090.002-81.94 + + +-0.002-0.0060.0020.000 + + +-0.003-0.0050.0030.000 + + +-0.003-0.0020.004-81.94 + + +-0.004-0.0010.0050.000 + + +-0.0040.0010.0060.000 + + +-0.0040.0040.006-81.94 + + +-0.0040.0060.006-81.94 + + +-0.0050.0070.007-81.94 + + +-0.0040.0110.007-81.94 + + +-0.0060.0120.007-81.94 + + +-0.0060.0150.009-81.94 + + +-0.0060.0160.009-81.94 + + +-0.0060.0180.009-81.94 + + +-0.0070.0200.009-81.94 + + +-0.0070.0210.009-81.94 + + +-0.0070.0220.010-81.94 + + +-0.0070.0240.010-81.94 + + +-0.0090.0240.010-81.94 + + +-0.0070.0250.011-81.94 + + +-0.0090.0260.0110.000 + + +-0.0090.0270.011-81.94 + + +-0.0090.0290.011-81.94 + + +-0.0090.0300.0120.000 + + +-0.0090.0310.012-81.94 + + +-0.0090.0320.012-81.94 + + +-0.0100.0340.012-81.94 + + +-0.0100.0350.013-81.94 + + +-0.0090.0360.013-81.94 + + +-0.0090.0370.014-81.94 + + +-0.0100.0390.014-81.94 + + +-0.0090.0400.014-81.94 + + +-0.0100.0400.0130.000 + + +-0.0110.0430.0130.000 + + +-0.0100.0420.0120.000 + + +-0.0090.0420.013-81.94 + + +-0.0100.0420.014-81.94 + + +-0.0100.0440.013-81.94 + + +-0.0110.0440.014-81.94 + + +-0.0090.0440.014-81.94 + + +-0.0090.0440.013-81.94 + + +-0.0100.0440.014-81.94 + + +-0.0100.0440.013-81.94 + + +-0.0110.0440.014-81.94 + + +-0.0100.0440.013-81.94 + + +-0.0100.0440.013-81.94 + + +-0.0090.0440.012-81.94 + + +-0.0100.0430.012-81.94 + + +-0.0100.0440.0130.000 + + +-0.0110.0420.0140.000 + + +-0.0100.0420.012-81.94 + + +-0.0100.0420.014-81.94 + + +-0.0090.0410.0120.000 + + +-0.0110.0410.0130.000 + + +-0.0110.0400.012-81.94 + + +-0.0110.0390.012-81.94 + + +-0.0110.0390.012-81.94 + + +-0.0110.0390.012-81.94 + + +-0.0110.0380.011-81.94 + + +-0.0110.0370.009-81.94 + + +-0.0110.0360.010-81.94 + + +-0.0110.0350.010-81.94 + + +-0.0110.0340.010-81.94 + + +-0.0100.0320.009-81.94 + + +-0.0090.0310.009-81.94 + + +-0.0100.0310.009-81.94 + + +-0.0090.0290.007-81.94 + + +-0.0090.0270.0070.000 + + +-0.0090.0260.0070.000 + + +-0.0090.0250.007-81.94 + + +-0.0080.0220.0060.000 + + +-0.0070.0210.007-81.94 + + +-0.0070.0200.0060.000 + + +-0.0070.0180.0050.000 + + +-0.0070.0170.0050.000 + + +-0.0060.0160.0040.000 + + +-0.0060.0160.0040.000 + + +-0.0060.0140.0040.000 + + +-0.0060.0130.0030.000 + + +-0.0060.0130.0030.000 + + +-0.0060.0120.0020.000 + + +-0.0060.0110.0020.000 + + +-0.0050.0110.0020.000 + + +-0.0050.0090.0020.000 + + +-0.0060.0090.0020.000 + + +-0.0060.0080.0020.000 + + +-0.0060.0070.0020.000 + + +-0.0060.0070.0020.000 + + +-0.0060.0060.0010.000 + + +-0.0050.0060.0010.000 + + +-0.0040.0060.0010.000 + + +-0.0040.0060.0020.000 + + +-0.0040.0060.0010.000 + + +-0.0040.0060.0010.000 + + +-0.0020.0060.0020.000 + + +-0.0040.0060.0010.000 + + +-0.0040.0060.0010.000 + + +-0.0040.0050.0020.000 + + +-0.0040.0050.0020.000 + + +-0.0040.0050.0020.000 + + +-0.0040.0060.0010.000 + + +-0.0040.0060.0020.000 + + +-0.0030.0060.0020.000 + + +-0.0040.0060.0020.000 + + +-0.0030.0060.0020.000 + + +-0.0040.0070.00181.94 + + +-0.0030.0080.0030.000 + + +-0.0030.0090.0020.000 + + +-0.0040.0090.00281.94 + + +-0.0040.0080.002-81.94 + + +-0.0040.0100.0020.000 + + +-0.0040.0110.0040.000 + + +-0.0040.0110.0030.000 + + +-0.0030.0120.0040.000 + + +-0.0030.0120.0040.000 + + +-0.0040.0120.0050.000 + + +-0.0040.0120.0040.000 + + +-0.0040.0140.0020.000 + + +-0.0040.0140.0040.000 + + +-0.0040.0140.0040.000 + + +-0.0030.0140.0040.000 + + +-0.0030.0120.0040.000 + + +-0.0020.0120.0030.000 + + +-0.0030.0120.0040.000 + + +-0.0020.0120.0040.000 + + +-0.0030.0120.0040.000 + + +-0.0020.0110.0040.000 + + +-0.0030.0110.0050.000 + + +-0.0020.0110.0040.000 + + +-0.0030.0110.00481.94 + + +-0.0030.0090.0040.000 + + +-0.0020.0100.0040.000 + + +-0.0020.0090.0040.000 + + +-0.0020.0090.0040.000 + + +-0.0020.0090.0040.000 + + +-0.0020.0090.0040.000 + + +-0.0020.0090.0040.000 + + +-0.0020.0090.0050.000 + + +-0.0010.0090.0040.000 + + +-0.0020.0090.0040.000 + + +-0.0020.0090.0040.000 + + +-0.0020.0100.0040.000 + + +-0.0010.0100.0040.000 + + +-0.0020.0110.0030.000 + + +-0.0010.0110.0040.000 + + +-0.0010.0110.0030.000 + + +-0.0010.0110.0040.000 + + +-0.0020.0110.0040.000 + + +-0.0030.0120.0040.000 + + +-0.0020.0130.0040.000 + + +-0.0020.0140.0030.000 + + +-0.0020.0140.003-81.94 + + +-0.0020.0140.0040.000 + + +-0.0020.0140.0040.000 + + +-0.0020.0140.0040.000 + + +-0.0020.0150.0040.000 + + +-0.0030.0150.0030.000 + + +-0.0020.0160.003-81.94 + + +-0.0020.0150.0030.000 + + +-0.0030.0150.0030.000 + + +-0.0020.0150.0040.000 + + +-0.0030.0140.0030.000 + + +-0.0040.0140.0040.000 + + +-0.0040.0160.0040.000 + + +-0.0040.0160.0040.000 + + +-0.0040.0160.0020.000 + + +-0.0040.0160.0020.000 + + +-0.0040.0160.0030.000 + + +-0.0050.0160.0030.000 + + +-0.0050.0160.0040.000 + + +-0.0040.0150.0020.000 + + +-0.0040.0150.0020.000 + + +-0.0040.0140.001-81.94 + + +-0.0050.0130.0010.000 + + +-0.0040.0110.0020.000 + + +-0.0040.0110.0010.000 + + +-0.0040.0110.0010.000 + + +-0.0040.0110.0010.000 + + +-0.0040.0100.0010.000 + + +-0.0040.0110.0010.000 + + +-0.0040.0110.0010.000 + + +-0.0030.0120.0000.000 + + +-0.0030.0120.0010.000 + + +-0.0030.012-0.0010.000 + + +-0.0030.0110.0010.000 + + +-0.0030.0090.0000.000 + + +-0.0030.008-0.0020.000 + + +-0.0030.007-0.0010.000 + + +-0.0020.007-0.002-81.94 + + +-0.0020.008-0.0020.000 + + +-0.0020.009-0.0010.000 + + +-0.0030.011-0.0010.000 + + +-0.0040.011-0.0010.000 + + +-0.0040.011-0.0010.000 + + +-0.0040.010-0.0010.000 + + +-0.0030.009-0.0020.000 + + +-0.0020.009-0.0020.000 + + +-0.0020.009-0.0030.000 + + +-0.0020.009-0.0030.000 + + +-0.0020.011-0.0040.000 + + +-0.0020.010-0.0030.000 + + +-0.0020.010-0.004-81.94 + + +-0.0010.010-0.004-81.94 + + +-0.0020.009-0.002-81.94 + + +-0.0020.009-0.0040.000 + + +-0.0020.011-0.004-81.94 + + +-0.0010.011-0.0020.000 + + +-0.0010.012-0.0020.000 + + +-0.0020.012-0.0020.000 + + +-0.0020.013-0.0010.000 + + +-0.0010.013-0.0010.000 + + +-0.0010.013-0.0010.000 + + +-0.0010.014-0.0010.000 + + +-0.0020.012-0.0010.000 + + +-0.0020.010-0.0020.000 + + +-0.0010.009-0.0010.000 + + +-0.0010.009-0.0010.000 + + +-0.0020.009-0.0020.000 + + +-0.0020.008-0.0020.000 + + +-0.0020.007-0.0020.000 + + +-0.0020.005-0.0010.000 + + +-0.0020.002-0.0020.000 + + +-0.0020.000-0.0020.000 + + +-0.001-0.001-0.0020.000 + + +0.000-0.004-0.0040.000 + + +0.001-0.006-0.0050.000 + + +0.002-0.008-0.005-81.94 + + +0.002-0.009-0.005-81.94 + + +0.003-0.011-0.0060.000 + + +0.003-0.014-0.007-81.94 + + +0.005-0.016-0.008-81.94 + + +0.006-0.018-0.0070.000 + + +0.006-0.018-0.0090.000 + + +0.007-0.018-0.009-81.94 + + +0.009-0.017-0.009-81.94 + + +0.011-0.017-0.011-81.94 + + +0.011-0.018-0.012-87.96 + + +0.011-0.021-0.014-87.96 + + +0.010-0.027-0.014-81.94 + + +0.012-0.032-0.014-81.94 + + +0.012-0.037-0.013-87.96 + + +0.013-0.040-0.014-81.94 + + +0.014-0.039-0.014-81.94 + + +0.013-0.037-0.015-81.94 + + +0.012-0.034-0.016-81.94 + + +0.012-0.034-0.014-81.94 + + +0.011-0.034-0.014-81.94 + + +0.011-0.037-0.014-81.94 + + +0.012-0.040-0.014-81.94 + + +0.013-0.041-0.015-81.94 + + +0.013-0.039-0.014-81.94 + + +0.013-0.039-0.016-81.94 + + +0.012-0.039-0.016-81.94 + + +0.012-0.039-0.014-81.94 + + +0.013-0.040-0.015-81.94 + + +0.013-0.042-0.014-81.94 + + +0.014-0.043-0.015-81.94 + + +0.015-0.046-0.016-81.94 + + +0.016-0.047-0.016-81.94 + + +0.016-0.047-0.016-81.94 + + +0.015-0.048-0.016-81.94 + + +0.016-0.048-0.017-81.94 + + +0.016-0.047-0.016-81.94 + + +0.016-0.047-0.017-81.94 + + +0.016-0.046-0.016-81.94 + + +0.017-0.046-0.016-81.94 + + +0.017-0.047-0.016-81.94 + + +0.017-0.047-0.017-81.94 + + +0.017-0.047-0.017-81.94 + + +0.016-0.048-0.017-81.94 + + +0.016-0.049-0.017-81.94 + + +0.017-0.050-0.017-81.94 + + +0.017-0.051-0.017-81.94 + + +0.018-0.053-0.018-81.94 + + +0.018-0.055-0.019-81.94 + + +0.017-0.053-0.017-81.94 + + +0.017-0.053-0.019-81.94 + + +0.017-0.051-0.019-81.94 + + +0.018-0.052-0.018-81.94 + + +0.017-0.052-0.018-81.94 + + +0.017-0.051-0.017-81.94 + + +0.018-0.051-0.017-81.94 + + +0.018-0.051-0.018-87.96 + + +0.018-0.051-0.018-81.94 + + +0.018-0.049-0.017-81.94 + + +0.018-0.049-0.016-81.94 + + +0.019-0.047-0.017-81.94 + + +0.018-0.046-0.017-81.94 + + +0.019-0.044-0.016-81.94 + + +0.019-0.044-0.016-81.94 + + +0.019-0.044-0.016-81.94 + + +0.019-0.043-0.016-81.94 + + +0.018-0.042-0.014-81.94 + + +0.019-0.041-0.015-81.94 + + +0.018-0.041-0.0140.000 + + +0.018-0.040-0.014-81.94 + + +0.018-0.038-0.014-81.94 + + +0.019-0.038-0.014-81.94 + + +0.018-0.036-0.014-81.94 + + +0.018-0.035-0.014-81.94 + + +0.017-0.034-0.014-81.94 + + +0.016-0.033-0.014-81.94 + + +0.016-0.032-0.014-81.94 + + +0.016-0.031-0.0130.000 + + +0.014-0.029-0.013-81.94 + + +0.015-0.028-0.012-81.94 + + +0.015-0.027-0.012-81.94 + + +0.014-0.026-0.012-81.94 + + +0.015-0.026-0.012-81.94 + + +0.014-0.024-0.011-81.94 + + +0.014-0.023-0.012-81.94 + + +0.013-0.022-0.0120.000 + + +0.012-0.022-0.0110.000 + + +0.013-0.019-0.0110.000 + + +0.012-0.021-0.0110.000 + + +0.013-0.020-0.012-81.94 + + +0.012-0.020-0.011-81.94 + + +0.012-0.019-0.011-81.94 + + +0.012-0.019-0.011-81.94 + + +0.011-0.019-0.011-81.94 + + +0.011-0.019-0.0110.000 + + +0.011-0.019-0.0110.000 + + +0.011-0.020-0.0110.000 + + +0.010-0.020-0.0110.000 + + +0.010-0.019-0.0110.000 + + +0.011-0.021-0.0110.000 + + +0.010-0.021-0.0110.000 + + +0.010-0.021-0.010-81.94 + + +0.010-0.021-0.0110.000 + + +0.009-0.022-0.011-81.94 + + +0.010-0.022-0.0100.000 + + +0.010-0.023-0.011-81.94 + + +0.010-0.023-0.011-81.94 + + +0.009-0.022-0.011-81.94 + + +0.009-0.022-0.0110.000 + + +0.009-0.022-0.0110.000 + + +0.009-0.022-0.011-81.94 + + +0.009-0.021-0.0110.000 + + +0.009-0.021-0.0110.000 + + +0.009-0.019-0.011-81.94 + + +0.009-0.020-0.011-81.94 + + +0.007-0.019-0.0110.000 + + +0.007-0.020-0.0090.000 + + +0.008-0.020-0.010-81.94 + + +0.007-0.019-0.010-81.94 + + +0.006-0.019-0.010-81.94 + + +0.006-0.019-0.010-81.94 + + +0.006-0.018-0.0090.000 + + +0.006-0.019-0.0090.000 + + +0.005-0.018-0.0090.000 + + +0.006-0.017-0.009-81.94 + + +0.004-0.017-0.0090.000 + + +0.006-0.017-0.0090.000 + + +0.004-0.017-0.0080.000 + + +0.006-0.017-0.009-81.94 + + +0.005-0.017-0.0090.000 + + +0.005-0.017-0.0090.000 + + +0.004-0.017-0.009-81.94 + + +0.005-0.017-0.0090.000 + + +0.005-0.017-0.0090.000 + + +0.006-0.017-0.0090.000 + + +0.006-0.017-0.0090.000 + + +0.004-0.016-0.008-81.94 + + +0.004-0.015-0.0090.000 + + +0.004-0.014-0.0080.000 + + +0.004-0.015-0.0090.000 + + +0.004-0.015-0.0070.000 + + +0.005-0.015-0.0080.000 + + +0.004-0.014-0.0080.000 + + +0.004-0.015-0.0070.000 + + +0.004-0.014-0.0080.000 + + +0.005-0.014-0.008-81.94 + + +0.006-0.012-0.007-81.94 + + +0.005-0.013-0.0070.000 + + +0.005-0.013-0.0070.000 + + +0.005-0.012-0.008-81.94 + + +0.004-0.011-0.009-81.94 + + +0.004-0.011-0.007-81.94 + + +0.004-0.010-0.008-81.94 + + +0.004-0.011-0.0060.000 + + +0.004-0.009-0.0070.000 + + +0.004-0.009-0.0060.000 + + +0.004-0.009-0.0070.000 + + +0.003-0.009-0.0060.000 + + +0.004-0.007-0.0050.000 + + +0.004-0.007-0.0060.000 + + +0.004-0.007-0.0060.000 + + +0.003-0.006-0.0060.000 + + +0.004-0.005-0.0040.000 + + +0.002-0.004-0.004-81.94 + + +0.002-0.003-0.0040.000 + + +0.002-0.001-0.0030.000 + + +0.002-0.001-0.0030.000 + + +0.0010.000-0.0030.000 + + +0.0010.002-0.0010.000 + + +0.0010.002-0.0020.000 + + +0.0000.004-0.0020.000 + + +-0.0010.003-0.001-81.94 + + +0.0010.004-0.001-81.94 + + +0.0010.006-0.0010.000 + + +-0.0010.006-0.0010.000 + + +-0.0010.006-0.0010.000 + + +0.0000.006-0.0010.000 + + +-0.0010.006-0.0010.000 + + +0.0000.006-0.0010.000 + + +-0.0010.006-0.0010.000 + + +-0.0010.007-0.0010.000 + + +-0.0010.0080.0000.000 + + +-0.0010.0080.0000.000 + + +-0.0020.007-0.0010.000 + + +-0.0020.007-0.0010.000 + + +-0.0020.007-0.0010.000 + + +-0.0020.007-0.001-81.94 + + +-0.0020.008-0.0010.000 + + +-0.0010.007-0.0010.000 + + +-0.0020.007-0.0020.000 + + +-0.0010.007-0.0010.000 + + +-0.0010.007-0.0020.000 + + +-0.0010.006-0.0020.000 + + +-0.0010.006-0.0020.000 + + +-0.0020.006-0.0020.000 + + +-0.0020.006-0.0020.000 + + +-0.0010.006-0.002-81.94 + + +-0.0010.005-0.0010.000 + + +-0.0010.006-0.0020.000 + + +-0.0010.004-0.0020.000 + + +-0.0010.004-0.0020.000 + + +-0.0010.004-0.0020.000 + + +-0.0010.004-0.0020.000 + + +-0.0010.004-0.0020.000 + + +-0.0010.004-0.0010.000 + + +-0.0010.004-0.002-81.94 + + +0.0000.004-0.0020.000 + + +0.0000.004-0.002-81.94 + + +-0.0010.004-0.0020.000 + + +-0.0010.004-0.0020.000 + + +-0.0010.005-0.0010.000 + + +0.0000.004-0.0010.000 + + +-0.0010.004-0.0020.000 + + +-0.0010.004-0.0010.000 + + +-0.0020.004-0.0020.000 + + +-0.0010.004-0.0010.000 + + +-0.0010.004-0.0010.000 + + +-0.0010.004-0.0010.000 + + +-0.0020.004-0.0010.000 + + +-0.0010.005-0.0010.000 + + +-0.0020.004-0.0010.000 + + +-0.0020.004-0.0010.000 + + +-0.0010.004-0.0010.000 + + +-0.0010.004-0.0010.000 + + +-0.0020.004-0.0010.000 + + +-0.0020.0040.0000.000 + + +-0.0020.004-0.0010.000 + + +-0.0020.0040.0000.000 + + +-0.0010.0040.0000.000 + + +-0.0010.0040.0000.000 + + +-0.0020.0040.000-81.94 + + +-0.0020.0040.0010.000 + + +-0.0020.0050.0010.000 + + +-0.0010.0040.0010.000 + + +-0.0010.0040.0010.000 + + +-0.0020.0040.0020.000 + + +-0.0020.0050.0010.000 + + +-0.0010.0060.0010.000 + + +-0.0010.0050.001-81.94 + + +-0.0010.0050.0020.000 + + +-0.0020.0060.0010.000 + + +-0.0010.0060.0020.000 + + +-0.0020.0060.0020.000 + + +-0.0020.0070.0010.000 + + +-0.0020.0070.0020.000 + + +-0.0020.0070.0020.000 + + +-0.0020.0070.0020.000 + + +-0.0010.0070.0020.000 + + +-0.0020.0090.0020.000 + + +-0.0020.0090.0030.000 + + +-0.0020.0100.0030.000 + + +-0.0020.0110.00481.94 + + +-0.0020.0100.0040.000 + + +-0.0020.0110.0040.000 + + +-0.0020.0110.0040.000 + + +-0.0030.0110.0040.000 + + +-0.0020.0120.0040.000 + + +-0.0020.0120.0040.000 + + +-0.0030.0130.0040.000 + + +-0.0030.0130.00581.94 + + +-0.0040.0140.0060.000 + + +-0.0040.0130.0050.000 + + +-0.0020.0140.0060.000 + + +-0.0020.0140.0060.000 + + +-0.0020.0140.0060.000 + + +-0.0020.0140.0060.000 + + +-0.0020.0140.0060.000 + + +-0.0020.0140.0060.000 + + +-0.0020.0150.0060.000 + + +-0.0020.0150.0060.000 + + +-0.0020.0140.0070.000 + + +-0.0020.0140.0060.000 + + +-0.0020.0140.0080.000 + + +-0.0040.0140.0070.000 + + +-0.0020.0140.0070.000 + + +-0.0020.0140.0070.000 + + +-0.0020.0140.0070.000 + + +-0.0020.0140.007-81.94 + + +-0.0020.0140.0070.000 + + +-0.0020.0130.007-81.94 + + +-0.0020.0140.007-81.94 + + +-0.0020.0120.007-81.94 + + +-0.0020.0120.0060.000 + + +-0.0020.0120.0060.000 + + +-0.0010.0120.0070.000 + + +-0.0010.0120.00681.94 + + +-0.0010.0110.0060.000 + + +-0.0010.0110.0070.000 + + +-0.0020.0110.0070.000 + + +-0.0020.0110.0060.000 + + +-0.0020.0090.007-81.94 + + +-0.0010.0080.0060.000 + + +-0.0020.0080.00681.94 + + +-0.0020.0080.00681.94 + + +-0.0020.0070.0060.000 + + +-0.0010.0070.00681.94 + + +-0.0020.0060.0050.000 + + +-0.0020.0070.00681.94 + + +-0.0020.0060.0050.000 + + +-0.0020.0060.0050.000 + + +-0.0020.0070.0060.000 + + +-0.0020.0060.0050.000 + + +-0.0020.0060.0040.000 + + +-0.0030.0060.0060.000 + + +-0.0020.0060.0060.000 + + +-0.0010.0050.0060.000 + + +-0.0020.0050.0050.000 + + +-0.0020.0060.0050.000 + + +-0.0030.0050.006-81.94 + + +-0.0030.0050.0060.000 + + +-0.0020.0060.0040.000 + + +-0.0020.0060.0040.000 + + +-0.0020.0060.0040.000 + + +-0.0020.0060.0040.000 + + +-0.0020.0060.0040.000 + + +-0.0020.0060.0040.000 + + +-0.0030.0060.004-81.94 + + +-0.0040.0060.004-81.94 + + +-0.0040.0060.004-81.94 + + +-0.0030.0060.004-81.94 + + +-0.0020.0060.0030.000 + + +-0.0040.0060.0040.000 + + +-0.0030.0070.0040.000 + + +-0.0040.0060.0030.000 + + +-0.0040.0070.0040.000 + + +-0.0040.0070.0040.000 + + +-0.0050.0070.0040.000 + + +-0.0060.0080.0030.000 + + +-0.0060.0080.0030.000 + + +-0.0060.0090.0040.000 + + +-0.0060.0090.0040.000 + + +-0.0060.0090.0040.000 + + +-0.0070.0100.0040.000 + + +-0.0070.0110.0040.000 + + +-0.0070.0110.0040.000 + + +-0.0060.0120.0060.000 + + +-0.0070.0120.0040.000 + + +-0.0070.0130.0050.000 + + +-0.0070.0140.0060.000 + + +-0.0070.0130.0060.000 + + +-0.0070.0140.0050.000 + + +-0.0080.0140.0040.000 + + +-0.0080.0150.0050.000 + + +-0.0080.0160.0050.000 + + +-0.0070.0160.0050.000 + + +-0.0070.0170.0050.000 + + +-0.0080.0170.0060.000 + + +-0.0090.0170.0060.000 + + +-0.0080.0170.0060.000 + + +-0.0090.0190.0050.000 + + +-0.0090.0180.0060.000 + + +-0.0090.0180.006-81.94 + + +-0.0090.0180.0050.000 + + +-0.0080.0190.0060.000 + + +-0.0090.0210.0060.000 + + +-0.0090.0200.0060.000 + + +-0.0100.0200.0040.000 + + +-0.0090.0190.0040.000 + + +-0.0090.0210.0050.000 + + +-0.0090.0210.0050.000 + + +-0.0080.0200.0050.000 + + +-0.0090.0190.0060.000 + + +-0.0080.0200.0060.000 + + +-0.0090.0210.0060.000 + + +-0.0090.0200.006-81.94 + + +-0.0080.0200.0060.000 + + +-0.0090.0190.006-81.94 + + +-0.0100.0190.006-81.94 + + +-0.0080.0190.0040.000 + + +-0.0090.0190.005-81.94 + + +-0.0080.0180.006-81.94 + + +-0.0080.0180.006-81.94 + + +-0.0090.0170.006-81.94 + + +-0.0080.0170.005-81.94 + + +-0.0080.0160.0050.000 + + +-0.0080.0160.004-81.94 + + +-0.0070.0160.0040.000 + + +-0.0070.0150.004-81.94 + + +-0.0070.0140.004-81.94 + + +-0.0070.0140.0040.000 + + +-0.0070.0130.004-81.94 + + +-0.0060.0130.004-81.94 + + +-0.0060.0110.0040.000 + + +-0.0060.0120.0040.000 + + +-0.0050.0110.0040.000 + + +-0.0050.0100.004-81.94 + + +-0.0040.0090.004-81.94 + + +-0.0040.0090.004-81.94 + + +-0.0040.0090.004-81.94 + + +-0.0040.0080.003-81.94 + + +-0.0040.0070.003-81.94 + + +-0.0030.0070.003-81.94 + + +-0.0030.0060.002-81.94 + + +-0.0030.0060.002-81.94 + + +-0.0030.0060.003-81.94 + + +-0.0030.0040.0030.000 + + +-0.0030.0040.004-81.94 + + +-0.0030.0030.0030.000 + + +-0.0020.0020.003-81.94 + + +-0.0020.0020.003-81.94 + + +-0.0010.0020.004-81.94 + + +-0.0010.0010.004-81.94 + + +-0.0010.0010.004-81.94 + + +0.0000.0010.003-81.94 + + +0.0000.0010.003-81.94 + + +0.0000.0000.003-81.94 + + +0.000-0.0010.003-81.94 + + +0.000-0.0010.0020.000 + + +0.000-0.0010.0030.000 + + +0.001-0.0010.0020.000 + + +0.001-0.0020.003-81.94 + + +0.001-0.0020.0020.000 + + +0.001-0.0020.0020.000 + + +0.001-0.0030.0020.000 + + +0.002-0.0020.0020.000 + + +0.001-0.0010.0020.000 + + +0.002-0.0020.0020.000 + + +0.002-0.0020.002-81.94 + + +0.002-0.0020.003-81.94 + + +0.002-0.0020.002-81.94 + + +0.002-0.0020.003-81.94 + + +0.002-0.0010.0020.000 + + +0.002-0.0020.004-81.94 + + +0.002-0.0020.0020.000 + + +0.001-0.0020.0040.000 + + +0.001-0.0020.0030.000 + + +0.001-0.0010.004-81.94 + + +0.002-0.0010.0030.000 + + +0.0010.0020.004-81.94 + + +0.0010.0040.0050.000 + + +0.0010.0070.0050.000 + + +0.0010.0090.007-81.94 + + +0.0010.0120.007-81.94 + + +0.0010.0160.007-81.94 + + +-0.0010.0190.008-81.94 + + +-0.0010.0220.008-81.94 + + +-0.0010.0230.008-81.94 + + +-0.0010.0250.008-81.94 + + +-0.0020.0240.009-81.94 + + +-0.0010.0220.008-81.94 + + +-0.0020.0180.007-81.94 + + +-0.0020.0140.0060.000 + + +-0.0010.0100.0050.000 + + +-0.0020.0060.004-81.94 + + +-0.0010.0020.003-81.94 + + +-0.001-0.0010.0020.000 + + +0.000-0.0050.0020.000 + + +0.000-0.0080.0020.000 + + +0.001-0.0100.001-81.94 + + +0.000-0.0110.0010.000 + + +0.001-0.0110.0010.000 + + +0.001-0.0120.001-81.94 + + +0.002-0.0120.0010.000 + + +0.002-0.011-0.001-81.94 + + +0.002-0.011-0.001-81.94 + + +0.002-0.012-0.002-81.94 + + +0.002-0.012-0.0030.000 + + +0.003-0.012-0.002-81.94 + + +0.004-0.013-0.003-81.94 + + +0.004-0.014-0.003-81.94 + + +0.004-0.015-0.004-81.94 + + +0.004-0.016-0.004-81.94 + + +0.002-0.017-0.004-81.94 + + +0.002-0.018-0.004-81.94 + + +0.003-0.018-0.0040.000 + + +0.003-0.020-0.0040.000 + + +0.003-0.021-0.004-81.94 + + +0.002-0.021-0.004-81.94 + + +0.002-0.021-0.004-81.94 + + +0.002-0.021-0.004-81.94 + + +0.002-0.021-0.004-81.94 + + +0.002-0.021-0.004-81.94 + + +0.002-0.021-0.0040.000 + + +0.002-0.021-0.004-81.94 + + +0.001-0.019-0.004-81.94 + + +0.002-0.019-0.004-81.94 + + +0.001-0.019-0.004-81.94 + + +0.002-0.019-0.003-87.96 + + +0.002-0.018-0.002-81.94 + + +0.001-0.017-0.002-81.94 + + +0.001-0.016-0.002-81.94 + + +0.001-0.016-0.001-81.94 + + +0.001-0.015-0.001-81.94 + + +-0.001-0.013-0.0010.000 + + +-0.002-0.0120.001-81.94 + + +-0.002-0.0110.0010.000 + + +-0.002-0.0090.0010.000 + + +-0.002-0.0070.0010.000 + + +-0.002-0.0070.0010.000 + + +-0.002-0.0060.001-81.94 + + +-0.003-0.0040.0010.000 + + +-0.004-0.0040.001-81.94 + + +-0.004-0.0040.001-81.94 + + +-0.004-0.0040.001-81.94 + + +-0.003-0.0030.002-81.94 + + +-0.004-0.0030.002-81.94 + + +-0.003-0.0040.003-81.94 + + +-0.003-0.0040.0020.000 + + +-0.003-0.0020.0020.000 + + +-0.003-0.0020.0030.000 + + +-0.002-0.0020.0030.000 + + +-0.0040.0000.004-81.94 + + +-0.0040.0010.004-81.94 + + +-0.0040.0030.004-81.94 + + +-0.0040.0060.0040.000 + + +-0.0040.0070.0040.000 + + +-0.0040.0090.0040.000 + + +-0.0030.0110.0050.000 + + +-0.0040.0110.0050.000 + + +-0.0040.0120.0050.000 + + +-0.0040.0140.006-81.94 + + +-0.0040.0150.0050.000 + + +-0.0040.0170.006-81.94 + + +-0.0030.0170.0060.000 + + +-0.0040.0190.007-81.94 + + +-0.0040.0190.0070.000 + + +-0.0050.0190.0070.000 + + +-0.0050.0200.0070.000 + + +-0.0040.0210.007-81.94 + + +-0.0050.0220.007-81.94 + + +-0.0060.0210.007-81.94 + + +-0.0060.0220.0070.000 + + +-0.0050.0220.007-81.94 + + +-0.0060.0220.0070.000 + + +-0.0060.0220.0070.000 + + +-0.0070.0220.0060.000 + + +-0.0070.0220.007-81.94 + + +-0.0070.0210.007-81.94 + + +-0.0070.0210.007-81.94 + + +-0.0070.0220.006-81.94 + + +-0.0070.0210.0060.000 + + +-0.0070.0200.007-81.94 + + +-0.0080.0180.0060.000 + + +-0.0070.0170.0060.000 + + +-0.0070.0160.0060.000 + + +-0.0070.0150.0060.000 + + +-0.0070.0140.0050.000 + + +-0.0070.0110.004-81.94 + + +-0.0060.0090.004-81.94 + + +-0.0060.0080.0030.000 + + +-0.0060.0060.0030.000 + + +-0.0060.0050.003-81.94 + + +-0.0040.0020.002-81.94 + + +-0.004-0.0010.0020.000 + + +-0.004-0.0030.0010.000 + + +-0.004-0.0070.001-81.94 + + +-0.002-0.0090.001-81.94 + + +-0.002-0.011-0.001-81.94 + + +-0.001-0.014-0.0010.000 + + +0.000-0.014-0.0010.000 + + +0.000-0.016-0.001-81.94 + + +0.000-0.017-0.0020.000 + + +0.000-0.019-0.003-81.94 + + +0.000-0.019-0.0040.000 + + +0.000-0.020-0.003-81.94 + + +0.001-0.021-0.003-81.94 + + +0.002-0.021-0.004-81.94 + + +0.001-0.019-0.003-81.94 + + +0.001-0.020-0.003-81.94 + + +0.002-0.019-0.003-81.94 + + +0.002-0.019-0.004-81.94 + + +0.002-0.019-0.003-81.94 + + +0.001-0.018-0.003-81.94 + + +0.001-0.017-0.001-81.94 + + +0.002-0.016-0.002-81.94 + + +0.002-0.014-0.002-81.94 + + +0.002-0.014-0.002-81.94 + + +0.001-0.012-0.0020.000 + + +0.001-0.011-0.0020.000 + + +0.002-0.011-0.0020.000 + + +0.001-0.009-0.0020.000 + + +0.001-0.007-0.0020.000 + + +0.001-0.007-0.0010.000 + + +0.001-0.007-0.0010.000 + + +0.001-0.0060.0000.000 + + +0.001-0.0060.0000.000 + + +0.001-0.005-0.0010.000 + + +0.001-0.0040.0010.000 + + +0.000-0.0020.0010.000 + + +-0.001-0.0020.0010.000 + + +0.001-0.0020.001-81.94 + + +0.000-0.0010.0010.000 + + +0.000-0.0010.0020.000 + + +0.001-0.0010.0010.000 + + +0.0010.0000.0020.000 + + +0.0010.0010.0020.000 + + +0.0010.0020.0020.000 + + +0.0000.0020.0020.000 + + +0.0000.0020.0020.000 + + +0.0010.0030.0030.000 + + +0.0010.0040.0030.000 + + +0.0010.0050.0030.000 + + +0.0010.0060.0030.000 + + +0.0020.0060.0030.000 + + +0.0020.0060.0020.000 + + +0.0010.0070.0020.000 + + +0.0010.0070.0040.000 + + +0.0020.0080.0030.000 + + +0.0010.0080.0040.000 + + +0.0010.0080.0030.000 + + +0.0010.0080.0030.000 + + +0.0010.0080.0020.000 + + +0.0010.0090.0020.000 + + +0.0010.0080.0030.000 + + +0.0000.0080.0040.000 + + +0.0000.0080.0040.000 + + +0.0000.0090.00481.94 + + +0.0000.0090.0040.000 + + +0.0010.0100.00481.94 + + +-0.0010.0110.0040.000 + + +-0.0010.0110.0040.000 + + +-0.0020.0110.0040.000 + + +-0.0010.0110.0040.000 + + +-0.0010.0110.0040.000 + + +-0.0010.0100.0040.000 + + +-0.0010.0100.0040.000 + + +-0.0020.0110.0030.000 + + +-0.0010.0090.0030.000 + + +-0.0010.0070.0030.000 + + +-0.0010.0070.0020.000 + + +-0.0010.0070.0030.000 + + +-0.0010.0060.0020.000 + + +-0.0010.0040.00381.94 + + +-0.0020.0040.0030.000 + + +-0.0010.0030.0020.000 + + +-0.0020.0020.0030.000 + + +-0.0020.0020.0020.000 + + +-0.0010.0000.0010.000 + + +-0.001-0.0010.0010.000 + + +0.000-0.0020.0010.000 + + +-0.001-0.0020.0000.000 + + +-0.001-0.003-0.0010.000 + + +-0.001-0.003-0.0010.000 + + +-0.001-0.004-0.0010.000 + + +-0.001-0.006-0.001-81.94 + + +-0.002-0.006-0.0020.000 + + +-0.001-0.007-0.0020.000 + + +-0.001-0.007-0.0010.000 + + +0.000-0.007-0.0020.000 + + +-0.001-0.008-0.0020.000 + + +-0.001-0.008-0.0030.000 + + +0.001-0.008-0.0020.000 + + +0.001-0.009-0.0020.000 + + +0.000-0.009-0.0020.000 + + +0.001-0.009-0.0020.000 + + +0.000-0.009-0.0020.000 + + +0.001-0.009-0.002-81.94 + + +0.000-0.009-0.002-81.94 + + +0.001-0.008-0.002-81.94 + + +0.000-0.007-0.0020.000 + + +0.001-0.007-0.0010.000 + + +0.001-0.006-0.0020.000 + + +0.001-0.006-0.0010.000 + + +0.001-0.005-0.0010.000 + + +0.001-0.003-0.0010.000 + + +0.001-0.002-0.0010.000 + + +0.000-0.0020.0000.000 + + +0.000-0.0010.0010.000 + + +-0.0010.0010.0010.000 + + +-0.0010.0010.0020.000 + + +-0.0010.0010.0010.000 + + +-0.0010.0020.0020.000 + + +-0.0010.0040.0030.000 + + +-0.0020.0040.0020.000 + + +-0.0020.0060.0020.000 + + +-0.0020.0060.0020.000 + + +-0.0020.0060.0040.000 + + +-0.0020.0070.0030.000 + + +-0.0020.0070.0030.000 + + +-0.0040.0070.0040.000 + + +-0.0020.0070.0030.000 + + +-0.0040.0080.0020.000 + + +-0.0020.0070.0020.000 + + +-0.0030.0070.00281.94 + + +-0.0030.0060.0030.000 + + +-0.0040.0060.0030.000 + + +-0.0040.0060.0020.000 + + +-0.0020.0070.0030.000 + + +-0.0040.0070.0040.000 + + +-0.0040.0070.0040.000 + + +-0.0030.0060.0040.000 + + +-0.0030.0040.0040.000 + + +-0.0040.0040.0040.000 + + +-0.0030.0040.0040.000 + + +-0.0020.0040.0040.000 + + +-0.0020.0040.0030.000 + + +-0.0030.0020.0030.000 + + +-0.0020.0030.0030.000 + + +-0.0010.0020.0020.000 + + +-0.0010.0010.0020.000 + + +-0.0010.0020.0020.000 + + +-0.0020.0000.0010.000 + + +-0.0020.0010.0010.000 + + +-0.0010.0010.0020.000 + + +-0.0010.0010.0010.000 + + +-0.0010.0000.0010.000 + + +-0.0010.0000.0010.000 + + +0.0000.0010.0010.000 + + +-0.0010.0000.0020.000 + + +-0.001-0.0010.0020.000 + + +0.000-0.0010.0010.000 + + +0.001-0.0010.0020.000 + + +0.000-0.0010.0010.000 + + +0.001-0.0010.0010.000 + + +0.000-0.0010.0020.000 + + +-0.001-0.0010.0010.000 + + +-0.001-0.0010.0000.000 + + +-0.001-0.0010.0000.000 + + +-0.001-0.0010.0000.000 + + +-0.001-0.002-0.001-81.94 + + +-0.001-0.0010.0000.000 + + +-0.001-0.0010.0000.000 + + +0.000-0.0010.0000.000 + + +0.000-0.0020.0000.000 + + +-0.001-0.0020.0000.000 + + +0.001-0.002-0.0010.000 + + +0.000-0.0020.0000.000 + + +-0.001-0.0020.0000.000 + + +-0.001-0.0020.0010.000 + + +-0.001-0.0020.0000.000 + + +-0.001-0.0020.0000.000 + + +0.000-0.0020.0000.000 + + +0.001-0.0020.0010.000 + + +0.000-0.0020.0000.000 + + +0.001-0.0020.0010.000 + + +0.000-0.002-0.0010.000 + + +0.000-0.0020.0010.000 + + +0.001-0.0010.0000.000 + + +0.000-0.0010.0010.000 + + +0.001-0.0010.0010.000 + + +0.0020.0000.0010.000 + + + + + + + diff --git a/tests/fixtures/geo-range-11-01-26/M010HR6K.OA0H b/tests/fixtures/geo-range-11-01-26/M010HR6K.OA0H new file mode 100755 index 0000000..5bd95ff Binary files /dev/null and b/tests/fixtures/geo-range-11-01-26/M010HR6K.OA0H differ diff --git a/tests/fixtures/geo-range-11-01-26/M010HR6K_OA0H_XML.XML b/tests/fixtures/geo-range-11-01-26/M010HR6K_OA0H_XML.XML new file mode 100755 index 0000000..ea07e8e --- /dev/null +++ b/tests/fixtures/geo-range-11-01-26/M010HR6K_OA0H_XML.XML @@ -0,0 +1,167 @@ + + +8.0 +Full Histogram +BE11010 +V 10.72-8.17 MiniMate Plus +M010HR6K.OA0H +17:02:34 +2019-01-08 +17:20:00 +2019-01-08 + +Tran +Vert +Long +MicL + +18.00 +1 minute +1024 sps +6.8 Volts +December 17, 2018 by Instantel +in/s and dB(L) +Wampum Ave-ECMS 29301-215 Joseph St +Brayman Construction +Terra-Mechanics Inc - D. Bartholomae +Loc, #1 - 215 Joseph Street + +1.250 +in/s + + +0.008 +in/s + + +0.009 +in/s + + +0.005 +in/s + + +11 +Hz + + +73 +Hz + + +16 +Hz + +17:11:34 +2019-01-08 +17:03:34 +2019-01-08 +17:11:34 +2019-01-08 + +0.009 +in/s + +17:11:34 +2019-01-08 +Linear Weighting + +134.1 +dB(L) + +17:03:34 +2019-01-08 + +9.7 +Hz + +7.2 Hz. +4.3 +Passed +7.6 Hz. +3.4 +Passed +7.2 Hz. +3.8 +Passed +20.1 Hz. +583 mv +Passed + + +2019-01-08 17:02:33 - 2019-01-08 17:20:00 "Event Recorded Modem Exit" + + + Tran Peak in/s + Tran Freq Hz + Vert Peak in/s + Vert Freq Hz + Long Peak in/s + Long Freq Hz + Geo PVS in/s + MicL Peak psi(L) + MicL Peak dB(L) + MicL Freq Hz + + + + +0.003470.009730.002>1000.0090.015134.19.7 + + +0.003210.007270.002850.0070.00087.96>100 + + +0.004200.004>1000.002>1000.0050.003119.17.5 + + +0.003340.002>1000.002510.0030.00081.94>100 + + +0.003510.002>1000.002>1000.0030.00091.4839 + + +0.004120.004160.002>1000.0050.00091.4813 + + +0.002510.002640.002>1000.0030.00081.94>100 + + +0.003120.002>1000.002>1000.0040.00081.94>100 + + +0.008110.005130.005160.0090.00091.4819 + + +0.006130.004140.004510.0070.00091.4820 + + +0.003570.002>1000.002>1000.0030.00087.96>100 + + +0.003470.002>1000.002>1000.0030.00091.4813 + + +0.002>1000.002>1000.002>1000.0040.00095.922.5 + + +0.003130.002>1000.002850.0040.00093.989.1 + + +0.003170.002850.002730.0030.00081.94>100 + + +0.002>1000.002>1000.002>1000.0040.00087.96>100 + + +0.003730.002>1000.003200.0040.00091.486.1 + + +0.002370.002>1000.002>1000.0030.00091.4818 + + + + + + diff --git a/tests/test_bw_file_fields.py b/tests/test_bw_file_fields.py index 4027f7f..fc57beb 100644 --- a/tests/test_bw_file_fields.py +++ b/tests/test_bw_file_fields.py @@ -206,3 +206,73 @@ def test_mic_peak_in_psi(): # Blastware: MicL PSPL 106.0 dB(L) = 20 uPa x 10^(106/20) = 3.990 Pa = 5.787e-4 psi. ev = read_blastware_file(_FIX / "decode-checker-10-29-26/M529L4XQ.R30H") assert ev.peak_values.micl == pytest.approx(5.787e-4, rel=0.01) + + +# ── The geophone range: Normal or Sensitive ───────────────────────────────── +# In the setup's channel blocks, the byte 29 after each geophone label is the +# range: 0x00 Normal (10 in/s full scale), 0x01 Sensitive (1.25 in/s). It +# matches Blastware's GeoRange on 70,042 / 70,042 DL2 events, all three +# channels agreeing on every one (35 Sensitive), measured 2026-11-01. Until +# now SFM assumed Normal, so a Sensitive event read 8x high. + +from minimateplus.event_file_io import _setup_name_at # noqa: E402 + + +@pytest.mark.parametrize("rel,want", [ + ("bw-import-fields-10-29-26/R352HIUI.F40W", 0), + ("geo-range-11-01-26/K557J1KB.RQ0W", 1), # waveform, XML GeoRange 1.250 + ("geo-range-11-01-26/M010HR6K.OA0H", 1), # histogram, XML GeoRange 1.250 +]) +def test_geo_range_comes_from_the_file(rel, want): + assert read_blastware_file(_FIX / rel).geo_range == want + + +# (file, Blastware's Tran / Vert / Long PPV and Peak Vector Sum, from its XML) +@pytest.mark.parametrize("rel,peaks", [ + ("geo-range-11-01-26/K557J1KB.RQ0W", ("0.019", "0.055", "0.019", "0.061")), + ("geo-range-11-01-26/M010HR6K.OA0H", ("0.008", "0.009", "0.005", "0.009")), +]) +def test_sensitive_range_peaks_are_not_8x(rel, peaks): + pv = read_blastware_file(_FIX / rel).peak_values + for got, want in zip((pv.tran, pv.vert, pv.long, pv.peak_vector_sum), peaks): + assert abs(got - float(want)) <= 0.0005 + 1e-9, (got, want) + + +def test_channels_that_disagree_give_no_range_and_a_problem(): + raw = bytearray((_FIX / "geo-range-11-01-26/K557J1KB.RQ0W").read_bytes()) + i = raw.find(b"\x00\x00\x01Vert", _setup_name_at(bytes(raw))) + raw[i + 3 + 29] = 0x00 # Vert Normal, Tran / Long Sensitive + ev = decode_blastware_bytes(bytes(raw), name=None) + assert ev.geo_range is None + assert any("range" in p for p in ev.decode_problems) + + +def test_the_h5_takes_the_events_range(tmp_path): + import h5py + from sfm import event_hdf5 + ev = read_blastware_file(_FIX / "geo-range-11-01-26/K557J1KB.RQ0W") + event_hdf5.write_event_hdf5(tmp_path / "e.h5", ev, serial="BE9557") + with h5py.File(tmp_path / "e.h5", "r") as f: + assert f.attrs["geo_range"] == "sensitive" + assert abs(float(abs(f["samples/Vert"][:]).max()) - 0.055) <= 0.0005 + 1e-9 + + +def test_an_imported_file_and_the_backfill_store_its_range(tmp_path): + import h5py + import scripts.backfill_sidecars as backfill + from sfm import event_hdf5 + from sfm.waveform_store import WaveformStore + + src = _FIX / "geo-range-11-01-26/K557J1KB.RQ0W" + store = WaveformStore(tmp_path / "waveforms") + ev, _ = store.save_imported_bw(src.read_bytes(), source_path=src) + h5 = store.hdf5_path_for("BE9557", src.name) + with h5py.File(h5, "r") as f: + assert f.attrs["geo_range"] == "sensitive" + + # A file stored before this fix carries "normal"; the backfill rewrites it. + event_hdf5.write_event_hdf5(h5, ev, serial="BE9557", geo_range="normal") + assert backfill.main(["--store-root", str(tmp_path / "waveforms"), + "--db-path", str(tmp_path / "seismo_relay.db"), "--force"]) == 0 + with h5py.File(h5, "r") as f: + assert f.attrs["geo_range"] == "sensitive" diff --git a/tests/test_check_s3_decode.py b/tests/test_check_s3_decode.py index f9640f1..03f873d 100644 --- a/tests/test_check_s3_decode.py +++ b/tests/test_check_s3_decode.py @@ -28,7 +28,8 @@ def test_find_pairs_dedupes_and_pairs(tmp_path): def test_check_event_rows_and_attrs(): out = run.check_event("M007HVWF.K30W", str(FIX / "M007HVWF.K30W"), str(FIX / "M007HVWF_K30W_XML.XML")) assert out["attrs"]["range"] == "1.250" and out["attrs"]["model"] == "MiniMate Plus" - assert any(r[0] == "TranPPV" and r[1] == "mismatch" for r in out["results"]) + # clipped at its own 1.250 ceiling: accepted under the saturation carve-out + assert ["TranPPV", "accepted"] in [r[:2] for r in out["results"]] def test_bad_input_is_one_error_row(tmp_path): @@ -128,7 +129,7 @@ def test_compare_to_marks_the_summary(tmp_path): def test_file_prints_one_event(tmp_path, capsys): assert run.main([str(FIX), str(FIX), "--file", "M007HVWF.K30W"]) == 0 out = capsys.readouterr().out - assert any("TranPPV" in line and "mismatch" in line for line in out.splitlines()) + assert any("TranPPV" in line and "accepted" in line for line in out.splitlines()) # ── Final review fixes ────────────────────────────────────────────────────── diff --git a/tests/test_decode_check.py b/tests/test_decode_check.py index 6669772..d030611 100644 --- a/tests/test_decode_check.py +++ b/tests/test_decode_check.py @@ -114,8 +114,23 @@ def test_clipped_normal_range_is_accepted(): assert (res[f].verdict, res[f].carveout) == ("accepted", "saturation") -def test_sensitive_range_8x_stays_a_mismatch(): +def test_a_clipped_sensitive_event_is_accepted_at_its_own_ceiling(): + # SFM reads the 1.250 range from the file; the clipped channels sit at 1.2506. res = _results("M007HVWF.K30W", CARVEOUTS) + assert res["GeoRange"].verdict == "match" and res["samples.Tran"].verdict == "match" + for f in ("TranPPV", "PeakVectorSum"): + assert (res[f].verdict, res[f].carveout) == ("accepted", "saturation") + + +def test_the_carveout_never_accepts_an_8x_value(): + # What SFM produced while it assumed Normal on a Sensitive unit: 8x high. + # The saturation rule must leave it a mismatch. + raw = (FIX / "M007HVWF.K30W").read_bytes() + side = sfm_side(raw) + side.values.update(TranPPV=10.005, VertPPV=10.005, LongPPV=10.005, PeakVectorSum=17.33) + side.geo_ips_per_count = 10.0 / 32000 + res = {r.field: r for r in compare(side, parse_xml_report_file(FIX / "M007HVWF_K30W_XML.XML"), + CARVEOUTS)} assert res["TranPPV"].verdict == "mismatch" and res["samples.Tran"].verdict == "mismatch" assert res["PeakVectorSum"].verdict == "mismatch" @@ -133,13 +148,14 @@ def test_pvs_carveout_needs_oorange_from_blastware(): def test_pvs_carveout_needs_the_clipped_channel_at_the_ceiling(): - # 1.250 range, Blastware PVS OORANGE; an UNclipped channel's 8x value happens to land - # in the 1.250 band -- that must not let SFM's 8x vector sum through. + # 1.250 range, Blastware PVS OORANGE, but no channel Blastware clamped: an + # UNclipped channel's 8x value landing in the 1.250 band must not let a vector + # sum through, even one inside the sqrt(3) bound. raw = (FIX / "M007HVWF.K30W").read_bytes() ref = parse_xml_report_file(FIX / "M007HVWF_K30W_XML.XML") - ref.scalars["TranPPV"] = "0.157" + ref.scalars.update(TranPPV="0.157", VertPPV="0.157", LongPPV="0.157") side = sfm_side(raw) - side.values["TranPPV"] = 1.256 + side.values.update(TranPPV=1.256, PeakVectorSum=2.0) res = {r.field: r for r in compare(side, ref, CARVEOUTS)} assert res["PeakVectorSum"].verdict == "mismatch" @@ -147,3 +163,12 @@ def test_pvs_carveout_needs_the_clipped_channel_at_the_ceiling(): def test_interval_mic_psi_matches(): # psi(L) report: every interval's "MicL Peak psi(L)" now converts right assert _results("T004JTRF.ME0H")["intervals.MicL Peak psi(L)"].verdict == "match" + + +def test_a_sensitive_range_event_now_matches(): + gr = FIX.parent / "geo-range-11-01-26" + raw = (gr / "K557J1KB.RQ0W").read_bytes() + res = {r.field: r for r in compare(sfm_side(raw), parse_xml_report_file(gr / "K557J1KB_RQ0W_XML.XML"))} + for f in ("GeoRange", "TranPPV", "VertPPV", "LongPPV", "PeakVectorSum", + "samples.Tran", "samples.Vert", "samples.Long"): + assert res[f].verdict == "match", (f, res[f])