Commit c036c747 authored by Morten Ofstad's avatar Morten Ofstad
Browse files

Merge branch feature/jim.king/rebased_plugin_port_from_jim3 with...

Merge branch feature/jim.king/rebased_plugin_port_from_jim3 with refs/heads/master into refs/merge-requests/532/train
parents 0bf89344 04f0a0a9
Pipeline #85920 passed with stages
in 21 minutes and 48 seconds
......@@ -20,3 +20,5 @@ cmakerc*
azure-sdk-for-cpp*
libxml2*
!dms-git
azure-sdk-for-cpp*
libxml2*
......@@ -32,7 +32,7 @@ using namespace SEGY;
bool
SEGYFileInfo::Is4D() const
{
return m_segyType == SEGY::SEGYType::Prestack;
return m_segyType == SEGY::SEGYType::Prestack || m_segyType == SEGY::SEGYType::PrestackOffsetSorted;
}
bool
......@@ -45,7 +45,19 @@ bool
SEGYFileInfo::HasGatherOffset() const
{
// TODO unbinned gathers may be angle gathers?
return m_segyType == SEGY::SEGYType::Prestack || IsUnbinned();
return m_segyType == SEGYType::Prestack || m_segyType == SEGYType::Prestack2D || IsOffsetSorted() || IsUnbinned();
}
bool
SEGYFileInfo::Is2D() const
{
return m_segyType == SEGYType::Poststack2D || m_segyType == SEGYType::Prestack2D;
}
bool
SEGYFileInfo::IsOffsetSorted() const
{
return m_segyType == SEGYType::PrestackOffsetSorted;
}
SEGYBinInfo
......@@ -93,8 +105,15 @@ SEGYFileInfo::StaticGetUniqueID()
}
bool
SEGYFileInfo::Scan(const std::vector<DataProvider>& dataProviders, OpenVDS::Error &error, HeaderField const &primaryKeyHeaderField, HeaderField const &secondaryKeyHeaderField, SEGY::HeaderField const &startTimeHeaderField, SEGYBinInfoHeaderFields const &binInfoHeaderFields)
SEGYFileInfo::Scan(const std::vector<DataProvider>& dataProviders, OpenVDS::Error &error, HeaderField const &primaryKeyHeaderField, HeaderField const &secondaryKeyHeaderField, SEGY::HeaderField const &startTimeHeaderField, SEGY::HeaderField const& offsetHeaderField, SEGYBinInfoHeaderFields const &binInfoHeaderFields)
{
std::function<int(const char*)>
readOffset = [](const char* traceHeader) { return -1; };
if (IsOffsetSorted())
{
readOffset = [offsetHeaderField, this](const char* traceHeader) { return ReadFieldFromHeader(traceHeader, offsetHeaderField, m_headerEndianness); };
}
char textualFileHeader[TextualFileHeaderSize];
char binaryFileHeader[BinaryFileHeaderSize];
char traceHeader[TraceHeaderSize];
......@@ -142,14 +161,6 @@ SEGYFileInfo::Scan(const std::vector<DataProvider>& dataProviders, OpenVDS::Erro
for (const auto& dataProvider : dataProviders)
{
m_segmentInfoLists.emplace_back();
m_traceCounts.emplace_back();
auto&
segmentInfos = m_segmentInfoLists.back();
auto&
traceCount = m_traceCounts.back();
int64_t fileSize = dataProvider.Size(error);
if (error.code != 0)
......@@ -170,6 +181,32 @@ SEGYFileInfo::Scan(const std::vector<DataProvider>& dataProviders, OpenVDS::Erro
return false;
}
int
currentOffset = readOffset(traceHeader);
std::function<void(int, const SEGYSegmentInfo&)>
pushSegmentInfo;
if (IsOffsetSorted())
{
m_segmentInfoListsByOffset.emplace_back();
auto&
offsetMap = m_segmentInfoListsByOffset.back();
offsetMap.emplace(currentOffset, std::vector<SEGYSegmentInfo>());
pushSegmentInfo = [this](int offset, const SEGYSegmentInfo& segmentInfo) { m_segmentInfoListsByOffset.back()[offset].push_back(segmentInfo); };
}
else
{
m_segmentInfoLists.emplace_back();
pushSegmentInfo = [this](int offset, const SEGYSegmentInfo& segmentInfo) { m_segmentInfoLists.back().push_back(segmentInfo); };
}
m_traceCounts.emplace_back();
auto&
traceCount = m_traceCounts.back();
// If the sample count is not set in the binary header we try to find it from the first trace header
if (m_sampleCount == 0)
{
......@@ -182,7 +219,7 @@ SEGYFileInfo::Scan(const std::vector<DataProvider>& dataProviders, OpenVDS::Erro
m_sampleIntervalMilliseconds = ReadFieldFromHeader(traceHeader, TraceHeader::SampleIntervalHeaderField, m_headerEndianness) / 1000.0;
}
int64_t traceDataSize = (fileSize - TextualFileHeaderSize - BinaryFileHeaderSize);
const int64_t traceDataSize = (fileSize - TextualFileHeaderSize - BinaryFileHeaderSize);
traceCount = traceDataSize / TraceByteSize();
......@@ -203,7 +240,7 @@ SEGYFileInfo::Scan(const std::vector<DataProvider>& dataProviders, OpenVDS::Erro
SEGYBinInfo outsideBinInfo;
int primaryKey = ReadFieldFromHeader(traceHeader, primaryKeyHeaderField, m_headerEndianness), nextPrimaryKey = 0;
int primaryKey = Is2D() ? 0 : ReadFieldFromHeader(traceHeader, primaryKeyHeaderField, m_headerEndianness), nextPrimaryKey = 0;
SEGYSegmentInfo segmentInfo(primaryKey, 0, readBinInfoFromHeader(traceHeader, binInfoHeaderFields, m_headerEndianness, 1));
......@@ -211,6 +248,10 @@ SEGYFileInfo::Scan(const std::vector<DataProvider>& dataProviders, OpenVDS::Erro
int readCount = 1;
int
testOffset,
nextOffset;
while (segmentInfo.m_traceStop != lastTrace)
{
dataProvider.Read(traceHeader, TextualFileHeaderSize + BinaryFileHeaderSize + trace * TraceByteSize(), TraceHeaderSize, error);
......@@ -221,9 +262,10 @@ SEGYFileInfo::Scan(const std::vector<DataProvider>& dataProviders, OpenVDS::Erro
}
readCount++;
int primaryKey = ReadFieldFromHeader(traceHeader, primaryKeyHeaderField, m_headerEndianness);
primaryKey = Is2D() ? 0 : ReadFieldFromHeader(traceHeader, primaryKeyHeaderField, m_headerEndianness);
testOffset = readOffset(traceHeader);
if (primaryKey == segmentInfo.m_primaryKey) // expand current segment if the primary key matches
if (primaryKey == segmentInfo.m_primaryKey && (!IsOffsetSorted() || testOffset == currentOffset)) // expand current segment if the primary key matches
{
assert(trace > segmentInfo.m_traceStop);
segmentInfo.m_traceStop = trace;
......@@ -235,17 +277,21 @@ SEGYFileInfo::Scan(const std::vector<DataProvider>& dataProviders, OpenVDS::Erro
outsideTrace = trace;
outsideBinInfo = readBinInfoFromHeader(traceHeader, binInfoHeaderFields, m_headerEndianness, 1);
nextPrimaryKey = primaryKey;
nextOffset = testOffset;
}
if (outsideTrace == segmentInfo.m_traceStop + 1) // current segment is finished
{
segmentInfos.push_back(segmentInfo);
int64_t segmentLength = segmentInfo.m_traceStop - segmentInfo.m_traceStart + 1;
pushSegmentInfo(currentOffset, segmentInfo);
const int64_t
segmentLength = segmentInfo.m_traceStop - segmentInfo.m_traceStart + 1;
// start a new segment
segmentInfo = SEGYSegmentInfo(nextPrimaryKey, outsideTrace, outsideBinInfo);
trace = std::min(lastTrace, outsideTrace + segmentLength);
outsideTrace = 0, jump = 1;
currentOffset = nextOffset;
}
else if (outsideTrace == 0) // looking for a trace outside the current segment
{
......@@ -264,7 +310,7 @@ SEGYFileInfo::Scan(const std::vector<DataProvider>& dataProviders, OpenVDS::Erro
}
// final segment in this file is finished
segmentInfos.push_back(segmentInfo);
pushSegmentInfo(testOffset, segmentInfo);
}
return true;
......
......@@ -55,6 +55,16 @@ struct HeaderField
HeaderField(int byteLocation, FieldWidth fieldWidth) : byteLocation(byteLocation), fieldWidth(fieldWidth) {}
bool Defined() const { return byteLocation != 0; }
bool operator==(const HeaderField& hf) const
{
return byteLocation == hf.byteLocation && fieldWidth == hf.fieldWidth;
}
bool operator!=(const HeaderField& hf) const
{
return !(*this == hf);
}
};
namespace BinaryHeader
......@@ -194,6 +204,11 @@ static const HeaderField InlineNumberHeaderField(189, FieldWidth::FourByte);
static const HeaderField CrosslineNumberHeaderField(193, FieldWidth::FourByte);
static const HeaderField ReceiverHeaderField(13, FieldWidth::FourByte);
static const HeaderField OffsetHeaderField(37, FieldWidth::FourByte);
static const HeaderField OffsetXHeaderField(97, FieldWidth::TwoByte);
static const HeaderField OffsetYHeaderField(95, FieldWidth::TwoByte);
static const HeaderField Azimuth(61, FieldWidth::FourByte);
static const HeaderField MuteStartTime(111, FieldWidth::TwoByte);
static const HeaderField MuteEndTime(113, FieldWidth::TwoByte);
} // end namespace TraceHeader
......@@ -308,6 +323,22 @@ enum class SampleUnits
Meters = 2
};
enum class AzimuthUnits
{
Radians = 0,
Degrees = 1,
MinValue = Radians,
MaxValue = Degrees
};
enum class AzimuthType
{
Azimuth = 0,
OffsetXY = 1,
MinValue = Azimuth,
MaxValue = OffsetXY
};
enum class SEGYType
{
Poststack = 0,
......@@ -317,6 +348,7 @@ enum class SEGYType
CDPGathers = 4,
ShotGathers = 5,
ReceiverGathers = 6,
PrestackOffsetSorted = 7
};
OPENVDS_EXPORT bool IsSEGYTypeUnbinned(SEGYType segyType);
......
......@@ -93,6 +93,11 @@ struct SEGYFileInfo
std::vector<std::vector<SEGYSegmentInfo>>
m_segmentInfoLists;
// vector of per-file offset-vector maps for SEGYType::PrestackOffsetSorted
std::vector<std::map<int, std::vector<SEGYSegmentInfo>>>
m_segmentInfoListsByOffset;
SEGY::HeaderField
m_primaryKey,
m_secondaryKey;
......@@ -108,7 +113,7 @@ struct SEGYFileInfo
OPENVDS_EXPORT int TraceByteSize() const;
OPENVDS_EXPORT bool Scan(const std::vector<DataProvider>& dataProviders, OpenVDS::Error &error, SEGY::HeaderField const &primaryKeyHeaderField, SEGY::HeaderField const &secondaryKeyHeaderField = SEGY::HeaderField(), SEGY::HeaderField const &startTimeHeaderField = SEGY::TraceHeader::StartTimeHeaderField, SEGYBinInfoHeaderFields const &binInfoHeaderFields = SEGYBinInfoHeaderFields::StandardHeaderFields());
OPENVDS_EXPORT bool Scan(const std::vector<DataProvider>& dataProviders, OpenVDS::Error &error, SEGY::HeaderField const &primaryKeyHeaderField, SEGY::HeaderField const &secondaryKeyHeaderField = SEGY::HeaderField(), SEGY::HeaderField const &startTimeHeaderField = SEGY::TraceHeader::StartTimeHeaderField, SEGY::HeaderField const& offsetHeaderField = SEGY::TraceHeader::OffsetHeaderField, SEGYBinInfoHeaderFields const &binInfoHeaderFields = SEGYBinInfoHeaderFields::StandardHeaderFields());
OPENVDS_EXPORT SEGYBinInfo readBinInfoFromHeader(const char* header, SEGYBinInfoHeaderFields const& headerFields, SEGY::Endianness endianness, int segmentTraceIndex) const;
......@@ -117,6 +122,10 @@ struct SEGYFileInfo
OPENVDS_EXPORT bool IsUnbinned() const;
OPENVDS_EXPORT bool HasGatherOffset() const;
OPENVDS_EXPORT bool Is2D() const;
OPENVDS_EXPORT bool IsOffsetSorted() const;
};
#endif // SEGY_FILE_INFO_H
......@@ -141,6 +141,12 @@ public:
m_dataViewManager->retireAllDataViews();
}
int64_t
fileTraceCount() const
{
return m_numTraces;
}
private:
std::shared_ptr<DataViewManager>
m_dataViewManager;
......
"""
Testing/prototyping code for ordering chunks for crossline-sorted data.
"""
import math
import time
from contextlib import redirect_stdout
from timeit import timeit
import openvds
def create_3d_vds():
layout_descriptor = openvds.VolumeDataLayoutDescriptor(openvds.VolumeDataLayoutDescriptor.BrickSize.BrickSize_64,
0, 0, 4,
openvds.VolumeDataLayoutDescriptor.LODLevels.LODLevels_None,
openvds.VolumeDataLayoutDescriptor.Options.Options_None)
compression_method = openvds.CompressionMethod(0)
compression_tolerance = 0.01
sample_samples = 500
crossline_samples = 800
inline_samples = 350
axis_descriptors = [
openvds.VolumeDataAxisDescriptor(sample_samples, openvds.KnownAxisNames.sample(), openvds.KnownUnitNames.millisecond(), 0.0,
(sample_samples - 1) * 4.0),
openvds.VolumeDataAxisDescriptor(crossline_samples, openvds.KnownAxisNames.crossline(), openvds.KnownUnitNames.unitless(), 2000.0,
2000.0 + (crossline_samples - 1) * 4),
openvds.VolumeDataAxisDescriptor(inline_samples, openvds.KnownAxisNames.inline(), openvds.KnownUnitNames.unitless(), 1000.0,
1000.0 + (inline_samples - 1) * 2),
]
channel_descriptors = [openvds.VolumeDataChannelDescriptor(openvds.VolumeDataChannelDescriptor.Format.Format_R32,
openvds.VolumeDataChannelDescriptor.Components.Components_1,
"Amplitude", openvds.KnownUnitNames.millisecond(),
-20000.0, 20000.0)
]
metaData = openvds.MetadataContainer()
metaData.setMetadataDoubleVector2(openvds.KnownMetadata.surveyCoordinateSystemOrigin().category,
openvds.KnownMetadata.surveyCoordinateSystemOrigin().name, (1234.0, 4321.0))
vds = openvds.create("C:\\temp\\SEGY\\t\\crossline_test.vds", "", layout_descriptor, axis_descriptors, channel_descriptors, metaData,
compression_method, compression_tolerance)
return vds
def create_4d_vds():
layout_descriptor = openvds.VolumeDataLayoutDescriptor(openvds.VolumeDataLayoutDescriptor.BrickSize.BrickSize_64,
0, 0, 4,
openvds.VolumeDataLayoutDescriptor.LODLevels.LODLevels_None,
openvds.VolumeDataLayoutDescriptor.Options.Options_None)
compression_method = openvds.CompressionMethod(0)
compression_tolerance = 0.01
sample_samples = 500
trace_samples = 100
crossline_samples = 800
inline_samples = 350
axis_descriptors = [
openvds.VolumeDataAxisDescriptor(sample_samples, openvds.KnownAxisNames.sample(), openvds.KnownUnitNames.millisecond(), 0.0,
(sample_samples - 1) * 4.0),
openvds.VolumeDataAxisDescriptor(trace_samples, "Trace (offset)", openvds.KnownUnitNames.unitless(), 1.0,
trace_samples + 1.0),
openvds.VolumeDataAxisDescriptor(crossline_samples, openvds.KnownAxisNames.crossline(), openvds.KnownUnitNames.unitless(), 2000.0,
2000.0 + (crossline_samples - 1) * 4),
openvds.VolumeDataAxisDescriptor(inline_samples, openvds.KnownAxisNames.inline(), openvds.KnownUnitNames.unitless(), 1000.0,
1000.0 + (inline_samples - 1) * 2),
]
channel_descriptors = [openvds.VolumeDataChannelDescriptor(openvds.VolumeDataChannelDescriptor.Format.Format_R32,
openvds.VolumeDataChannelDescriptor.Components.Components_1,
"Amplitude", openvds.KnownUnitNames.millisecond(),
-20000.0, 20000.0)
]
metaData = openvds.MetadataContainer()
metaData.setMetadataDoubleVector2(openvds.KnownMetadata.surveyCoordinateSystemOrigin().category,
openvds.KnownMetadata.surveyCoordinateSystemOrigin().name, (1234.0, 4321.0))
vds = openvds.create("C:\\temp\\SEGY\\t\\crossline_test.vds", "", layout_descriptor, axis_descriptors, channel_descriptors, metaData,
compression_method, compression_tolerance)
return vds
def create_vds_and_iterate_crossline_chunks_3d():
vds = create_3d_vds()
manager = openvds.getAccessManager(vds)
accessor = manager.createVolumeDataPageAccessor(openvds.DimensionsND.Dimensions_012, 0, 0, 8,
openvds.IVolumeDataAccessManager.AccessMode.AccessMode_Create, 1024)
sample_axis_chunk_count = 0
crossline_axis_chunk_count = 0
inline_axis_chunk_count = 0
for chunk_num in range(accessor.getChunkCount()):
chunk_min, _ = accessor.getChunkMinMax(chunk_num)
if chunk_min[0] == 0 and chunk_min[1] == 0:
inline_axis_chunk_count += 1
if chunk_min[0] == 0 and chunk_min[2] == 0:
crossline_axis_chunk_count += 1
if chunk_min[1] == 0 and chunk_min[2] == 0:
sample_axis_chunk_count += 1
print()
print("Gen 1 3D VDS chunk iteration")
print()
print(f"sample axis chunk count: {sample_axis_chunk_count}")
print(f"crossline axis chunk count: {crossline_axis_chunk_count}")
print(f"inline axis chunk count: {inline_axis_chunk_count}")
print(f"total chunks: {accessor.getChunkCount()}")
chunks_visited = set()
for chunk_sequence in range(accessor.getChunkCount()):
# convert sequence number to chunk number for crossline-sorted input
# xl_chunk_coord = chunk_sequence // (inline_axis_chunk_count * sample_axis_chunk_count)
# il_chunk_coord = (chunk_sequence % (inline_axis_chunk_count * sample_axis_chunk_count)) // sample_axis_chunk_count
# sample_chunk_coord = chunk_sequence % sample_axis_chunk_count
working, sample_chunk_coord = divmod(chunk_sequence, sample_axis_chunk_count)
xl_chunk_coord, il_chunk_coord = divmod(working, inline_axis_chunk_count)
chunk_num = il_chunk_coord * crossline_axis_chunk_count * sample_axis_chunk_count + xl_chunk_coord * sample_axis_chunk_count + sample_chunk_coord
chunk_min, _ = accessor.getChunkMinMax(chunk_num)
print(f"{chunk_sequence:3} {chunk_num:3} ({chunk_min[0]:3}, {chunk_min[1]:3}, {chunk_min[2]:3})")
chunks_visited.add(chunk_num)
print()
print(f"Visited chunk count: {len(chunks_visited)}")
def create_vds_and_iterate_crossline_chunks_4d():
vds = create_4d_vds()
manager = openvds.getAccessManager(vds)
accessor = manager.createVolumeDataPageAccessor(openvds.DimensionsND.Dimensions_012, 0, 0, 8,
openvds.IVolumeDataAccessManager.AccessMode.AccessMode_Create, 1024)
sample_axis_chunk_count = 0
trace_axis_chunk_count = 0
crossline_axis_chunk_count = 0
inline_axis_chunk_count = 0
for chunk_num in range(accessor.getChunkCount()):
chunk_min, _ = accessor.getChunkMinMax(chunk_num)
if chunk_min[0] == 0 and chunk_min[1] == 0 and chunk_min[2] == 0:
inline_axis_chunk_count += 1
if chunk_min[0] == 0 and chunk_min[1] == 0 and chunk_min[3] == 0:
crossline_axis_chunk_count += 1
if chunk_min[0] == 0 and chunk_min[2] == 0 and chunk_min[3] == 0:
trace_axis_chunk_count += 1
if chunk_min[1] == 0 and chunk_min[2] == 0 and chunk_min[3] == 0:
sample_axis_chunk_count += 1
print()
print("Gen 1 4D VDS chunk iteration")
print()
print(f"sample axis chunk count: {sample_axis_chunk_count}")
print(f"trace axis chunk count: {trace_axis_chunk_count}")
print(f"crossline axis chunk count: {crossline_axis_chunk_count}")
print(f"inline axis chunk count: {inline_axis_chunk_count}")
print(f"total chunks: {accessor.getChunkCount()}")
chunks_visited = set()
for chunk_sequence in range(accessor.getChunkCount()):
# convert sequence number to chunk number for 4D crossline-sorted input
working, sample_chunk_coord = divmod(chunk_sequence, sample_axis_chunk_count)
working, trace_chunk_coord = divmod(working, trace_axis_chunk_count)
xl_chunk_coord, il_chunk_coord = divmod(working, inline_axis_chunk_count)
chunk_num = il_chunk_coord * crossline_axis_chunk_count * trace_axis_chunk_count * sample_axis_chunk_count\
+ xl_chunk_coord * trace_axis_chunk_count * sample_axis_chunk_count\
+ trace_chunk_coord * sample_axis_chunk_count\
+ sample_chunk_coord
chunk_min, _ = accessor.getChunkMinMax(chunk_num)
print(f"{chunk_sequence:5} {chunk_num:5} ({chunk_min[0]:3}, {chunk_min[1]:3}, {chunk_min[2]:3}, {chunk_min[3]:3})")
chunks_visited.add(chunk_num)
print()
print(f"Visited chunk count: {len(chunks_visited)}")
def iterate_crossline_chunks_universal(vds_handle):
layout = openvds.getLayout(vds_handle)
dimensionality = layout.getDimensionality()
assert dimensionality == 3 or dimensionality == 4
manager = openvds.getAccessManager(vds_handle)
accessor = manager.createVolumeDataPageAccessor(openvds.DimensionsND.Dimensions_012, 0, 0, 8,
openvds.IVolumeDataAccessManager.AccessMode.AccessMode_Create, 1024)
dim_chunk_counts = [0, 0, 0, 0]
for chunk_num in range(accessor.getChunkCount()):
chunk_min, _ = accessor.getChunkMinMax(chunk_num)
for i in range(len(dim_chunk_counts)):
is_zero = True
j = 0
while is_zero and j < len(dim_chunk_counts):
if j != i:
is_zero = chunk_min[j] == 0
j += 1
if is_zero:
dim_chunk_counts[i] += 1
for i in range(len(dim_chunk_counts)):
print(f"dim{i} axis chunk count: {dim_chunk_counts[i]}")
print()
print(f"total chunks: accessor: {accessor.getChunkCount()} counts product: {math.prod(dim_chunk_counts)}")
pitches = [1, 1, 1, 1]
for i in range(1, len(dim_chunk_counts)):
pitches[i] = pitches[i - 1] * dim_chunk_counts[i - 1]
chunks_visited = set()
for chunk_sequence in range(accessor.getChunkCount()):
# convert sequence number to chunk number for 4D crossline-sorted input
chunk_coords = [0, 0, 0, 0]
if dimensionality == 3:
working, chunk_coords[0] = divmod(chunk_sequence, dim_chunk_counts[0])
chunk_coords[1], chunk_coords[2] = divmod(working, dim_chunk_counts[2]) # 2 not 1 because we're working in crossline-major space
elif dimensionality == 4:
working, chunk_coords[0] = divmod(chunk_sequence, dim_chunk_counts[0])
working, chunk_coords[1] = divmod(working, dim_chunk_counts[1])
chunk_coords[2], chunk_coords[3] = divmod(working, dim_chunk_counts[3]) # 3 not 2 because we're working in crossline-major space
else:
raise ValueError(f"Invalid dimensionality: {dimensionality}")
chunk_num = 0
for i in range(len(chunk_coords)):
chunk_num += chunk_coords[i] * pitches[i]
chunk_min, _ = accessor.getChunkMinMax(chunk_num)
print(
f"{chunk_sequence:5} {chunk_num:5} ({chunk_min[0]:3}, {chunk_min[1]:3}, {chunk_min[2]:3}, {chunk_min[3]:3})")
chunks_visited.add(chunk_num)
print()
print(f"Visited chunk count: {len(chunks_visited)}")
def create_3d_vds_and_iterate_universal():
vds = create_3d_vds()
print()
print("Gen 2 (universal) 3D VDS chunk iteration")
print()
iterate_crossline_chunks_universal(vds)
def create_4d_vds_and_iterate_universal():
vds = create_4d_vds()
print()
print("Gen 2 (universal) 4D VDS chunk iteration")
print()
iterate_crossline_chunks_universal(vds)
if __name__ == "__main__":
is_poststack = False
if is_poststack:
create_vds_and_iterate_crossline_chunks_3d()
create_3d_vds_and_iterate_universal()
else:
with open("C:\\temp\\SEGY\\t\\chunk_order.txt", "w") as f:
with redirect_stdout(f):
start = time.perf_counter()
create_vds_and_iterate_crossline_chunks_4d()
stop1 = time.perf_counter()
create_4d_vds_and_iterate_universal()
stop2 = time.perf_counter()
print()
print(f"Gen 1 elapsed: {stop1 - start}")
print(f"Gen 2 elapsed: {stop2 - stop1}")
"""
Global configuration information for SEGYImport pytests
"""
import os
import subprocess
import tempfile
import weakref
import pytest
from typing import List