We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5216791 + 9c7c767 commit 187ca3fCopy full SHA for 187ca3f
1 file changed
src/mdio/segy/_workers.py
@@ -207,7 +207,10 @@ def trace_worker(
207
value=tmp_metadata,
208
)
209
210
- nonzero_z = tmp_data.sum(axis=tuple(range(n_dim - 1))).nonzero()
+ # Find first non-zero index in sample (last) dimension
211
+ non_sample_axes = tuple(range(n_dim - 1))
212
+ nonzero_z = np.where(np.any(tmp_data != 0, axis=non_sample_axes))
213
+
214
if len(nonzero_z[0]) == 0:
215
return
216
0 commit comments