Skip to content

Commit f5ee136

Browse files
authored
shot_point (TGSAI#602)
1 parent db0d564 commit f5ee136

File tree

6 files changed

+45
-45
lines changed

6 files changed

+45
-45
lines changed

src/mdio/schemas/v1/templates/abstract_dataset_template.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def __init__(self, domain: str = "") -> None:
3838
# e.g. ["cdp", "depth"] for 2D post-stack depth
3939
# e.g. ["inline", "crossline", "depth"] for 3D post-stack depth
4040
# e.g. ["inline", "crossline", "offset", "depth"] for 3D pre-stack depth CPD gathers
41-
# e.g. ["energy_source_point_num", "cable", "channel", "time"] for 3D pre-stack
41+
# e.g. ["shot_point", "cable", "channel", "time"] for 3D pre-stack
4242
# time Shot gathers
4343
self._dim_names = []
4444
# Names of all coordinates in the dataset

src/mdio/schemas/v1/templates/seismic_2d_prestack_shot.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Seismic2DPreStackShotTemplate(AbstractDatasetTemplate):
1212
def __init__(self, domain: str):
1313
super().__init__(domain=domain)
1414

15-
self._coord_dim_names = ["energy_source_point_num", "channel"] # Custom coordinate definition for shot gathers
15+
self._coord_dim_names = ["shot_point", "channel"] # Custom coordinate definition for shot gathers
1616
self._dim_names = [*self._coord_dim_names, self._trace_domain]
1717
self._coord_names = ["gun", "source_coord_x", "source_coord_y", "group_coord_x", "group_coord_y"]
1818
self._var_chunk_shape = [1, 512, 4096]
@@ -25,7 +25,7 @@ def _load_dataset_attributes(self) -> UserAttributes:
2525
return UserAttributes(
2626
attributes={
2727
"surveyDimensionality": "2D",
28-
"ensembleType": "shot",
28+
"ensembleType": "shot_point",
2929
"processingStage": "pre-stack",
3030
}
3131
)
@@ -43,31 +43,31 @@ def _add_coordinates(self) -> None:
4343
# Add non-dimension coordinates
4444
self._builder.add_coordinate(
4545
"gun",
46-
dimensions=["energy_source_point_num", "channel"],
46+
dimensions=["shot_point", "channel"],
4747
data_type=ScalarType.UINT8,
4848
metadata_info=[AllUnits(units_v1=None)],
4949
)
5050
self._builder.add_coordinate(
5151
"source_coord_x",
52-
dimensions=["energy_source_point_num", "channel"],
52+
dimensions=["shot_point", "channel"],
5353
data_type=ScalarType.FLOAT64,
5454
metadata_info=[self._horizontal_coord_unit],
5555
)
5656
self._builder.add_coordinate(
5757
"source_coord_y",
58-
dimensions=["energy_source_point_num", "channel"],
58+
dimensions=["shot_point", "channel"],
5959
data_type=ScalarType.FLOAT64,
6060
metadata_info=[self._horizontal_coord_unit],
6161
)
6262
self._builder.add_coordinate(
6363
"group_coord_x",
64-
dimensions=["energy_source_point_num", "channel"],
64+
dimensions=["shot_point", "channel"],
6565
data_type=ScalarType.FLOAT64,
6666
metadata_info=[self._horizontal_coord_unit],
6767
)
6868
self._builder.add_coordinate(
6969
"group_coord_y",
70-
dimensions=["energy_source_point_num", "channel"],
70+
dimensions=["shot_point", "channel"],
7171
data_type=ScalarType.FLOAT64,
7272
metadata_info=[self._horizontal_coord_unit],
7373
)

src/mdio/schemas/v1/templates/seismic_3d_prestack_shot.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Seismic3DPreStackShotTemplate(AbstractDatasetTemplate):
1212
def __init__(self, domain: str):
1313
super().__init__(domain=domain)
1414

15-
self._coord_dim_names = ["energy_source_point_num", "cable", "channel"] # Custom coordinates for shot gathers
15+
self._coord_dim_names = ["shot_point", "cable", "channel"] # Custom coordinates for shot gathers
1616
self._dim_names = [*self._coord_dim_names, self._trace_domain]
1717
self._coord_names = ["gun", "source_coord_x", "source_coord_y", "group_coord_x", "group_coord_y"]
1818
self._var_chunk_shape = [1, 1, 512, 4096]
@@ -25,7 +25,7 @@ def _load_dataset_attributes(self) -> UserAttributes:
2525
return UserAttributes(
2626
attributes={
2727
"surveyDimensionality": "3D",
28-
"ensembleType": "shot",
28+
"ensembleType": "shot_point",
2929
"processingStage": "pre-stack",
3030
}
3131
)
@@ -43,31 +43,31 @@ def _add_coordinates(self) -> None:
4343
# Add non-dimension coordinates
4444
self._builder.add_coordinate(
4545
"gun",
46-
dimensions=["energy_source_point_num", "cable", "channel"],
46+
dimensions=["shot_point", "cable", "channel"],
4747
data_type=ScalarType.UINT8,
4848
metadata_info=[AllUnits(units_v1=None)],
4949
)
5050
self._builder.add_coordinate(
5151
"source_coord_x",
52-
dimensions=["energy_source_point_num", "cable", "channel"],
52+
dimensions=["shot_point", "cable", "channel"],
5353
data_type=ScalarType.FLOAT64,
5454
metadata_info=[self._horizontal_coord_unit],
5555
)
5656
self._builder.add_coordinate(
5757
"source_coord_y",
58-
dimensions=["energy_source_point_num", "cable", "channel"],
58+
dimensions=["shot_point", "cable", "channel"],
5959
data_type=ScalarType.FLOAT64,
6060
metadata_info=[self._horizontal_coord_unit],
6161
)
6262
self._builder.add_coordinate(
6363
"group_coord_x",
64-
dimensions=["energy_source_point_num", "cable", "channel"],
64+
dimensions=["shot_point", "cable", "channel"],
6565
data_type=ScalarType.FLOAT64,
6666
metadata_info=[self._horizontal_coord_unit],
6767
)
6868
self._builder.add_coordinate(
6969
"group_coord_y",
70-
dimensions=["energy_source_point_num", "cable", "channel"],
70+
dimensions=["shot_point", "cable", "channel"],
7171
data_type=ScalarType.FLOAT64,
7272
metadata_info=[self._horizontal_coord_unit],
7373
)

tests/integration/test_segy_import_export_masked.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,15 @@ def __iter__(self) -> Iterable[MaskedExportConfigTypes]:
128128
)
129129

130130
STREAMER_2D_CONF = MaskedExportConfig(
131-
GridConfig(name="2d_streamer", dims=[Dimension("energy_source_point_num", 10, 10, 1), Dimension("channel", 25, 60, 25)]),
132-
SegyFactoryConfig(revision=1, header_byte_map={"energy_source_point_num": 7, "channel": 131}, num_samples=201),
131+
GridConfig(name="2d_streamer", dims=[Dimension("shot_point", 10, 10, 1), Dimension("channel", 25, 60, 25)]),
132+
SegyFactoryConfig(revision=1, header_byte_map={"shot_point": 7, "channel": 131}, num_samples=201),
133133
SegyToMdioConfig(chunks=[2, 12, 128]),
134134
SelectionMaskConfig(mask_num_dims=1, remove_frac=0.7),
135135
)
136136

137137
STREAMER_3D_CONF = MaskedExportConfig(
138-
GridConfig(name="3d_streamer", dims=[Dimension("energy_source_point_num", 10, 5, 1), Dimension("cable", 1, 6, 1), Dimension("channel", 25, 60, 25)]),
139-
SegyFactoryConfig(revision=1, header_byte_map={"energy_source_point_num": 7, "cable": 193, "channel": 131}, num_samples=201),
138+
GridConfig(name="3d_streamer", dims=[Dimension("shot_point", 10, 5, 1), Dimension("cable", 1, 6, 1), Dimension("channel", 25, 60, 25)]),
139+
SegyFactoryConfig(revision=1, header_byte_map={"shot_point": 7, "cable": 193, "channel": 131}, num_samples=201),
140140
SegyToMdioConfig(chunks=[1, 2, 12, 128]),
141141
SelectionMaskConfig(mask_num_dims=1, remove_frac=0.5),
142142
)

tests/unit/test_segy_grid_overrides.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class TestStreamerGridOverrides:
133133

134134
def test_channel_wrap(self, mock_streamer_headers: dict[str, npt.NDArray]) -> None:
135135
"""Test the ChannelWrap command."""
136-
index_names = ("shot", "cable", "channel")
136+
index_names = ("shot_point", "cable", "channel")
137137
grid_overrides = {"ChannelWrap": True, "ChannelsPerCable": len(RECEIVERS)}
138138

139139
new_headers, new_names, new_chunks = run_override(grid_overrides, index_names, mock_streamer_headers)
@@ -152,7 +152,7 @@ def test_calculate_cable(
152152
mock_streamer_headers: dict[str, npt.NDArray],
153153
) -> None:
154154
"""Test the CalculateCable command."""
155-
index_names = ("shot", "cable", "channel")
155+
index_names = ("shot_point", "cable", "channel")
156156
grid_overrides = {"CalculateCable": True, "ChannelsPerCable": len(RECEIVERS)}
157157

158158
new_headers, new_names, new_chunks = run_override(grid_overrides, index_names, mock_streamer_headers)
@@ -177,7 +177,7 @@ def test_wrap_and_calc_cable(
177177
mock_streamer_headers: dict[str, npt.NDArray],
178178
) -> None:
179179
"""Test the combined ChannelWrap and CalculateCable commands."""
180-
index_names = ("shot", "cable", "channel")
180+
index_names = ("shot_point", "cable", "channel")
181181
grid_overrides = {
182182
"CalculateCable": True,
183183
"ChannelWrap": True,
@@ -199,7 +199,7 @@ def test_wrap_and_calc_cable(
199199

200200
def test_missing_param(self, mock_streamer_headers: dict[str, npt.NDArray]) -> None:
201201
"""Test missing parameters for the commands."""
202-
index_names = ("shot", "cable", "channel")
202+
index_names = ("shot_point", "cable", "channel")
203203
chunksize = None
204204
overrider = GridOverrider()
205205

@@ -214,7 +214,7 @@ def test_incompatible_overrides(
214214
mock_streamer_headers: dict[str, npt.NDArray],
215215
) -> None:
216216
"""Test commands that can't be run together."""
217-
index_names = ("shot", "cable", "channel")
217+
index_names = ("shot_point", "cable", "channel")
218218
chunksize = None
219219
overrider = GridOverrider()
220220

@@ -231,7 +231,7 @@ def test_unknown_override(
231231
mock_streamer_headers: dict[str, npt.NDArray],
232232
) -> None:
233233
"""Test exception if user provides a command that's not allowed."""
234-
index_names = ("shot", "cable", "channel")
234+
index_names = ("shot_point", "cable", "channel")
235235
chunksize = None
236236
overrider = GridOverrider()
237237
with pytest.raises(GridOverrideUnknownError):

tests/unit/v1/templates/test_seismic_3d_prestack_shot.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,25 @@ def _validate_coordinates_headers_trace_mask(dataset: Dataset, headers: Structur
2828
validate_variable(
2929
dataset,
3030
name="headers",
31-
dims=[("energy_source_point_num", 256), ("cable", 512), ("channel", 24)],
31+
dims=[("shot_point", 256), ("cable", 512), ("channel", 24)],
3232
coords=["gun", "source_coord_x", "source_coord_y", "group_coord_x", "group_coord_y"],
3333
dtype=headers,
3434
)
3535

3636
validate_variable(
3737
dataset,
3838
name="trace_mask",
39-
dims=[("energy_source_point_num", 256), ("cable", 512), ("channel", 24)],
39+
dims=[("shot_point", 256), ("cable", 512), ("channel", 24)],
4040
coords=["gun", "source_coord_x", "source_coord_y", "group_coord_x", "group_coord_y"],
4141
dtype=ScalarType.BOOL,
4242
)
4343

4444
# Verify dimension coordinate variables
4545
inline = validate_variable(
4646
dataset,
47-
name="energy_source_point_num",
48-
dims=[("energy_source_point_num", 256)],
49-
coords=["energy_source_point_num"],
47+
name="shot_point",
48+
dims=[("shot_point", 256)],
49+
coords=["shot_point"],
5050
dtype=ScalarType.INT32,
5151
)
5252
assert inline.metadata is None
@@ -82,15 +82,15 @@ def _validate_coordinates_headers_trace_mask(dataset: Dataset, headers: Structur
8282
validate_variable(
8383
dataset,
8484
name="gun",
85-
dims=[("energy_source_point_num", 256), ("cable", 512), ("channel", 24)],
85+
dims=[("shot_point", 256), ("cable", 512), ("channel", 24)],
8686
coords=["gun"],
8787
dtype=ScalarType.UINT8,
8888
)
8989

9090
source_coord_x = validate_variable(
9191
dataset,
9292
name="source_coord_x",
93-
dims=[("energy_source_point_num", 256), ("cable", 512), ("channel", 24)],
93+
dims=[("shot_point", 256), ("cable", 512), ("channel", 24)],
9494
coords=["source_coord_x"],
9595
dtype=ScalarType.FLOAT64,
9696
)
@@ -99,7 +99,7 @@ def _validate_coordinates_headers_trace_mask(dataset: Dataset, headers: Structur
9999
source_coord_y = validate_variable(
100100
dataset,
101101
name="source_coord_y",
102-
dims=[("energy_source_point_num", 256), ("cable", 512), ("channel", 24)],
102+
dims=[("shot_point", 256), ("cable", 512), ("channel", 24)],
103103
coords=["source_coord_y"],
104104
dtype=ScalarType.FLOAT64,
105105
)
@@ -108,7 +108,7 @@ def _validate_coordinates_headers_trace_mask(dataset: Dataset, headers: Structur
108108
group_coord_x = validate_variable(
109109
dataset,
110110
name="group_coord_x",
111-
dims=[("energy_source_point_num", 256), ("cable", 512), ("channel", 24)],
111+
dims=[("shot_point", 256), ("cable", 512), ("channel", 24)],
112112
coords=["group_coord_x"],
113113
dtype=ScalarType.FLOAT64,
114114
)
@@ -117,7 +117,7 @@ def _validate_coordinates_headers_trace_mask(dataset: Dataset, headers: Structur
117117
group_coord_y = validate_variable(
118118
dataset,
119119
name="group_coord_y",
120-
dims=[("energy_source_point_num", 256), ("cable", 512), ("channel", 24)],
120+
dims=[("shot_point", 256), ("cable", 512), ("channel", 24)],
121121
coords=["group_coord_y"],
122122
dtype=ScalarType.FLOAT64,
123123
)
@@ -133,8 +133,8 @@ def test_configuration_depth(self) -> None:
133133

134134
# Template attributes for prestack shot
135135
assert t._trace_domain == "depth"
136-
assert t._coord_dim_names == ["energy_source_point_num", "cable", "channel"]
137-
assert t._dim_names == ["energy_source_point_num", "cable", "channel", "depth"]
136+
assert t._coord_dim_names == ["shot_point", "cable", "channel"]
137+
assert t._dim_names == ["shot_point", "cable", "channel", "depth"]
138138
assert t._coord_names == ["gun", "source_coord_x", "source_coord_y", "group_coord_x", "group_coord_y"]
139139
assert t._var_chunk_shape == [1, 1, 512, 4096]
140140

@@ -147,7 +147,7 @@ def test_configuration_depth(self) -> None:
147147
attrs = t._load_dataset_attributes()
148148
assert attrs.attributes == {
149149
"surveyDimensionality": "3D",
150-
"ensembleType": "shot",
150+
"ensembleType": "shot_point",
151151
"processingStage": "pre-stack",
152152
}
153153
assert t.trace_variable_name == "amplitude"
@@ -158,8 +158,8 @@ def test_configuration_time(self) -> None:
158158

159159
# Template attributes for prestack shot
160160
assert t._trace_domain == "time"
161-
assert t._coord_dim_names == ["energy_source_point_num", "cable", "channel"]
162-
assert t._dim_names == ["energy_source_point_num", "cable", "channel", "time"]
161+
assert t._coord_dim_names == ["shot_point", "cable", "channel"]
162+
assert t._dim_names == ["shot_point", "cable", "channel", "time"]
163163
assert t._coord_names == ["gun", "source_coord_x", "source_coord_y", "group_coord_x", "group_coord_y"]
164164
assert t._var_chunk_shape == [1, 1, 512, 4096]
165165

@@ -172,7 +172,7 @@ def test_configuration_time(self) -> None:
172172
attrs = t._load_dataset_attributes()
173173
assert attrs.attributes == {
174174
"surveyDimensionality": "3D",
175-
"ensembleType": "shot",
175+
"ensembleType": "shot_point",
176176
"processingStage": "pre-stack",
177177
}
178178

@@ -204,7 +204,7 @@ def test_build_dataset_depth(self, structured_headers: StructuredType) -> None:
204204

205205
assert dataset.metadata.name == "Gulf of Mexico 3D Shot Depth"
206206
assert dataset.metadata.attributes["surveyDimensionality"] == "3D"
207-
assert dataset.metadata.attributes["ensembleType"] == "shot"
207+
assert dataset.metadata.attributes["ensembleType"] == "shot_point"
208208
assert dataset.metadata.attributes["processingStage"] == "pre-stack"
209209

210210
_validate_coordinates_headers_trace_mask(dataset, structured_headers, "depth")
@@ -213,7 +213,7 @@ def test_build_dataset_depth(self, structured_headers: StructuredType) -> None:
213213
seismic = validate_variable(
214214
dataset,
215215
name="amplitude",
216-
dims=[("energy_source_point_num", 256), ("cable", 512), ("channel", 24), ("depth", 2048)],
216+
dims=[("shot_point", 256), ("cable", 512), ("channel", 24), ("depth", 2048)],
217217
coords=["gun", "source_coord_x", "source_coord_y", "group_coord_x", "group_coord_y"],
218218
dtype=ScalarType.FLOAT32,
219219
)
@@ -237,7 +237,7 @@ def test_build_dataset_time(self, structured_headers: StructuredType) -> None:
237237

238238
assert dataset.metadata.name == "North Sea 3D Shot Time"
239239
assert dataset.metadata.attributes["surveyDimensionality"] == "3D"
240-
assert dataset.metadata.attributes["ensembleType"] == "shot"
240+
assert dataset.metadata.attributes["ensembleType"] == "shot_point"
241241
assert dataset.metadata.attributes["processingStage"] == "pre-stack"
242242

243243
_validate_coordinates_headers_trace_mask(dataset, structured_headers, "time")
@@ -246,7 +246,7 @@ def test_build_dataset_time(self, structured_headers: StructuredType) -> None:
246246
seismic = validate_variable(
247247
dataset,
248248
name="amplitude",
249-
dims=[("energy_source_point_num", 256), ("cable", 512), ("channel", 24), ("time", 2048)],
249+
dims=[("shot_point", 256), ("cable", 512), ("channel", 24), ("time", 2048)],
250250
coords=["gun", "source_coord_x", "source_coord_y", "group_coord_x", "group_coord_y"],
251251
dtype=ScalarType.FLOAT32,
252252
)

0 commit comments

Comments
 (0)