cf.Domain¶
-
class
cfdm.
Domain
(properties=None, source=None, copy=True, _use_data=True)[source]¶ Bases:
cfdm.mixin.fielddomain.FieldDomain
,cfdm.mixin.netcdf.NetCDFVariable
,cfdm.mixin.netcdf.NetCDFGeometry
,cfdm.mixin.netcdf.NetCDFGlobalAttributes
,cfdm.mixin.netcdf.NetCDFGroupAttributes
,cfdm.mixin.netcdf.NetCDFComponents
,cfdm.mixin.netcdf.NetCDFUnreferenced
,cfdm.mixin.properties.Properties
,cfdm.mixin.files.Files
,cfdm.core.domain.Domain
A domain construct of the CF data model.
The domain represents a set of discrete “locations” in what generally would be a multi-dimensional space, either in the real world or in a model’s simulated world. The data array elements of a field construct correspond to individual location of a domain.
The domain construct is defined collectively by the following constructs of the CF data model: domain axis, dimension coordinate, auxiliary coordinate, cell measure, coordinate reference, and domain ancillary constructs; as well as properties to describe the domain.
NetCDF interface
The netCDF variable name may be accessed with the
nc_set_variable
,nc_get_variable
,nc_del_variable
, andnc_has_variable
methods.The netCDF variable group structure may be accessed with the
nc_set_variable
,nc_get_variable
,nc_variable_groups
,nc_clear_variable_groups
, andnc_set_variable_groups
methods.The selection of properties to be written as netCDF global attributes may be accessed with the
nc_global_attributes
,nc_clear_global_attributes
, andnc_set_global_attribute
methods.The netCDF group attributes may be accessed with the
nc_group_attributes
,nc_clear_group_attributes
,nc_set_group_attribute
, andnc_set_group_attributes
methods.The netCDF geometry variable name and group structure may be accessed with the
nc_set_geometry_variable
,nc_get_geometry_variable
,nc_geometry_variable_groups
,nc_clear_variable_groups
, andnc_set_geometry_variable_groups
methods.Some components exist within multiple constructs, but when written to a netCDF dataset the netCDF names associated with such components will be arbitrarily taken from one of them. The netCDF variable, dimension and sample dimension names and group structures for such components may be set or removed consistently across all such components with the
nc_del_component_variable
,nc_set_component_variable
,nc_set_component_variable_groups
,nc_clear_component_variable_groups
,nc_del_component_dimension
,nc_set_component_dimension
,nc_set_component_dimension_groups
,nc_clear_component_dimension_groups
,nc_del_component_sample_dimension
,nc_set_component_sample_dimension
,nc_set_component_sample_dimension_groups
, andnc_clear_component_sample_dimension_groups
methods.New in version (cfdm): 1.7.0
Initialisation
- Parameters
- properties:
dict
, optional Set descriptive properties. The dictionary keys are property names, with corresponding values.
Properties may also be set after initialisation with the
set_properties
andset_property
methods.- Parameter example:
properties={'long_name': 'Domain for model'}
- source: optional
Convert source, which can be any type of object, to a
Domain
instance.All other parameters, apart from copy, are ignored and their values are instead inferred from source by assuming that it has the
Domain
API. Any parameters that can not be retrieved from source in this way are assumed to have their default value.Note that if
x
is also aDomain
instance thencfdm.Domain(source=x)
is equivalent tox.copy()
.A new domain may also be instantiated with the
fromconstructs
class method.- copy:
bool
, optional If True (the default) then deep copy the input parameters prior to initialisation. By default the parameters are not deep copied.
- properties:
Methods
Inspection¶
Methods
A full description of the domain construct. |
|
Return the canonical identity. |
|
Return all possible identities. |
Attributes
Return a description of the construct type. |
|
The number of locations in the domain. |
|
The number of axes in the domain. |
Properties¶
Methods
Remove a property. |
|
Get a CF property. |
|
Whether a property has been set. |
|
Set a property. |
|
Return all properties. |
|
Remove all properties. |
|
Remove properties. |
|
Set properties. |
Attributes
The calendar CF property. |
|
The comment CF property. |
|
The history CF property. |
|
The leap_month CF property. |
|
The leap_year CF property. |
|
The long_name CF property. |
|
The month_lengths CF property. |
|
The standard_name CF property. |
|
The units CF property. |
|
The valid_max CF property. |
|
The valid_min CF property. |
|
The valid_range CF property. |
Selection¶
Methods
Whether or not the construct identity satisfies conditions. |
|
Whether or not the netCDF variable name satisfies conditions. |
|
Whether or not properties satisfy conditions. |
|
Whether or not the number of domain axis constructs satisfies conditions. |
|
Whether or not there are particular metadata constructs. |
Rearranging¶
Methods
Roll a cyclic axis so that the given value lies in the first coordinate cell. |
|
Roll the field along a cyclic axis. |
|
Flip (reverse the direction of) domain axes. |
|
Permute the data axes of the metadata constructs. |
Metadata constructs¶
Methods
Return auxiliary coordinate constructs. |
|
Return cell measure constructs. |
|
Return dimension and auxiliary coordinate constructs. |
|
Return coordinate reference constructs. |
|
Return dimension coordinate constructs. |
|
Return domain ancillary constructs. |
|
Return domain axis constructs. |
|
Return a metadata construct. |
|
Return a metadata construct and its identifier. |
|
Return the identifier of a metadata construct. |
|
Remove a metadata construct. |
|
Return a metadata construct. |
|
Whether a unique metadata construct exists. |
|
Set a metadata construct. |
|
Replace a metadata construct. |
|
Removes the keys of the axes spanned by the construct data. |
|
Gets the keys of the axes spanned by the construct data. |
|
Whether the axes spanned by the construct data have been set. |
|
Sets domain axis constructs spanned by the construct data. |
|
Select an auxiliary coordinate construct. |
|
Move auxiliary coordinates to a dimension coordinate construct. |
|
Select a cell measure construct. |
|
Select a dimension or auxiliary coordinate construct. |
|
Return a coordinate reference construct, or its key. |
|
Return the domain axes that apply to a coordinate reference construct. |
|
Return a coordinate reference construct. |
|
Set a coordinate reference construct. |
|
Remove a coordinate reference construct and all of its domain ancillary constructs. |
|
Select a dimension coordinate construct. |
|
Move dimension coordinates to an auxiliary coordinate construct. |
|
Select a domain ancillary construct. |
|
Select a domain axis construct. |
|
Returns the domain axis key spanned by 1-d coordinates. |
|
Remove a domain axis construct. |
|
Return all axes which are climatological time axes. |
Attributes
Return the metadata constructs. |
Miscellaneous¶
Methods
Apply masking as defined by the CF conventions. |
|
Return all axes which are climatological time axes. |
|
Return a deep copy. |
|
Create a new domain with the regular longitudes and latitudes. |
|
Return the commands that would create the domain construct. |
|
Whether two constructs are the same. |
|
Return a new domain containing the given metadata constructs. |
|
Whether or not there are cell bounds. |
|
Whether or not the construct has data. |
|
Return whether or not any coordinates have cell geometries. |
|
Apply masking as defined by the CF conventions. |
|
The names of files containing the original data and metadata. |
|
Close all files referenced by the domain construct. |
|
Uncompress the domain construct. |
Domain axes¶
Set dimensions to be cyclic. |
|
Alias for |
|
Alias for |
|
Set the cyclicity of an axis. |
|
Whether or not a domain axis is increasing. |
|
Return a dictionary mapping all domain axes to their directions. |
|
Returns True if the given axis is cyclic. |
Subspacing¶
Create indices that define a subspace of the domain construct. |
|
Create indices that define a subspace of the domain construct. |
NetCDF¶
Methods
Remove the netCDF variable name. |
|
Return the netCDF variable name. |
|
Whether the netCDF variable name has been set. |
|
Set the netCDF variable name. |
|
Returns properties to write as netCDF global attributes. |
|
Removes properties to write as netCDF global attributes. |
|
Select a property to be written as a netCDF global attribute. |
|
Set properties to be written as netCDF global attributes. |
Groups¶
Methods
Return the netCDF variable group hierarchy. |
|
Set the netCDF variable group hierarchy. |
|
Remove the netCDF variable group hierarchy. |
|
Returns properties to write as netCDF group attributes. |
|
Removes properties to write as netCDF group attributes. |
|
Select a property to be written as a netCDF group attribute. |
|
Set properties to be written as netCDF group attributes. |
CFA¶
Methods
Add a new file location in-place. |
|
Remove all of the CFA-netCDF file name substitutions. |
|
Remove a CFA-netCDF file name substitution. |
|
Return the CFA-netCDF file name substitutions. |
|
Set CFA-netCDF file name substitutions. |
|
Remove a file location in-place. |
|
The locations of files containing parts of the components data. |
Geometries¶
Methods
Remove the netCDF geometry container variable name. |
|
Return the netCDF geometry container variable name. |
|
Whether a netCDF geometry container variable has a name. |
|
Set the netCDF geometry container variable name. |
|
Return the netCDF geometry variable group hierarchy. |
|
Set the netCDF geometry variable group hierarchy. |
|
Remove the netCDF geometry variable group hierarchy. |
Components¶
Methods
Remove the netCDF variable name of components. |
|
Set the netCDF variable name for components. |
|
Set the netCDF variable groups of components. |
|
Remove the netCDF variable groups of components. |
|
Remove the netCDF dimension name of components. |
|
Set the netCDF dimension name of components. |
|
Set the netCDF dimension groups of components. |
|
Remove the netCDF dimension groups of components. |
|
Remove the netCDF sample dimension name of components. |
|
Set the netCDF sample dimension name of components. |
|
Set the netCDF sample dimension groups of components. |
|
Remove the netCDF sample dimension groups of components. |
Dataset compliance¶
Methods
Return the dataset compliance report. |
Aliases¶
Methods
Alias for |
|
Alias for |
|
Alias for |
|
Alias for |
|
Alias for |
|
Alias for |
|
Alias for |
|
Alias for |
|
Alias for |
|
Alias for |
|
Alias for |
|
Alias for |
|
Alias for |
|
Alias for |
|
Alias for |
Deprecated¶
Methods
Deprecated at version 3.0.0, use method |
|
Return the file names containing the metadata construct data. |
|
Deprecated at version 3.0.0, use method |
|
Deprecated at version 3.0.0, use method |
|
Deprecated at version 3.0.0, use method |
Special¶
Methods
Called by the |
|
Called by the |
|
Called by the |
Docstring substitutions¶
Methods
Return the special docstring substitutions. |
|
Returns the substitutions that apply to methods of the class. |
|
Returns the class {{package}} substitutions package depth. |
|
Returns method names excluded in the class substitutions. |