Skip to content

Commit 4d063f2

Browse files
BrianMichelltasansal
authored andcommitted
Add v2 issue check
1 parent fb90ecf commit 4d063f2

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
@@ -431,8 +433,11 @@ def segy_to_mdio( # noqa PLR0913
431433
header_dtype = to_structured_type(segy_spec.trace.header.dtype)
432434

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

437442
horizontal_unit = _get_horizontal_coordinate_unit(segy_dimensions)
438443
mdio_ds: Dataset = mdio_template.build_dataset(

0 commit comments

Comments
 (0)