Provides the capability to load netCDF files and interprete them according to the ‘NetCDF Climate and Forecast (CF) Metadata Conventions’.
References:
[CF] NetCDF Climate and Forecast (CF) Metadata conventions, Version 1.5, October, 2010. [NUG] NetCDF User’s Guide, http://www.unidata.ucar.edu/software/netcdf/docs/netcdf.html
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)¶
Bases: iris.fileformats.cf.CFVariable
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)¶
- 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_identity = 'ancillary_variables'¶
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.
- class iris.fileformats.cf.CFAuxiliaryCoordinateVariable(name, data)¶
Bases: iris.fileformats.cf.CFVariable
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)¶
- 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_identity = 'coordinates'¶
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)¶
Bases: iris.fileformats.cf.CFVariable
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)¶
- 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_identity = 'bounds'¶
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)¶
Bases: iris.fileformats.cf.CFVariable
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)¶
- 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_identity = 'climatology'¶
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)¶
Bases: iris.fileformats.cf.CFVariable
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)¶
- 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_identity = None¶
A CF-netCDF variable containing data pay-load that maps to an Iris iris.cube.Cube.
- class iris.fileformats.cf.CFDataVariable(name, data)¶
Bases: iris.fileformats.cf.CFVariable
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)¶
- 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_identity = None¶
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’.
- class iris.fileformats.cf.CFGridMappingVariable(name, data)¶
Bases: iris.fileformats.cf.CFVariable
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)¶
- 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_identity = 'grid_mapping'¶
Represents a collection of ‘NetCDF Climate and Forecast (CF) Metadata Conventions’ variables and netCDF global attributes.
- class iris.fileformats.cf.CFGroup¶
Bases: object, UserDict.DictMixin
Represents a collection of ‘NetCDF Climate and Forecast (CF) Metadata Conventions’ variables and netCDF global attributes.
- clear()¶
- get(key, default=None)¶
- has_key(key)¶
- items()¶
- iteritems()¶
- iterkeys()¶
- itervalues()¶
- keys()¶
Return the names of all the CF-netCDF variables in the group.
- pop(key, *args)¶
- popitem()¶
- setdefault(key, default=None)¶
- update(other=None, **kwargs)¶
- values()¶
- ancillary_variables¶
Collection of CF-netCDF ancillary variables.
- auxiliary_coordinates¶
Collection of CF-netCDF auxiliary coordinate variables.
- bounds¶
Collection of CF-netCDF boundary variables.
- cell_measures¶
Collection of CF-netCDF measure variables.
- climatology¶
Collection of CF-netCDF climatology variables.
- coordinates¶
Collection of CF-netCDF coordinate variables.
- data_variables¶
Collection of CF-netCDF data pay-load variables.
- formula_terms¶
Collection of CF-netCDF variables that participate in a CF-netCDF formula term.
- global_attributes = None¶
Collection of netCDF global attributes
- grid_mappings¶
Collection of CF-netCDF grid mapping variables.
- labels¶
Collection of CF-netCDF label variables.
- promoted = None¶
Collection of CF-netCDF variables promoted to a CFDataVariable.
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)¶
Bases: iris.fileformats.cf.CFVariable
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)¶
Return the associated CF-netCDF label variable strings.
Args:
- cf_data_var (iris.fileformats.cf.CFDataVariable):
The CF-netCDF data variable which the CF-netCDF label variable describes.
- Returns:
- String labels.
- cf_label_dimensions(cf_data_var)¶
Return the name of the associated CF-netCDF label variable data dimensions.
Args:
- cf_data_var (iris.fileformats.cf.CFDataVariable):
The CF-netCDF data variable which the CF-netCDF label variable describes.
- 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)¶
- 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_identity = 'coordinates'¶
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)¶
Bases: iris.fileformats.cf.CFVariable
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)¶
- 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_identity = 'cell_measures'¶
- cf_measure = None¶
Associated cell measure of the cell variable
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)¶
Bases: object
This class allows the contents of a netCDF file to be interpreted according to the ‘NetCDF Climate and Forecast (CF) Metadata Conventions’.
- cf_group = None¶
Collection of CF-netCDF variables associated with this netCDF file
Abstract base class wrapper for a CF-netCDF variable.
- class iris.fileformats.cf.CFVariable(name, data)¶
Bases: object
Abstract base class wrapper for a CF-netCDF variable.
- 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.
- identify(variables, ignore=None, target=None, warn=True)¶
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 = None¶
NetCDF4 Variable data instance.
- cf_group = None¶
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 = None¶
NetCDF variable name.
- cf_terms_by_root = None¶
CF-netCDF formula terms that his variable participates in.