You are viewing the latest unreleased documentation v3.3.dev0. You may prefer a stable version.

iris.fileformats.cf#

Provides the capability to load netCDF files and interpret them according to the ‘NetCDF Climate and Forecast (CF) Metadata Conventions’.

References:

[CF] NetCDF Climate and Forecast (CF) Metadata conventions. [NUG] NetCDF User’s Guide, https://www.unidata.ucar.edu/software/netcdf/documentation/NUG/

In this module:

A CF-netCDF ancillary data variable is a variable that provides metadata about the individual values of another data variable.

Identified by the CF-netCDF variable attribute ‘ancillary_variables’.

Ref: [CF] Section 3.4. Ancillary Data.

class iris.fileformats.cf.CFAncillaryDataVariable(name, data)[source]#

A CF-netCDF ancillary data variable is a variable that provides metadata about the individual values of another data variable.

Identified by the CF-netCDF variable attribute ‘ancillary_variables’.

Ref: [CF] Section 3.4. Ancillary Data.

add_formula_term(root, term)#

Register the participation of this CF-netCDF variable in a CF-netCDF formula term.

Args:

  • root (string):

    The name of CF-netCDF variable that defines the CF-netCDF formula_terms attribute.

  • term (string):

    The associated term name of this variable in the formula_terms definition.

Returns

None.

cf_attrs()#

Return a list of all attribute name and value pairs of the CF-netCDF variable.

cf_attrs_ignored()#

Return a list of all ignored attribute name and value pairs of the CF-netCDF variable.

cf_attrs_reset()#

Reset the history of accessed attribute names of the CF-netCDF variable.

cf_attrs_unused()#

Return a list of all non-accessed attribute name and value pairs of the CF-netCDF variable.

cf_attrs_used()#

Return a list of all accessed attribute name and value pairs of the CF-netCDF variable.

has_formula_terms()#

Determine whether this CF-netCDF variable participates in a CF-netcdf formula term.

Returns

Boolean.

classmethod identify(variables, ignore=None, target=None, warn=True)[source]#

Identify all variables that match the criterion for this CF-netCDF variable class.

Args:

  • variables:

    Dictionary of netCDF4.Variable instance by variable name.

Kwargs:

  • ignore:

    List of variable names to ignore.

  • target:

    Name of a single variable to check.

  • warn:

    Issue a warning if a missing variable is referenced.

Returns

Dictionary of CFVariable instance by variable name.

spans(cf_variable)#

Determine whether the dimensionality of this variable is a subset of the specified target variable.

Note that, by default scalar variables always span the dimensionality of the target variable.

Args:

  • cf_variable:

    Compare dimensionality with the CFVariable.

Returns

Boolean.

cf_data#

NetCDF4 Variable data instance.

cf_group#

Collection of CF-netCDF variables associated with this variable.

cf_identity = 'ancillary_variables'#

Name of the netCDF variable attribute that identifies this CF-netCDF variable.

cf_name#

NetCDF variable name.

cf_terms_by_root#

CF-netCDF formula terms that his variable participates in.

↑ top ↑

A CF-netCDF auxiliary coordinate variable is any netCDF variable that contains coordinate data, but is not a CF-netCDF coordinate variable by definition.

There is no relationship between the name of a CF-netCDF auxiliary coordinate variable and the name(s) of its dimension(s).

Identified by the CF-netCDF variable attribute ‘coordinates’. Also see iris.fileformats.cf.CFLabelVariable.

Ref: [CF] Chapter 5. Coordinate Systems.

[CF] Section 6.2. Alternative Coordinates.

class iris.fileformats.cf.CFAuxiliaryCoordinateVariable(name, data)[source]#

A CF-netCDF auxiliary coordinate variable is any netCDF variable that contains coordinate data, but is not a CF-netCDF coordinate variable by definition.

There is no relationship between the name of a CF-netCDF auxiliary coordinate variable and the name(s) of its dimension(s).

Identified by the CF-netCDF variable attribute ‘coordinates’. Also see iris.fileformats.cf.CFLabelVariable.

Ref: [CF] Chapter 5. Coordinate Systems.

[CF] Section 6.2. Alternative Coordinates.

add_formula_term(root, term)#

Register the participation of this CF-netCDF variable in a CF-netCDF formula term.

Args:

  • root (string):

    The name of CF-netCDF variable that defines the CF-netCDF formula_terms attribute.

  • term (string):

    The associated term name of this variable in the formula_terms definition.

Returns

None.

cf_attrs()#

Return a list of all attribute name and value pairs of the CF-netCDF variable.

cf_attrs_ignored()#

Return a list of all ignored attribute name and value pairs of the CF-netCDF variable.

cf_attrs_reset()#

Reset the history of accessed attribute names of the CF-netCDF variable.

cf_attrs_unused()#

Return a list of all non-accessed attribute name and value pairs of the CF-netCDF variable.

cf_attrs_used()#

Return a list of all accessed attribute name and value pairs of the CF-netCDF variable.

has_formula_terms()#

Determine whether this CF-netCDF variable participates in a CF-netcdf formula term.

Returns

Boolean.

classmethod identify(variables, ignore=None, target=None, warn=True)[source]#

Identify all variables that match the criterion for this CF-netCDF variable class.

Args:

  • variables:

    Dictionary of netCDF4.Variable instance by variable name.

Kwargs:

  • ignore:

    List of variable names to ignore.

  • target:

    Name of a single variable to check.

  • warn:

    Issue a warning if a missing variable is referenced.

Returns

Dictionary of CFVariable instance by variable name.

spans(cf_variable)#

Determine whether the dimensionality of this variable is a subset of the specified target variable.

Note that, by default scalar variables always span the dimensionality of the target variable.

Args:

  • cf_variable:

    Compare dimensionality with the CFVariable.

Returns

Boolean.

cf_data#

NetCDF4 Variable data instance.

cf_group#

Collection of CF-netCDF variables associated with this variable.

cf_identity = 'coordinates'#

Name of the netCDF variable attribute that identifies this CF-netCDF variable.

cf_name#

NetCDF variable name.

cf_terms_by_root#

CF-netCDF formula terms that his variable participates in.

↑ top ↑

A CF-netCDF boundary variable is associated with a CF-netCDF variable that contains coordinate data. When a data value provides information about conditions in a cell occupying a region of space/time or some other dimension, the boundary variable provides a description of cell extent.

A CF-netCDF boundary variable will have one more dimension than its associated CF-netCDF coordinate variable or CF-netCDF auxiliary coordinate variable.

Identified by the CF-netCDF variable attribute ‘bounds’.

Ref: [CF] Section 7.1. Cell Boundaries.

class iris.fileformats.cf.CFBoundaryVariable(name, data)[source]#

A CF-netCDF boundary variable is associated with a CF-netCDF variable that contains coordinate data. When a data value provides information about conditions in a cell occupying a region of space/time or some other dimension, the boundary variable provides a description of cell extent.

A CF-netCDF boundary variable will have one more dimension than its associated CF-netCDF coordinate variable or CF-netCDF auxiliary coordinate variable.

Identified by the CF-netCDF variable attribute ‘bounds’.

Ref: [CF] Section 7.1. Cell Boundaries.

add_formula_term(root, term)#

Register the participation of this CF-netCDF variable in a CF-netCDF formula term.

Args:

  • root (string):

    The name of CF-netCDF variable that defines the CF-netCDF formula_terms attribute.

  • term (string):

    The associated term name of this variable in the formula_terms definition.

Returns

None.

cf_attrs()#

Return a list of all attribute name and value pairs of the CF-netCDF variable.

cf_attrs_ignored()#

Return a list of all ignored attribute name and value pairs of the CF-netCDF variable.

cf_attrs_reset()#

Reset the history of accessed attribute names of the CF-netCDF variable.

cf_attrs_unused()#

Return a list of all non-accessed attribute name and value pairs of the CF-netCDF variable.

cf_attrs_used()#

Return a list of all accessed attribute name and value pairs of the CF-netCDF variable.

has_formula_terms()#

Determine whether this CF-netCDF variable participates in a CF-netcdf formula term.

Returns

Boolean.

classmethod identify(variables, ignore=None, target=None, warn=True)[source]#

Identify all variables that match the criterion for this CF-netCDF variable class.

Args:

  • variables:

    Dictionary of netCDF4.Variable instance by variable name.

Kwargs:

  • ignore:

    List of variable names to ignore.

  • target:

    Name of a single variable to check.

  • warn:

    Issue a warning if a missing variable is referenced.

Returns

Dictionary of CFVariable instance by variable name.

spans(cf_variable)[source]#

Determine whether the dimensionality of this variable is a subset of the specified target variable.

Note that, by default scalar variables always span the dimensionality of the target variable.

Args:

  • cf_variable:

    Compare dimensionality with the CFVariable.

Returns

Boolean.

cf_data#

NetCDF4 Variable data instance.

cf_group#

Collection of CF-netCDF variables associated with this variable.

cf_identity = 'bounds'#

Name of the netCDF variable attribute that identifies this CF-netCDF variable.

cf_name#

NetCDF variable name.

cf_terms_by_root#

CF-netCDF formula terms that his variable participates in.

↑ top ↑

A CF-netCDF climatology variable is associated with a CF-netCDF variable that contains coordinate data. When a data value provides information about conditions in a cell occupying a region of space/time or some other dimension, the climatology variable provides a climatological description of cell extent.

A CF-netCDF climatology variable will have one more dimension than its associated CF-netCDF coordinate variable.

Identified by the CF-netCDF variable attribute ‘climatology’.

Ref: [CF] Section 7.4. Climatological Statistics

class iris.fileformats.cf.CFClimatologyVariable(name, data)[source]#

A CF-netCDF climatology variable is associated with a CF-netCDF variable that contains coordinate data. When a data value provides information about conditions in a cell occupying a region of space/time or some other dimension, the climatology variable provides a climatological description of cell extent.

A CF-netCDF climatology variable will have one more dimension than its associated CF-netCDF coordinate variable.

Identified by the CF-netCDF variable attribute ‘climatology’.

Ref: [CF] Section 7.4. Climatological Statistics

add_formula_term(root, term)#

Register the participation of this CF-netCDF variable in a CF-netCDF formula term.

Args:

  • root (string):

    The name of CF-netCDF variable that defines the CF-netCDF formula_terms attribute.

  • term (string):

    The associated term name of this variable in the formula_terms definition.

Returns

None.

cf_attrs()#

Return a list of all attribute name and value pairs of the CF-netCDF variable.

cf_attrs_ignored()#

Return a list of all ignored attribute name and value pairs of the CF-netCDF variable.

cf_attrs_reset()#

Reset the history of accessed attribute names of the CF-netCDF variable.

cf_attrs_unused()#

Return a list of all non-accessed attribute name and value pairs of the CF-netCDF variable.

cf_attrs_used()#

Return a list of all accessed attribute name and value pairs of the CF-netCDF variable.

has_formula_terms()#

Determine whether this CF-netCDF variable participates in a CF-netcdf formula term.

Returns

Boolean.

classmethod identify(variables, ignore=None, target=None, warn=True)[source]#

Identify all variables that match the criterion for this CF-netCDF variable class.

Args:

  • variables:

    Dictionary of netCDF4.Variable instance by variable name.

Kwargs:

  • ignore:

    List of variable names to ignore.

  • target:

    Name of a single variable to check.

  • warn:

    Issue a warning if a missing variable is referenced.

Returns

Dictionary of CFVariable instance by variable name.

spans(cf_variable)[source]#

Determine whether the dimensionality of this variable is a subset of the specified target variable.

Note that, by default scalar variables always span the dimensionality of the target variable.

Args:

  • cf_variable:

    Compare dimensionality with the CFVariable.

Returns

Boolean.

cf_data#

NetCDF4 Variable data instance.

cf_group#

Collection of CF-netCDF variables associated with this variable.

cf_identity = 'climatology'#

Name of the netCDF variable attribute that identifies this CF-netCDF variable.

cf_name#

NetCDF variable name.

cf_terms_by_root#

CF-netCDF formula terms that his variable participates in.

↑ top ↑

A CF-netCDF coordinate variable is a one-dimensional variable with the same name as its dimension, and it is defined as a numeric data type with values that are ordered monotonically. Missing values are not allowed in CF-netCDF coordinate variables. Also see [NUG] Section 2.3.1.

Identified by the above criterion, there is no associated CF-netCDF variable attribute.

Ref: [CF] 1.2. Terminology.

class iris.fileformats.cf.CFCoordinateVariable(name, data)[source]#

A CF-netCDF coordinate variable is a one-dimensional variable with the same name as its dimension, and it is defined as a numeric data type with values that are ordered monotonically. Missing values are not allowed in CF-netCDF coordinate variables. Also see [NUG] Section 2.3.1.

Identified by the above criterion, there is no associated CF-netCDF variable attribute.

Ref: [CF] 1.2. Terminology.

add_formula_term(root, term)#

Register the participation of this CF-netCDF variable in a CF-netCDF formula term.

Args:

  • root (string):

    The name of CF-netCDF variable that defines the CF-netCDF formula_terms attribute.

  • term (string):

    The associated term name of this variable in the formula_terms definition.

Returns

None.

cf_attrs()#

Return a list of all attribute name and value pairs of the CF-netCDF variable.

cf_attrs_ignored()#

Return a list of all ignored attribute name and value pairs of the CF-netCDF variable.

cf_attrs_reset()#

Reset the history of accessed attribute names of the CF-netCDF variable.

cf_attrs_unused()#

Return a list of all non-accessed attribute name and value pairs of the CF-netCDF variable.

cf_attrs_used()#

Return a list of all accessed attribute name and value pairs of the CF-netCDF variable.

has_formula_terms()#

Determine whether this CF-netCDF variable participates in a CF-netcdf formula term.

Returns

Boolean.

classmethod identify(variables, ignore=None, target=None, warn=True, monotonic=False)[source]#

Identify all variables that match the criterion for this CF-netCDF variable class.

Args:

  • variables:

    Dictionary of netCDF4.Variable instance by variable name.

Kwargs:

  • ignore:

    List of variable names to ignore.

  • target:

    Name of a single variable to check.

  • warn:

    Issue a warning if a missing variable is referenced.

Returns

Dictionary of CFVariable instance by variable name.

spans(cf_variable)#

Determine whether the dimensionality of this variable is a subset of the specified target variable.

Note that, by default scalar variables always span the dimensionality of the target variable.

Args:

  • cf_variable:

    Compare dimensionality with the CFVariable.

Returns

Boolean.

cf_data#

NetCDF4 Variable data instance.

cf_group#

Collection of CF-netCDF variables associated with this variable.

cf_identity = None#

Name of the netCDF variable attribute that identifies this CF-netCDF variable.

cf_name#

NetCDF variable name.

cf_terms_by_root#

CF-netCDF formula terms that his variable participates in.

↑ top ↑

A CF-netCDF variable containing data pay-load that maps to an Iris iris.cube.Cube.

class iris.fileformats.cf.CFDataVariable(name, data)[source]#

A CF-netCDF variable containing data pay-load that maps to an Iris iris.cube.Cube.

add_formula_term(root, term)#

Register the participation of this CF-netCDF variable in a CF-netCDF formula term.

Args:

  • root (string):

    The name of CF-netCDF variable that defines the CF-netCDF formula_terms attribute.

  • term (string):

    The associated term name of this variable in the formula_terms definition.

Returns

None.

cf_attrs()#

Return a list of all attribute name and value pairs of the CF-netCDF variable.

cf_attrs_ignored()#

Return a list of all ignored attribute name and value pairs of the CF-netCDF variable.

cf_attrs_reset()#

Reset the history of accessed attribute names of the CF-netCDF variable.

cf_attrs_unused()#

Return a list of all non-accessed attribute name and value pairs of the CF-netCDF variable.

cf_attrs_used()#

Return a list of all accessed attribute name and value pairs of the CF-netCDF variable.

has_formula_terms()#

Determine whether this CF-netCDF variable participates in a CF-netcdf formula term.

Returns

Boolean.

classmethod identify(variables, ignore=None, target=None, warn=True)[source]#

Identify all variables that match the criterion for this CF-netCDF variable class.

Args:

  • variables:

    Dictionary of netCDF4.Variable instance by variable name.

Kwargs:

  • ignore:

    List of variable names to ignore.

  • target:

    Name of a single variable to check.

  • warn:

    Issue a warning if a missing variable is referenced.

Returns

Dictionary of CFVariable instance by variable name.

spans(cf_variable)#

Determine whether the dimensionality of this variable is a subset of the specified target variable.

Note that, by default scalar variables always span the dimensionality of the target variable.

Args:

  • cf_variable:

    Compare dimensionality with the CFVariable.

Returns

Boolean.

cf_data#

NetCDF4 Variable data instance.

cf_group#

Collection of CF-netCDF variables associated with this variable.

cf_identity = None#

Name of the netCDF variable attribute that identifies this CF-netCDF variable.

cf_name#

NetCDF variable name.

cf_terms_by_root#

CF-netCDF formula terms that his variable participates in.

↑ top ↑

A CF-netCDF grid mapping variable contains a list of specific attributes that define a particular grid mapping. A CF-netCDF grid mapping variable must contain the attribute ‘grid_mapping_name’.

Based on the value of the ‘grid_mapping_name’ attribute, there are associated standard names of CF-netCDF coordinate variables that contain the mapping’s independent variables.

Identified by the CF-netCDF variable attribute ‘grid_mapping’.

Ref: [CF] Section 5.6. Horizontal Coordinate Reference Systems, Grid Mappings, and Projections.

[CF] Appendix F. Grid Mappings.

class iris.fileformats.cf.CFGridMappingVariable(name, data)[source]#

A CF-netCDF grid mapping variable contains a list of specific attributes that define a particular grid mapping. A CF-netCDF grid mapping variable must contain the attribute ‘grid_mapping_name’.

Based on the value of the ‘grid_mapping_name’ attribute, there are associated standard names of CF-netCDF coordinate variables that contain the mapping’s independent variables.

Identified by the CF-netCDF variable attribute ‘grid_mapping’.

Ref: [CF] Section 5.6. Horizontal Coordinate Reference Systems, Grid Mappings, and Projections.

[CF] Appendix F. Grid Mappings.

add_formula_term(root, term)#

Register the participation of this CF-netCDF variable in a CF-netCDF formula term.

Args:

  • root (string):

    The name of CF-netCDF variable that defines the CF-netCDF formula_terms attribute.

  • term (string):

    The associated term name of this variable in the formula_terms definition.

Returns

None.

cf_attrs()#

Return a list of all attribute name and value pairs of the CF-netCDF variable.

cf_attrs_ignored()#

Return a list of all ignored attribute name and value pairs of the CF-netCDF variable.

cf_attrs_reset()#

Reset the history of accessed attribute names of the CF-netCDF variable.

cf_attrs_unused()#

Return a list of all non-accessed attribute name and value pairs of the CF-netCDF variable.

cf_attrs_used()#

Return a list of all accessed attribute name and value pairs of the CF-netCDF variable.

has_formula_terms()#

Determine whether this CF-netCDF variable participates in a CF-netcdf formula term.

Returns

Boolean.

classmethod identify(variables, ignore=None, target=None, warn=True)[source]#

Identify all variables that match the criterion for this CF-netCDF variable class.

Args:

  • variables:

    Dictionary of netCDF4.Variable instance by variable name.

Kwargs:

  • ignore:

    List of variable names to ignore.

  • target:

    Name of a single variable to check.

  • warn:

    Issue a warning if a missing variable is referenced.

Returns

Dictionary of CFVariable instance by variable name.

spans(cf_variable)#

Determine whether the dimensionality of this variable is a subset of the specified target variable.

Note that, by default scalar variables always span the dimensionality of the target variable.

Args:

  • cf_variable:

    Compare dimensionality with the CFVariable.

Returns

Boolean.

cf_data#

NetCDF4 Variable data instance.

cf_group#

Collection of CF-netCDF variables associated with this variable.

cf_identity = 'grid_mapping'#

Name of the netCDF variable attribute that identifies this CF-netCDF variable.

cf_name#

NetCDF variable name.

cf_terms_by_root#

CF-netCDF formula terms that his variable participates in.

↑ top ↑

Represents a collection of ‘NetCDF Climate and Forecast (CF) Metadata Conventions’ variables and netCDF global attributes.

class iris.fileformats.cf.CFGroup[source]#

Represents a collection of ‘NetCDF Climate and Forecast (CF) Metadata Conventions’ variables and netCDF global attributes.

clear() None.  Remove all items from D.#
get(k[, d]) D[k] if k in D, else d.  d defaults to None.#
items() a set-like object providing a view on D's items#
keys()[source]#

Return the names of all the CF-netCDF variables in the group.

pop(k[, d]) v, remove specified key and return the corresponding value.#

If key is not found, d is returned if given, otherwise KeyError is raised.

popitem() (k, v), remove and return some (key, value) pair#

as a 2-tuple; but raise KeyError if D is empty.

setdefault(k[, d]) D.get(k,d), also set D[k]=d if k not in D#
update([E, ]**F) None.  Update D from mapping/iterable E and F.#

If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v

values() an object providing a view on D's values#
property ancillary_variables#

Collection of CF-netCDF ancillary variables.

property auxiliary_coordinates#

Collection of CF-netCDF auxiliary coordinate variables.

property bounds#

Collection of CF-netCDF boundary variables.

property cell_measures#

Collection of CF-netCDF measure variables.

property climatology#

Collection of CF-netCDF climatology variables.

property coordinates#

Collection of CF-netCDF coordinate variables.

property data_variables#

Collection of CF-netCDF data pay-load variables.

property formula_terms#

Collection of CF-netCDF variables that participate in a CF-netCDF formula term.

global_attributes#

Collection of netCDF global attributes

property grid_mappings#

Collection of CF-netCDF grid mapping variables.

property labels#

Collection of CF-netCDF label variables.

property non_data_variable_names#

set of the names of the CF-netCDF variables that are not the data pay-load.

promoted#

Collection of CF-netCDF variables promoted to a CFDataVariable.

↑ top ↑

A CF-netCDF CF label variable is any netCDF variable that contain string textual information, or labels.

Identified by the CF-netCDF variable attribute ‘coordinates’. Also see iris.fileformats.cf.CFAuxiliaryCoordinateVariable.

Ref: [CF] Section 6.1. Labels.

class iris.fileformats.cf.CFLabelVariable(name, data)[source]#

A CF-netCDF CF label variable is any netCDF variable that contain string textual information, or labels.

Identified by the CF-netCDF variable attribute ‘coordinates’. Also see iris.fileformats.cf.CFAuxiliaryCoordinateVariable.

Ref: [CF] Section 6.1. Labels.

add_formula_term(root, term)#

Register the participation of this CF-netCDF variable in a CF-netCDF formula term.

Args:

  • root (string):

    The name of CF-netCDF variable that defines the CF-netCDF formula_terms attribute.

  • term (string):

    The associated term name of this variable in the formula_terms definition.

Returns

None.

cf_attrs()#

Return a list of all attribute name and value pairs of the CF-netCDF variable.

cf_attrs_ignored()#

Return a list of all ignored attribute name and value pairs of the CF-netCDF variable.

cf_attrs_reset()#

Reset the history of accessed attribute names of the CF-netCDF variable.

cf_attrs_unused()#

Return a list of all non-accessed attribute name and value pairs of the CF-netCDF variable.

cf_attrs_used()#

Return a list of all accessed attribute name and value pairs of the CF-netCDF variable.

cf_label_data(cf_data_var)[source]#

Return the associated CF-netCDF label variable strings.

Args:

Returns

String labels.

cf_label_dimensions(cf_data_var)[source]#

Return the name of the associated CF-netCDF label variable data dimensions.

Args:

Returns

Tuple of label data dimension names.

has_formula_terms()#

Determine whether this CF-netCDF variable participates in a CF-netcdf formula term.

Returns

Boolean.

classmethod identify(variables, ignore=None, target=None, warn=True)[source]#

Identify all variables that match the criterion for this CF-netCDF variable class.

Args:

  • variables:

    Dictionary of netCDF4.Variable instance by variable name.

Kwargs:

  • ignore:

    List of variable names to ignore.

  • target:

    Name of a single variable to check.

  • warn:

    Issue a warning if a missing variable is referenced.

Returns

Dictionary of CFVariable instance by variable name.

spans(cf_variable)[source]#

Determine whether the dimensionality of this variable is a subset of the specified target variable.

Note that, by default scalar variables always span the dimensionality of the target variable.

Args:

  • cf_variable:

    Compare dimensionality with the CFVariable.

Returns

Boolean.

cf_data#

NetCDF4 Variable data instance.

cf_group#

Collection of CF-netCDF variables associated with this variable.

cf_identity = 'coordinates'#

Name of the netCDF variable attribute that identifies this CF-netCDF variable.

cf_name#

NetCDF variable name.

cf_terms_by_root#

CF-netCDF formula terms that his variable participates in.

↑ top ↑

A CF-netCDF measure variable is a variable that contains cell areas or volumes.

Identified by the CF-netCDF variable attribute ‘cell_measures’.

Ref: [CF] Section 7.2. Cell Measures.

class iris.fileformats.cf.CFMeasureVariable(name, data, measure)[source]#

A CF-netCDF measure variable is a variable that contains cell areas or volumes.

Identified by the CF-netCDF variable attribute ‘cell_measures’.

Ref: [CF] Section 7.2. Cell Measures.

add_formula_term(root, term)#

Register the participation of this CF-netCDF variable in a CF-netCDF formula term.

Args:

  • root (string):

    The name of CF-netCDF variable that defines the CF-netCDF formula_terms attribute.

  • term (string):

    The associated term name of this variable in the formula_terms definition.

Returns

None.

cf_attrs()#

Return a list of all attribute name and value pairs of the CF-netCDF variable.

cf_attrs_ignored()#

Return a list of all ignored attribute name and value pairs of the CF-netCDF variable.

cf_attrs_reset()#

Reset the history of accessed attribute names of the CF-netCDF variable.

cf_attrs_unused()#

Return a list of all non-accessed attribute name and value pairs of the CF-netCDF variable.

cf_attrs_used()#

Return a list of all accessed attribute name and value pairs of the CF-netCDF variable.

has_formula_terms()#

Determine whether this CF-netCDF variable participates in a CF-netcdf formula term.

Returns

Boolean.

classmethod identify(variables, ignore=None, target=None, warn=True)[source]#

Identify all variables that match the criterion for this CF-netCDF variable class.

Args:

  • variables:

    Dictionary of netCDF4.Variable instance by variable name.

Kwargs:

  • ignore:

    List of variable names to ignore.

  • target:

    Name of a single variable to check.

  • warn:

    Issue a warning if a missing variable is referenced.

Returns

Dictionary of CFVariable instance by variable name.

spans(cf_variable)#

Determine whether the dimensionality of this variable is a subset of the specified target variable.

Note that, by default scalar variables always span the dimensionality of the target variable.

Args:

  • cf_variable:

    Compare dimensionality with the CFVariable.

Returns

Boolean.

cf_data#

NetCDF4 Variable data instance.

cf_group#

Collection of CF-netCDF variables associated with this variable.

cf_identity = 'cell_measures'#

Name of the netCDF variable attribute that identifies this CF-netCDF variable.

cf_measure#

Associated cell measure of the cell variable

cf_name#

NetCDF variable name.

cf_terms_by_root#

CF-netCDF formula terms that his variable participates in.

↑ top ↑

This class allows the contents of a netCDF file to be interpreted according to the ‘NetCDF Climate and Forecast (CF) Metadata Conventions’.

class iris.fileformats.cf.CFReader(filename, warn=False, monotonic=False)[source]#

This class allows the contents of a netCDF file to be interpreted according to the ‘NetCDF Climate and Forecast (CF) Metadata Conventions’.

class CFGroup#

Represents a collection of ‘NetCDF Climate and Forecast (CF) Metadata Conventions’ variables and netCDF global attributes.

clear() None.  Remove all items from D.#
get(k[, d]) D[k] if k in D, else d.  d defaults to None.#
items() a set-like object providing a view on D's items#
keys()#

Return the names of all the CF-netCDF variables in the group.

pop(k[, d]) v, remove specified key and return the corresponding value.#

If key is not found, d is returned if given, otherwise KeyError is raised.

popitem() (k, v), remove and return some (key, value) pair#

as a 2-tuple; but raise KeyError if D is empty.

setdefault(k[, d]) D.get(k,d), also set D[k]=d if k not in D#
update([E, ]**F) None.  Update D from mapping/iterable E and F.#

If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v

values() an object providing a view on D's values#
property ancillary_variables#

Collection of CF-netCDF ancillary variables.

property auxiliary_coordinates#

Collection of CF-netCDF auxiliary coordinate variables.

property bounds#

Collection of CF-netCDF boundary variables.

property cell_measures#

Collection of CF-netCDF measure variables.

property climatology#

Collection of CF-netCDF climatology variables.

property coordinates#

Collection of CF-netCDF coordinate variables.

property data_variables#

Collection of CF-netCDF data pay-load variables.

property formula_terms#

Collection of CF-netCDF variables that participate in a CF-netCDF formula term.

global_attributes#

Collection of netCDF global attributes

property grid_mappings#

Collection of CF-netCDF grid mapping variables.

property labels#

Collection of CF-netCDF label variables.

property non_data_variable_names#

set of the names of the CF-netCDF variables that are not the data pay-load.

promoted#

Collection of CF-netCDF variables promoted to a CFDataVariable.

cf_group#

Collection of CF-netCDF variables associated with this netCDF file

property filename#

The file that the CFReader is reading.

↑ top ↑

Abstract base class wrapper for a CF-netCDF variable.

class iris.fileformats.cf.CFVariable(name, data)[source]#

Abstract base class wrapper for a CF-netCDF variable.

add_formula_term(root, term)[source]#

Register the participation of this CF-netCDF variable in a CF-netCDF formula term.

Args:

  • root (string):

    The name of CF-netCDF variable that defines the CF-netCDF formula_terms attribute.

  • term (string):

    The associated term name of this variable in the formula_terms definition.

Returns

None.

cf_attrs()[source]#

Return a list of all attribute name and value pairs of the CF-netCDF variable.

cf_attrs_ignored()[source]#

Return a list of all ignored attribute name and value pairs of the CF-netCDF variable.

cf_attrs_reset()[source]#

Reset the history of accessed attribute names of the CF-netCDF variable.

cf_attrs_unused()[source]#

Return a list of all non-accessed attribute name and value pairs of the CF-netCDF variable.

cf_attrs_used()[source]#

Return a list of all accessed attribute name and value pairs of the CF-netCDF variable.

has_formula_terms()[source]#

Determine whether this CF-netCDF variable participates in a CF-netcdf formula term.

Returns

Boolean.

abstract identify(variables, ignore=None, target=None, warn=True)[source]#

Identify all variables that match the criterion for this CF-netCDF variable class.

Args:

  • variables:

    Dictionary of netCDF4.Variable instance by variable name.

Kwargs:

  • ignore:

    List of variable names to ignore.

  • target:

    Name of a single variable to check.

  • warn:

    Issue a warning if a missing variable is referenced.

Returns

Dictionary of CFVariable instance by variable name.

spans(cf_variable)[source]#

Determine whether the dimensionality of this variable is a subset of the specified target variable.

Note that, by default scalar variables always span the dimensionality of the target variable.

Args:

  • cf_variable:

    Compare dimensionality with the CFVariable.

Returns

Boolean.

cf_data#

NetCDF4 Variable data instance.

cf_group#

Collection of CF-netCDF variables associated with this variable.

cf_identity = None#

Name of the netCDF variable attribute that identifies this CF-netCDF variable.

cf_name#

NetCDF variable name.

cf_terms_by_root#

CF-netCDF formula terms that his variable participates in.