Skip to main content

BAG Bathymetry

Stream BAG (Bathymetric Attributed Grid) HDF5 products as one record per grid cell.

Overview​

PropertyValue
Format idbag
ClassBAGIterable
Extensions.bag
ReadYes
WriteNo
Extrahdf5 (h5py)
Maturityexperimental

Record shape​

{"row": 0, "col": 0, "value": 1.0}

By default the first elevation dataset under /BAG_root is used. Override with dataset or table.

Usage​

from iterable import open_iterable

with open_iterable("survey.bag", format="bag") as source:
for cell in source:
print(cell["row"], cell["col"], cell["value"])

with open_iterable(
"survey.bag",
format="bag",
iterableargs={"dataset": "/BAG_root/elevation"},
) as source:
for cell in source:
print(cell)

Requires a filename (not a stream). Install with pip install iterabledata[hdf5].

Parameters​

ParameterTypeDefaultRequiredDescription
datasetstrfirst elevation under /BAG_rootNoHDF5 dataset path to stream
tablestrsame as datasetNoAlias for dataset

Pass via iterableargs, for example iterableargs={"dataset": "/BAG_root/elevation"}.

Error Handling​

  • Missing dependency: optional libraries raise ImportError with an install hint (pip install 'iterabledata[<extra>]' when an extra exists).
  • Read-only: opening with mode="w" raises WriteNotSupportedError or ValueError.
  • Bad or unsupported input: may raise ValueError, OSError, or library-specific errors.
  • See Troubleshooting for decoding, detection, and engine issues.

See also​