Skip to content

Commit 1417d97

Browse files
authored
Fix for hardcoded fill value for local grid map in trace worker (TGSAI#666)
* Fix sentinel value bug * Linting * Use existing fill value maps for consistency
1 parent e4292d5 commit 1417d97

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/mdio/segy/_workers.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from mdio.builder.schemas.v1.stats import CenteredBinHistogram
2828
from mdio.builder.schemas.v1.stats import SummaryStatistics
2929
from mdio.builder.xarray_builder import _get_fill_value
30-
from mdio.constants import UINT32_MAX
30+
from mdio.constants import fill_value_map
3131

3232

3333
class SegyFileArguments(TypedDict):
@@ -107,7 +107,9 @@ def trace_worker( # noqa: PLR0913
107107
region_slices = tuple(region.values())
108108
local_grid_map = grid_map[region_slices[:-1]] # minus last (vertical) axis
109109

110-
not_null = local_grid_map != UINT32_MAX
110+
# The dtype.max is the sentinel value for the grid map.
111+
# Normally, this is uint32, but some grids need to be promoted to uint64.
112+
not_null = local_grid_map != fill_value_map.get(local_grid_map.dtype.name)
111113
if not not_null.any():
112114
return None
113115

0 commit comments

Comments
 (0)