Skip to content

Commit 482650b

Browse files
authored
remove "gun" logical coordinate from seismic 2d prestack shot template and tests (TGSAI#729)
Co-authored-by: Altay Sansal <[email protected]>
1 parent a6e8116 commit 482650b

File tree

2 files changed

+4
-20
lines changed

2 files changed

+4
-20
lines changed

src/mdio/builder/templates/seismic_2d_prestack_shot.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ def __init__(self, data_domain: SeismicDataDomain):
1717

1818
self._dim_names = ("shot_point", "channel", self._data_domain)
1919
self._physical_coord_names = ("source_coord_x", "source_coord_y", "group_coord_x", "group_coord_y")
20-
self._logical_coord_names = ("gun",)
2120
self._var_chunk_shape = (16, 32, 2048)
2221

2322
@property
@@ -39,12 +38,6 @@ def _add_coordinates(self) -> None:
3938

4039
# Add non-dimension coordinates
4140
compressor = compressors.Blosc(cname=compressors.BloscCname.zstd)
42-
self._builder.add_coordinate(
43-
"gun",
44-
dimensions=("shot_point",),
45-
data_type=ScalarType.UINT8,
46-
compressor=compressor,
47-
)
4841
self._builder.add_coordinate(
4942
"source_coord_x",
5043
dimensions=("shot_point",),

tests/unit/v1/templates/test_seismic_2d_prestack_shot.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,22 @@ def _validate_coordinates_headers_trace_mask(dataset: Dataset, headers: Structur
2323
"""Validate the coordinate, headers, trace_mask variables in the dataset."""
2424
# Verify variables
2525
# 4 dim coords + 5 non-dim coords + 1 data + 1 trace mask + 1 headers = 12 variables
26-
assert len(dataset.variables) == 11
26+
assert len(dataset.variables) == 10
2727

2828
# Verify trace headers
2929
validate_variable(
3030
dataset,
3131
name="headers",
3232
dims=[("shot_point", 256), ("channel", 24)],
33-
coords=["gun", "source_coord_x", "source_coord_y", "group_coord_x", "group_coord_y"],
33+
coords=["source_coord_x", "source_coord_y", "group_coord_x", "group_coord_y"],
3434
dtype=headers,
3535
)
3636

3737
validate_variable(
3838
dataset,
3939
name="trace_mask",
4040
dims=[("shot_point", 256), ("channel", 24)],
41-
coords=["gun", "source_coord_x", "source_coord_y", "group_coord_x", "group_coord_y"],
41+
coords=["source_coord_x", "source_coord_y", "group_coord_x", "group_coord_y"],
4242
dtype=ScalarType.BOOL,
4343
)
4444

@@ -69,14 +69,6 @@ def _validate_coordinates_headers_trace_mask(dataset: Dataset, headers: Structur
6969
assert domain.metadata.units_v1 == UNITS_SECOND
7070

7171
# Verify non-dimension coordinate variables
72-
validate_variable(
73-
dataset,
74-
name="gun",
75-
dims=[("shot_point", 256)],
76-
coords=["gun"],
77-
dtype=ScalarType.UINT8,
78-
)
79-
8072
source_coord_x = validate_variable(
8173
dataset,
8274
name="source_coord_x",
@@ -125,7 +117,6 @@ def test_configuration(self) -> None:
125117
assert t._data_domain == "time"
126118
assert t._dim_names == ("shot_point", "channel", "time")
127119
assert t._physical_coord_names == ("source_coord_x", "source_coord_y", "group_coord_x", "group_coord_y")
128-
assert t._logical_coord_names == ("gun",)
129120
assert t.full_chunk_shape == (16, 32, 2048)
130121

131122
# Variables instantiated when build_dataset() is called
@@ -159,7 +150,7 @@ def test_build_dataset(self, structured_headers: StructuredType) -> None:
159150
dataset,
160151
name="amplitude",
161152
dims=[("shot_point", 256), ("channel", 24), ("time", 2048)],
162-
coords=["gun", "source_coord_x", "source_coord_y", "group_coord_x", "group_coord_y"],
153+
coords=["source_coord_x", "source_coord_y", "group_coord_x", "group_coord_y"],
163154
dtype=ScalarType.FLOAT32,
164155
)
165156
assert isinstance(seismic.compressor, Blosc)

0 commit comments

Comments
 (0)