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,8 +1,8 @@
|
||||
"""Đọc dữ liệu Volve: horizon xuất từ OpenWorks, well picks (cột cố định) và checkshot VSP.
|
||||
"""Readers for Volve data: horizons exported from OpenWorks, well picks (fixed-width columns) and VSP checkshots.
|
||||
|
||||
Quy ước: MD tính từ RKB (54.9 m trên MSL), TVDSS và TWT tính từ MSL, toạ độ ED50 / UTM 31N.
|
||||
Lưới horizon là lưới ST10010 (12.5 × 12.5 m). Các file ghi ST0202 cũng đánh số IL/XL theo lưới này
|
||||
(affine lệch < 0.11 m trong ROI giếng).
|
||||
Conventions: MD is measured from RKB (54.9 m above MSL), TVDSS and TWT from MSL; coordinates are ED50 / UTM 31N.
|
||||
The horizon grid is the ST10010 grid (12.5 × 12.5 m). Files labelled ST0202 also number IL/XL on this grid
|
||||
(affine discrepancy < 0.11 m within the well ROI).
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
@@ -19,7 +19,7 @@ from ml_porosity.data.geometry import SurveyGeometry
|
||||
VOLVE_RKB_M = 54.9
|
||||
VOLVE_EPSG = 23031
|
||||
|
||||
# 9 giếng có PHIF (D3) và F-15 A (không có PHIF nhưng có VSP checkshot), như ROI ở docs/research/volve-inventory.md
|
||||
# The 9 wells with PHIF (D3) plus F-15 A (no PHIF but a VSP checkshot), matching the ROI in docs/research/volve-inventory.md
|
||||
VOLVE_KEY_WELLS = ("NO 15/9-F-1", "NO 15/9-F-1 A", "NO 15/9-F-1 B", "NO 15/9-F-1 C", "NO 15/9-F-11 A",
|
||||
"NO 15/9-F-11 B", "NO 15/9-F-11 T2", "NO 15/9-F-12", "NO 15/9-F-15 A", "NO 15/9-F-15 D")
|
||||
|
||||
@@ -28,7 +28,7 @@ VOLVE_KEY_WELLS = ("NO 15/9-F-1", "NO 15/9-F-1 A", "NO 15/9-F-1 B", "NO 15/9-F-1
|
||||
class Horizon:
|
||||
survey: str
|
||||
name: str
|
||||
domain: str # "TIME" (TWT ms) hoặc "DEPTH" (m)
|
||||
domain: str # "TIME" (TWT ms) or "DEPTH" (m)
|
||||
il: np.ndarray
|
||||
xl: np.ndarray
|
||||
x: np.ndarray
|
||||
@@ -43,7 +43,7 @@ class Horizon:
|
||||
return {(int(i), int(j)): float(v) for i, j, v in zip(self.il, self.xl, self.z)}
|
||||
|
||||
def at(self, il: float, xl: float, radius: int = 1) -> float:
|
||||
"""Trung vị z của các nút trong cửa sổ (2·radius+1)² quanh bin gần nhất; NaN nếu không có nút."""
|
||||
"""Median z of the nodes within the (2·radius+1)² window around the nearest bin; NaN if there are no nodes."""
|
||||
i0, j0 = int(np.rint(il)), int(np.rint(xl))
|
||||
vals = [self.lut[k] for di in range(-radius, radius + 1) for dj in range(-radius, radius + 1)
|
||||
if (k := (i0 + di, j0 + dj)) in self.lut]
|
||||
@@ -51,8 +51,8 @@ class Horizon:
|
||||
|
||||
|
||||
def read_horizon(path: str | Path) -> Horizon:
|
||||
"""File `*.dat` dạng: các dòng chú thích `#`, 4 dòng metadata (survey, tên, người minh giải, miền),
|
||||
sau đó mỗi dòng `IL,XL,X,Y,Z`. Một số file để trống dòng survey (chỉ có `=`)."""
|
||||
"""`*.dat` file layout: `#` comment lines, 4 metadata lines (survey, name, interpreter, domain),
|
||||
followed by one `IL,XL,X,Y,Z` row per line. Some files leave the survey line empty (only `=`)."""
|
||||
meta, rows = [], []
|
||||
with open(path, errors="replace") as fh:
|
||||
for line in fh:
|
||||
@@ -78,7 +78,7 @@ PICK_COLUMNS = {"Well name": "well", "Surface name": "surface", "Obs#": "obs", "
|
||||
|
||||
|
||||
def read_well_picks(path: str | Path) -> pd.DataFrame:
|
||||
"""`Well_picks_Volve_v1.dat`: mỗi giếng có một dòng tiêu đề và một dòng gạch `---` xác định độ rộng cột.
|
||||
"""`Well_picks_Volve_v1.dat`: each well has a header line and a `---` dash line that defines the column widths.
|
||||
Qlf: ER eroded, FP faulted pick, FO faulted out, NL not logged, NR not reached."""
|
||||
lines = Path(path).read_text(errors="replace").splitlines()
|
||||
spans, rows = None, []
|
||||
@@ -105,8 +105,8 @@ def read_well_picks(path: str | Path) -> pd.DataFrame:
|
||||
|
||||
|
||||
def read_checkshot(path: str | Path) -> pd.DataFrame:
|
||||
"""`TZV_TIME_CHECKSHOT_*.ASC` (3 cột MD, TVD-MSL, TWT ms). F-11 T2 ghi MD từ RKB, F-15 A ghi MD từ MSL
|
||||
(`MDMSL`), nên MD được quy về RKB. Trả về cột md (RKB), tvdss (dương xuống) và twt_ms."""
|
||||
"""`TZV_TIME_CHECKSHOT_*.ASC` (3 columns: MD, TVD-MSL, TWT ms). F-11 T2 records MD from RKB and F-15 A
|
||||
from MSL (`MDMSL`), so MD is referred to RKB. Returns columns md (RKB), tvdss (positive down) and twt_ms."""
|
||||
text = Path(path).read_text(errors="replace")
|
||||
rows = []
|
||||
for ln in text.splitlines():
|
||||
|
||||
Reference in New Issue
Block a user