iris.fileformats.netcdf.loader#

Load Iris cubes from NetCDF files and OPeNDAP URLs.

Deprecated since version 3.17: CHUNK_CONTROL and ChunkControl have moved to iris.fileformats.cf.loader, because chunking policy is not specific to netCDF. They can still be reached here, with a warning, for one deprecation cycle.

API reference

Tags: topic_load_save

See : NetCDF User’s Guide and netCDF4 python module.

Also : CF Conventions.

iris.fileformats.netcdf.loader.__dir__()[source]#

List module attributes, including the relocated names.

A module __getattr__ forwards reads of the relocated names, but does not make them discoverable: PEP 562 does not extend to dir(), inspect.getmembers(), or tab-completion, so this fills the gap.

Returns:

The real module globals, unioned with the relocated names.

Return type:

list of str

iris.fileformats.netcdf.loader.__getattr__(name)[source]#

Forward a relocated name to iris.fileformats.cf.loader.

Parameters:

name (str) – The attribute being looked up. Python calls this only for names that are not already module attributes.

Returns:

The object of that name in iris.fileformats.cf.loader - the same object, not a copy.

Return type:

Any

Raises:

AttributeError – If name is not one of the relocated names. Raised without warning, so that a hasattr probe that comes back False stays quiet.

iris.fileformats.netcdf.loader.load_cubes(file_sources, callback=None, constraints=None)[source]#

Load cubes from a list of NetCDF filenames/OPeNDAP URLs.

Also supports Zarr files in the NcZarr URL format, e.g. file:///path/to/file#mode=nczarr,file. Note that NcZarr is limited to Zarr Storage Specification version 2. See the NcZarr docs <https://docs.unidata.ucar.edu/nug/current/nczarr_head.html> for more.

Parameters:
  • file_sources (str or list) – One or more NetCDF filenames/OPeNDAP URLs/NcZarr URLs to load from. OR open datasets.

  • callback (function, optional) – Function which can be passed on to iris.io.run_callback().

  • constraints (optional)

Return type:

Generator of loaded NetCDF/NcZarr iris.cube.Cube.