Skip to content

Commit 4cb2321

Browse files
committed
make better use of grid
1 parent f4c7c10 commit 4cb2321

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/mdio/converters/segy.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,15 +345,17 @@ def segy_to_mdio(
345345

346346
grid = _build_and_check_grid(segy_dimensions, segy_file, segy_headers)
347347

348-
dimensions, non_dim_coords = _get_coordinates(segy_dimensions, segy_headers, mdio_template)
349-
shape = [len(dim.coords) for dim in dimensions]
348+
dimensions, non_dim_coords = _get_coordinates(grid, segy_headers, mdio_template)
350349
# TODO(Altay): Turn this dtype into packed representation
351350
# https://github.com/TGSAI/mdio-python/issues/601
352351
headers = to_structured_type(segy_spec.trace.header.dtype)
353352

354353
horizontal_unit = _get_horizontal_coordinate_unit(segy_dimensions)
355354
mdio_ds: Dataset = mdio_template.build_dataset(
356-
name=mdio_template.name, sizes=shape, horizontal_coord_unit=horizontal_unit, headers=headers
355+
name=mdio_template.name,
356+
sizes=grid.shape,
357+
horizontal_coord_unit=horizontal_unit,
358+
headers=headers,
357359
)
358360

359361
_add_text_binary_headers(dataset=mdio_ds, segy_file=segy_file)

0 commit comments

Comments
 (0)