1414from mdio .segy .file import SegyFileWrapper
1515
1616if TYPE_CHECKING :
17+ from numpy .typing import NDArray
1718 from segy import SegyFile
1819 from zarr import Array as zarr_Array
1920
@@ -74,7 +75,7 @@ def trace_worker( # noqa: PLR0913
7475 header_array : zarr_Array | None ,
7576 raw_header_array : zarr_Array | None ,
7677 region : dict [str , slice ],
77- grid_map : zarr_Array ,
78+ local_grid_map : NDArray ,
7879) -> SummaryStatistics | None :
7980 """Writes a subset of traces from a region of the dataset of Zarr file.
8081
@@ -84,7 +85,7 @@ def trace_worker( # noqa: PLR0913
8485 header_array: Zarr array for writing trace headers (or None if not needed).
8586 raw_header_array: Zarr array for writing raw headers (or None if not needed).
8687 region: Region of the dataset to write to.
87- grid_map: Zarr array mapping live traces to their positions in the dataset .
88+ local_grid_map: Sliced numpy array mapping live traces to their positions.
8889
8990 Returns:
9091 SummaryStatistics object containing statistics about the written traces.
@@ -94,7 +95,6 @@ def trace_worker( # noqa: PLR0913
9495 zarr_config .set ({"threading.max_workers" : 1 })
9596
9697 region_slices = tuple (region .values ())
97- local_grid_map = grid_map [region_slices [:- 1 ]] # minus last (vertical) axis
9898
9999 # The dtype.max is the sentinel value for the grid map.
100100 # Normally, this is uint32, but some grids need to be promoted to uint64.
0 commit comments