Commit 053ae8f2 authored by Jim King's avatar Jim King Committed by Jørgen Lind
Browse files

tweaks for mutes

parent dab662c2
import os
from pathlib import Path from pathlib import Path
from typing import Tuple from typing import Tuple
import pytest import pytest
import openvds import openvds
from segyimport_test_config import test_data_dir, ImportExecutor, TempVDSGuard, TempScanFileGuard from segyimport_test_config import test_data_dir, ImportExecutor, TempVDSGuard
@pytest.fixture @pytest.fixture
...@@ -14,7 +15,8 @@ def output_vds() -> TempVDSGuard: ...@@ -14,7 +15,8 @@ def output_vds() -> TempVDSGuard:
@pytest.fixture @pytest.fixture
def mutes_segy() -> str: def mutes_segy() -> str:
return "C:\\temp\\SEGY\\mutes\\ST0202R08_PS_PrSDM_CIP_gathers_in_PP_Time_modified.segy" return os.path.join(test_data_dir, "Plugins", "ImportPlugins", "SEGYUnittest", "Mutes",
"ST0202R08_PS_PrSDM_CIP_gathers_in_PP_Time_modified_subset.segy")
@pytest.fixture @pytest.fixture
...@@ -22,7 +24,7 @@ def mutes_executor(mutes_segy, output_vds) -> Tuple[ImportExecutor, TempVDSGuard ...@@ -22,7 +24,7 @@ def mutes_executor(mutes_segy, output_vds) -> Tuple[ImportExecutor, TempVDSGuard
"""Fixture to setup an ImportExecutor with common options for SEGY with mutes""" """Fixture to setup an ImportExecutor with common options for SEGY with mutes"""
ex = ImportExecutor() ex = ImportExecutor()
ex.add_arg("--mutes") ex.add_arg("--mute")
ex.add_arg("--prestack") ex.add_arg("--prestack")
ex.add_args(["--vdsfile", output_vds.filename]) ex.add_args(["--vdsfile", output_vds.filename])
...@@ -94,4 +96,4 @@ def test_mutes_read(mutes_executor): ...@@ -94,4 +96,4 @@ def test_mutes_read(mutes_executor):
for trace_index in range(dim1_size): for trace_index in range(dim1_size):
if trace_flag_request.data[trace_index] > 0: if trace_flag_request.data[trace_index] > 0:
assert 0 < mutes_request.data[trace_index * 2] < mutes_request.data[trace_index * 2 + 1] assert 0 <= mutes_request.data[trace_index * 2] < mutes_request.data[trace_index * 2 + 1]
...@@ -3339,7 +3339,7 @@ main(int argc, char* argv[]) ...@@ -3339,7 +3339,7 @@ main(int argc, char* argv[])
assert(!segyTraceHeaderBuffer || segyTraceHeaderPitch[pitchCheckDimension] == SEGY::TraceHeaderSize); assert(!segyTraceHeaderBuffer || segyTraceHeaderPitch[pitchCheckDimension] == SEGY::TraceHeaderSize);
assert(!offsetBuffer || offsetPitch[pitchCheckDimension] == 1); assert(!offsetBuffer || offsetPitch[pitchCheckDimension] == 1);
assert(!azimuthBuffer || azimuthPitch[pitchCheckDimension] == 1); assert(!azimuthBuffer || azimuthPitch[pitchCheckDimension] == 1);
assert(!muteBuffer || mutePitch[pitchCheckDimension] == 2); assert(!muteBuffer || mutePitch[pitchCheckDimension] == 1);
const auto segmentInfoListsSize = fileInfo.IsOffsetSorted() ? fileInfo.m_segmentInfoListsByOffset.size() : fileInfo.m_segmentInfoLists.size(); const auto segmentInfoListsSize = fileInfo.IsOffsetSorted() ? fileInfo.m_segmentInfoListsByOffset.size() : fileInfo.m_segmentInfoLists.size();
...@@ -3541,7 +3541,7 @@ main(int argc, char* argv[]) ...@@ -3541,7 +3541,7 @@ main(int argc, char* argv[])
muteStartTime = static_cast<uint16_t>(SEGY::ReadFieldFromHeader(header, g_traceHeaderFields["mutestarttime"], fileInfo.m_headerEndianness)), muteStartTime = static_cast<uint16_t>(SEGY::ReadFieldFromHeader(header, g_traceHeaderFields["mutestarttime"], fileInfo.m_headerEndianness)),
muteEndTime = static_cast<uint16_t>(SEGY::ReadFieldFromHeader(header, g_traceHeaderFields["muteendtime"], fileInfo.m_headerEndianness)); muteEndTime = static_cast<uint16_t>(SEGY::ReadFieldFromHeader(header, g_traceHeaderFields["muteendtime"], fileInfo.m_headerEndianness));
// TODO Need to multiply by 2 the result of VoxelIndexToDataIndex, because it gives the two-component offset, and we want the plain offset into a uint16_t buffer? // Need to multiply by 2 the result of VoxelIndexToDataIndex, because it gives the two-component offset, and we want the plain offset into a uint16_t buffer
const int const int
targetOffset = 2 * VoxelIndexToDataIndex(fileInfo, primaryIndex, secondaryIndex, tertiaryIndex, chunkInfo.min, mutePitch); targetOffset = 2 * VoxelIndexToDataIndex(fileInfo, primaryIndex, secondaryIndex, tertiaryIndex, chunkInfo.min, mutePitch);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment