Skip to content

Commit 83b7717

Browse files
committed
Use Teapod dimensions
1 parent 344cf65 commit 83b7717

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

tests/integration/test_create_empty.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,43 +59,43 @@ def _get_customized_v10_trace_header_spec(cls) -> HeaderSpec:
5959
def _validate_empty_mdio_dataset(cls, ds: xr_Dataset, has_headers: bool) -> None:
6060
"""Validate an empty MDIO dataset structure and content."""
6161
# Check that the dataset has the expected shape
62-
assert ds.sizes == {"inline": 200, "crossline": 300, "time": 750}
62+
assert ds.sizes == {"inline": 345, "crossline": 188, "time": 1501}
6363

6464
# Validate the dimension coordinate variables
65-
validate_variable(ds, "inline", (200,), ("inline",), np.int32, range(100, 300), get_values)
66-
validate_variable(ds, "crossline", (300,), ("crossline",), np.int32, range(1000, 1600, 2), get_values)
67-
validate_variable(ds, "time", (750,), ("time",), np.int32, range(0, 3000, 4), get_values)
65+
validate_variable(ds, "inline", (345,), ("inline",), np.int32, range(1, 346), get_values)
66+
validate_variable(ds, "crossline", (188,), ("crossline",), np.int32, range(1, 189), get_values)
67+
validate_variable(ds, "time", (1501,), ("time",), np.int32, range(0, 3002, 2), get_values)
6868

6969
# Validate the non-dimensional coordinate variables (should be empty for empty dataset)
70-
validate_variable(ds, "cdp_x", (200, 300), ("inline", "crossline"), np.float64, None, None)
71-
validate_variable(ds, "cdp_y", (200, 300), ("inline", "crossline"), np.float64, None, None)
70+
validate_variable(ds, "cdp_x", (345, 188), ("inline", "crossline"), np.float64, None, None)
71+
validate_variable(ds, "cdp_y", (345, 188), ("inline", "crossline"), np.float64, None, None)
7272

7373
if has_headers:
7474
# Validate the headers (should be empty for empty dataset)
7575
# Infer the dtype from segy_spec and ignore endianness
7676
header_dtype = cls._get_customized_v10_trace_header_spec().dtype.newbyteorder("native")
77-
validate_variable(ds, "headers", (200, 300), ("inline", "crossline"), header_dtype, None, None)
77+
validate_variable(ds, "headers", (345, 188), ("inline", "crossline"), header_dtype, None, None)
7878
validate_variable(ds, "segy_file_header", (), (), np.dtype("U1"), None, None)
7979
else:
8080
assert "headers" not in ds.variables
8181
assert "segy_file_header" not in ds.variables
8282

8383
# Validate the trace mask (should be all True for empty dataset)
84-
validate_variable(ds, "trace_mask", (200, 300), ("inline", "crossline"), np.bool_, None, None)
84+
validate_variable(ds, "trace_mask", (345, 188), ("inline", "crossline"), np.bool_, None, None)
8585
trace_mask = ds["trace_mask"].values
8686
assert not np.any(trace_mask), "All traces should be marked as dead in empty dataset"
8787

8888
# Validate the amplitude data (should be empty)
89-
validate_variable(ds, "amplitude", (200, 300, 750), ("inline", "crossline", "time"), np.float32, None, None)
89+
validate_variable(ds, "amplitude", (345, 188, 1501), ("inline", "crossline", "time"), np.float32, None, None)
9090

9191
@classmethod
9292
def _create_empty_mdio(cls, create_headers: bool, output_path: Path, overwrite: bool = True) -> None:
9393
"""Create a temporary empty MDIO file for testing."""
9494
# Create the grid with the specified dimensions
9595
dims = [
96-
Dimension(name="inline", coords=range(100, 300, 1)), # 100-300 with step 1
97-
Dimension(name="crossline", coords=range(1000, 1600, 2)), # 1000-1600 with step 2
98-
Dimension(name="time", coords=range(0, 3000, 4)), # 0-3 seconds 4ms sample rate
96+
Dimension(name="inline", coords=range(1, 346, 1)), # 100-300 with step 1
97+
Dimension(name="crossline", coords=range(1, 189, 1)), # 1000-1600 with step 2
98+
Dimension(name="time", coords=range(0, 3002, 2)), # 0-3 seconds 4ms sample rate
9999
]
100100

101101
# If later on, we want to export to SEG-Y, we need to provide the trace header spec.

0 commit comments

Comments
 (0)