anu_ctlab_io.netcdf =================== .. py:module:: anu_ctlab_io.netcdf .. autoapi-nested-parse:: Read and write data from/to the ANU CTLab netcdf data format. This is an optional extra module, and must be explicitly installed to be used (e.g., ``pip install anu_ctlab_io[netcdf]``). Package Contents ---------------- .. py:function:: dataset_to_netcdf(dataset, path, datatype = None, dataset_id = None, max_file_size_mb = 500.0, compression_level = 0, history = None, **extra_attrs) Write a :any:`Dataset` to netcdf format. :param dataset: The :any:`Dataset` to write. :param path: Path to write the netcdf file or directory (if splitting). :param datatype: Data type identifier. Inferred from dataset if None. :param dataset_id: Unique dataset identifier. Auto-generated if not provided. :param max_file_size_mb: Max file size in MB. Data exceeding this is split into multiple files along z-axis. Default 500MB. Set to None for single file. :param compression_level: NetCDF compression level (0-9). Default 0 (no compression). :param history: History entries to add. Keys are identifiers, values are strings or parsed history dicts. If None, uses dataset's history attribute. :param extra_attrs: Additional global attributes to include. .. py:function:: dataset_from_netcdf(path, *, parse_history = True, **kwargs) Loads a :any:`Dataset` from the path to a netcdf. This method is used by :any:`Dataset.from_path`, by preference call that constructor directly. :param Path: The path to the netcdf or directory of split netcdf blocks to be loaded. :param parse_history: Whether to parse the history of the netcdf file. Defaults to ``True``, but disableable because the parser is currently not guaranteed to succeed. :param kwargs: Currently this method consumes no kwargs, but will pass provided kwargs to ``Xarray.open_mfdataset``. :raises lark.exceptions.UnexpectedInput: Raised if ``parse_history=True`` and the parser fails to parse the specific history provided.