|
13 | 13 | from click_params import JSON |
14 | 14 | from click_params import IntListParamType |
15 | 15 | from click_params import StringListParamType |
| 16 | +from segy.schema import HeaderField |
| 17 | +from segy.standards import get_segy_standard |
16 | 18 |
|
17 | 19 | from mdio.core.storage_location import StorageLocation |
| 20 | +from mdio.schemas.v1.templates.template_registry import TemplateRegistry |
18 | 21 |
|
19 | 22 | SEGY_HELP = """ |
20 | 23 | MDIO and SEG-Y conversion utilities. Below is general information about the SEG-Y format and MDIO |
@@ -320,19 +323,23 @@ def segy_import( # noqa: PLR0913 |
320 | 323 | # Lazy import to reduce CLI startup time |
321 | 324 | from mdio import segy_to_mdio # noqa: PLC0415 |
322 | 325 |
|
| 326 | + _ = (chunk_size, lossless, compression_tolerance, grid_overrides) |
| 327 | + |
| 328 | + segy_spec = get_segy_standard(1.0) |
| 329 | + index_names = header_names or [f"dim_{i}" for i in range(len(header_locations))] |
| 330 | + index_types = header_types or ["int32"] * len(header_locations) |
| 331 | + index_fields = [ |
| 332 | + HeaderField(name=name, byte=byte, format=format_) |
| 333 | + for name, byte, format_ in zip(index_names, header_locations, index_types, strict=True) |
| 334 | + ] |
| 335 | + segy_spec = segy_spec.customize(trace_header_fields=index_fields) |
| 336 | + |
323 | 337 | segy_to_mdio( |
324 | | - segy_path=segy_path, |
325 | | - mdio_path_or_buffer=mdio_path, |
326 | | - index_bytes=header_locations, |
327 | | - index_types=header_types, |
328 | | - index_names=header_names, |
329 | | - chunksize=chunk_size, |
330 | | - lossless=lossless, |
331 | | - compression_tolerance=compression_tolerance, |
332 | | - storage_options_input=storage_options_input, |
333 | | - storage_options_output=storage_options_output, |
| 338 | + segy_spec=segy_spec, |
| 339 | + mdio_template=TemplateRegistry().get("PostStack3DTime"), |
| 340 | + input_location=StorageLocation(segy_path, storage_options_input), |
| 341 | + output_location=StorageLocation(mdio_path, storage_options_output), |
334 | 342 | overwrite=overwrite, |
335 | | - grid_overrides=grid_overrides, |
336 | 343 | ) |
337 | 344 |
|
338 | 345 |
|
|
0 commit comments