You are viewing the latest unreleased documentation 3.10.0.dev14. You can switch to a stable version.

iris.experimental.ugrid.load#

Allow the construction of Mesh.

Extensions to Iris’ NetCDF loading to allow the construction of Mesh from UGRID data in the file.

Eventual destination: iris.fileformats.netcdf.

iris.experimental.ugrid.load.PARSE_UGRID_ON_LOAD = <iris.experimental.ugrid.load.ParseUGridOnLoad object>#

Run-time switch for experimental UGRID-aware NetCDF loading. See ParseUGridOnLoad.

class iris.experimental.ugrid.load.ParseUGridOnLoad[source]#

Bases: _local

Thead-safe state to enable UGRID-aware NetCDF loading.

A flag for dictating whether to use the experimental UGRID-aware version of Iris NetCDF loading. Object is thread-safe.

Use via the run-time switch PARSE_UGRID_ON_LOAD. Use context() to temporarily activate.

context()[source]#

Temporarily activate experimental UGRID-aware NetCDF loading.

Use the standard Iris loading API while within the context manager. If the loaded file(s) include any UGRID content, this will be parsed and attached to the resultant cube(s) accordingly.

Use via the run-time switch PARSE_UGRID_ON_LOAD.

For example:

with PARSE_UGRID_ON_LOAD.context():
    my_cube_list = iris.load([my_file_path, my_file_path2],
                             constraint=my_constraint,
                             callback=my_callback)
iris.experimental.ugrid.load.load_mesh(uris, var_name=None)[source]#

Load a single Mesh object from one or more NetCDF files.

Raises an error if more/less than one Mesh is found.

Parameters:
  • uris (str or iterable of str) – One or more filenames/URI’s. Filenames can include wildcards. Any URI’s must support OpenDAP.

  • var_name (str, optional) – Only return a Mesh if its var_name matches this value.

Return type:

iris.experimental.ugrid.mesh.Mesh

iris.experimental.ugrid.load.load_meshes(uris, var_name=None)[source]#

Load Mesh objects from one or more NetCDF files.

Parameters:
  • uris (str or iterable of str) – One or more filenames/URI’s. Filenames can include wildcards. Any URI’s must support OpenDAP.

  • var_name (str, optional) – Only return Mesh that have var_names matching this value.

Returns:

A dictionary mapping each mesh-containing file path/URL in the input uris to a list of the Mesh returned from each.

Return type:

dict