Skip to content

Commit 7516ab7

Browse files
committed
Add v2 issue check
1 parent a2ee5b8 commit 7516ab7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/mdio/converters/segy.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from segy.config import SegySettings
1212
from segy.standards.codes import MeasurementSystem as segy_MeasurementSystem
1313
from segy.standards.fields.trace import Rev0 as TraceHeaderFieldsRev0
14+
import zarr
1415

1516
from mdio.api.io import _normalize_path
1617
from mdio.api.io import to_mdio
@@ -23,6 +24,7 @@
2324
from mdio.builder.schemas.v1.units import LengthUnitModel
2425
from mdio.builder.schemas.v1.variable import VariableMetadata
2526
from mdio.builder.xarray_builder import to_xarray_dataset
27+
from mdio.constants import ZarrFormat
2628
from mdio.converters.exceptions import EnvironmentFormatError
2729
from mdio.converters.exceptions import GridTraceCountError
2830
from mdio.converters.exceptions import GridTraceSparsityError
@@ -434,8 +436,11 @@ def segy_to_mdio( # noqa PLR0913
434436
header_dtype = to_structured_type(segy_spec.trace.header.dtype)
435437

436438
if os.getenv("MDIO__DO_RAW_HEADERS") == "1":
437-
logger.warning("MDIO__DO_RAW_HEADERS is experimental and expected to change or be removed.")
438-
mdio_template = _add_raw_headers_to_template(mdio_template)
439+
if zarr.config.get("default_zarr_format") == ZarrFormat.V2:
440+
logger.warning("Raw headers are only supported for Zarr v3. Skipping raw headers.")
441+
else:
442+
logger.warning("MDIO__DO_RAW_HEADERS is experimental and expected to change or be removed.")
443+
mdio_template = _add_raw_headers_to_template(mdio_template)
439444

440445
horizontal_unit = _get_horizontal_coordinate_unit(segy_dimensions)
441446
mdio_ds: Dataset = mdio_template.build_dataset(

0 commit comments

Comments
 (0)