Skip to content

Commit fcc6772

Browse files
committed
Fix sentinel value bug
1 parent 58f222f commit fcc6772

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/mdio/segy/_workers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from mdio.builder.schemas.v1.stats import SummaryStatistics
2929
from mdio.builder.xarray_builder import _get_fill_value
3030
from mdio.constants import UINT32_MAX
31+
from mdio.constants import UINT64_MAX
3132

3233

3334
class SegyFileArguments(TypedDict):
@@ -107,7 +108,9 @@ def trace_worker( # noqa: PLR0913
107108
region_slices = tuple(region.values())
108109
local_grid_map = grid_map[region_slices[:-1]] # minus last (vertical) axis
109110

110-
not_null = local_grid_map != UINT32_MAX
111+
# The dtype.max is the sentinel value for the grid map.
112+
# Normally, this is uint32, but some grids need to be promoted to uint64.
113+
not_null = local_grid_map != np.iinfo(local_grid_map.dtype).max
111114
if not not_null.any():
112115
return None
113116

0 commit comments

Comments
 (0)