anu_ctlab_io.zarr ================= .. py:module:: anu_ctlab_io.zarr .. autoapi-nested-parse:: Read and write data from/to the ANU CTLab zarr data format. This is an optional extra module, and must be explicitly installed to be used (e.g., ``pip install anu_ctlab_io[zarr]``). Package Contents ---------------- .. py:class:: OMEZarrVersion(*args, **kwds) Bases: :py:obj:`enum.Enum` OME-Zarr specification version to use when writing. .. py:attribute:: v05 :value: '0.5' .. py:function:: dataset_to_zarr(dataset, path, datatype = None, dataset_id = None, ome_zarr_version = OMEZarrVersion.v05, max_shard_size_mb = 1000.0, history = None, chunk_size_mb = 10.0, chunks = None, shards = None, create_array_kwargs = None, **extra_attrs) Write a :any:`Dataset` to Zarr format. :param dataset: The :any:`Dataset` to write. :param path: Path to write the Zarr store. :param datatype: The data type identifier. If None, attempts to infer from dataset. :param dataset_id: Unique identifier for the dataset. Auto-generated if not provided. :param ome_zarr_version: OME-Zarr specification version to use. Set to :any:`OMEZarrVersion.v05` (default) to write OME-Zarr V0.5 group format. Set to ``None`` to write a simple Zarr V3 array with mango metadata. :param max_shard_size_mb: Maximum shard size in MB for Zarr v3 sharding. Default 1000 MB (1 GB). Shards group multiple chunks into indexed files for better filesystem performance. Mutually exclusive with ``chunks`` and ``shards`` parameters. :param history: Dictionary of history entries to add. Keys should be identifiers, values are history strings. :param chunk_size_mb: Target chunk size in MB for automatic chunking. Default 10.0 MB. Mutually exclusive with ``chunks`` and ``shards`` parameters. :param chunks: Explicit chunk shape as a tuple (e.g., ``(10, 512, 512)``). Must be provided together with ``shards``. Cannot be used with ``chunk_size_mb`` or ``max_shard_size_mb``. When provided, user is responsible for ensuring valid chunk/shard alignment. :param shards: Explicit shard shape as a tuple (e.g., ``(100, 512, 512)``). Must be provided together with ``chunks``. Cannot be used with ``chunk_size_mb`` or ``max_shard_size_mb``. When provided, user is responsible for ensuring valid chunk/shard alignment. :param create_array_kwargs: Additional keyword arguments to pass to zarr.create_array(). For example, to set compression: ``create_array_kwargs={'compressors': [ZstdCodec(level=5)]}``. :param extra_attrs: Additional attributes to include in mango metadata. .. py:function:: dataset_from_zarr(path, **kwargs) Loads a :any:`Dataset` from the path to a zarr. This method is used by :any:`Dataset.from_path`, by preference call that constructor directly. :param Path: The path to the zarr to be loaded :param kwargs: Currently this method consumes no kwargs, but will pass provided kwargs to ``dask.Array.from_path``.