Skip to content

VirtualiZarr

async_hdf5.virtualizarr.open_virtual_hdf5 async

open_virtual_hdf5(
    path: str,
    *,
    store: ObjectStore | ObspecInput,
    group: str | None = None,
    url: str | None = None,
    registry: ObjectStoreRegistry | None = None,
    drop_variables: Iterable[str] | None = None,
    block_size: int = 8 * 1024 * 1024,
) -> ManifestStore

Open an HDF5 file as a VirtualiZarr ManifestStore.

Uses async-hdf5 (a Rust HDF5 binary parser) for metadata extraction and returns a ManifestStore containing chunk manifests with byte offsets into the original file.

Call .to_virtual_dataset() or .to_virtual_datatree() on the returned store to create an xarray Dataset or DataTree.

Parameters:

  • path (str) –

    Path to the HDF5 file within the store (e.g. the filename portion of an S3 URL).

  • store (ObjectStore | ObspecInput) –

    An obstore ObjectStore instance or obspec-compatible backend.

  • group (str | None, default: None ) –

    HDF5 group to open (e.g. "science/LSAR/GCOV/grids/frequencyA"). If None, the root group is used.

  • url (str | None, default: None ) –

    Full URL of the HDF5 file (e.g. "s3://bucket/path/file.h5"). Stored in chunk manifests so ManifestStore can resolve the correct store via the registry. If None, path is used as-is.

  • registry (ObjectStoreRegistry | None, default: None ) –

    An :class:ObjectStoreRegistry mapping URL prefixes to store instances. If None, one is created automatically and the provided store is registered under the scheme/netloc of url.

  • drop_variables (Iterable[str] | None, default: None ) –

    Variable names to exclude from the virtual dataset.

  • block_size (int, default: 8 * 1024 * 1024 ) –

    Block cache size in bytes. Each unique region of the file accessed during metadata parsing triggers a fetch of the aligned block containing that region. Default 8 MiB.

Returns:

  • ManifestStore

    A ManifestStore containing virtual chunk references. Use

  • ManifestStore

    .to_virtual_dataset() to get an xarray Dataset.