P2 diagnosis on dev, P3 dev experiments, lock protocol_p3
- P2: SMC tie posterior (numpy + torch), RML/soft-DTW losses, bank training, D2 synthetic generator, scripts 09-13, protocol_p2 (locked) and its outcome (G-B failed; H1 not rejected, H3 rejected, H4 not rejected). - Diagnosis on dev realizations 900/901 only (scripts 14-17, run_p3_dev.sh): posterior screen, SMC stability (P = 1024, K = 1), sigma_a misspecification stress and training, H3 with the SMC posterior, F3 placement on sigma_post. - protocol_p3: H2 split into H2a (posterior-mean labels vs point ties) and H2b (RML vs posterior mean as a function of sigma_post); H3 descriptive only; sigma_a arm; new D2 config d2_synth_p3.yaml; main grid on realizations 8-15. Locked by configs/protocol_p3.sha256 and tag protocol-p3. - runlog: per-run logs and runtime index (logs/index.csv). - Docs: plan §12 items 10-11, theory, technical overview, report; wording aligned with Gunning & Glinsky (2006): the tie posterior is not claimed as new. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
"""Synthetic seismogram và đo lệch thời gian giữa synthetic và seismic."""
|
||||
"""Synthetic seismograms and time-shift measurement between synthetic and seismic."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
@@ -6,7 +6,7 @@ import numpy as np
|
||||
|
||||
|
||||
def reflectivity_from_ai(ai: np.ndarray) -> np.ndarray:
|
||||
"""r[i] = (AI[i+1] − AI[i]) / (AI[i+1] + AI[i]), đặt tại mẫu i; mẫu cuối = 0."""
|
||||
"""r[i] = (AI[i+1] − AI[i]) / (AI[i+1] + AI[i]), placed at sample i; the last sample is 0."""
|
||||
ai = np.asarray(ai, dtype=float)
|
||||
r = np.zeros_like(ai)
|
||||
r[:-1] = (ai[1:] - ai[:-1]) / (ai[1:] + ai[:-1])
|
||||
@@ -14,7 +14,7 @@ def reflectivity_from_ai(ai: np.ndarray) -> np.ndarray:
|
||||
|
||||
|
||||
def shift_signal(x: np.ndarray, shift_ms: float, dt_ms: float) -> np.ndarray:
|
||||
"""Dịch chuỗi theo thời gian (dương = muộn hơn) bằng nội suy tuyến tính; ngoài biên = 0."""
|
||||
"""Time-shift a series (positive = later) by linear interpolation; zero outside the support."""
|
||||
t = np.arange(len(x)) * dt_ms
|
||||
return np.interp(t - shift_ms, t, x, left=0.0, right=0.0)
|
||||
|
||||
@@ -27,7 +27,7 @@ def ncc(a: np.ndarray, b: np.ndarray) -> float:
|
||||
|
||||
|
||||
def best_shift(syn: np.ndarray, seis: np.ndarray, dt_ms: float, max_ms: float, step_ms: float = 0.5):
|
||||
"""Dịch synthetic trong ±max_ms để cực đại tương quan với seismic. Trả về (shift_ms, r)."""
|
||||
"""Shift the synthetic within ±max_ms to maximise its correlation with the seismic. Returns (shift_ms, r)."""
|
||||
shifts = np.arange(-max_ms, max_ms + step_ms / 2, step_ms)
|
||||
rs = np.array([ncc(shift_signal(syn, s, dt_ms), seis) for s in shifts])
|
||||
k = int(np.nanargmax(rs))
|
||||
@@ -42,8 +42,8 @@ def local_shifts(
|
||||
hop_ms: float = 20.0,
|
||||
max_ms: float = 16.0,
|
||||
):
|
||||
"""Lệch thời gian cục bộ trong cửa sổ trượt (taper Hann). Trả về (tâm cửa sổ theo chỉ số
|
||||
mẫu, shift_ms, r). Dương nghĩa là synthetic cần dịch muộn hơn để khớp seismic."""
|
||||
"""Local time shifts in a sliding window (Hann taper). Returns (window centres as sample
|
||||
indices, shift_ms, r). Positive means the synthetic must be shifted later to match the seismic."""
|
||||
n = int(round(win_ms / dt_ms))
|
||||
hop = max(1, int(round(hop_ms / dt_ms)))
|
||||
taper = np.hanning(n)
|
||||
|
||||
Reference in New Issue
Block a user