Bases: cf.utils.CfDict
A CF transform object defining a coordinate’s transformation in a dictionary-like object.
The named parameters and their values of the transformation (i.e. the transformation’s mappings) comprise the object’s key-value pairs.
A transformation is equivalent to either a netCDF(CF) ‘formula_terms’ or ‘grid_mapping’ property. The latter is identified by the presence of the ‘grid_mapping_name’ key which contains the mapping’s name.
In the ‘formula_terms’ case, a mapping to a coordinate (as opposed to another space) uses the coordinate’s grid key name as a pointer rather than a copy of the coordinate itself.
Refer to the Grid Structure section of the cf module for details.
Parameters: |
|
---|
Overloaded operators:
The in (set membership) operator is overloaded to use numerically tolerant equality.
Special attributes:
Attribute | Description |
---|---|
name | The identifying name of the transformation. Typically a netCDF(CF) ‘formula_terms’ or ‘grid_mapping_name’. |
Examples:
>>> t
<CF Transform: atmosphere_sigma_coordinate>
>>> dump(t)
atmosphere_sigma_coordinate transform
-------------------------------------
Transform['ps'] = <CF Space: surface_air_pressure(73, 96)>
Transform['ptop'] = 0.05
Transform['sigma'] = 'dim0'
>>> t
<CF Transform: rotated_latitude_longitude>
>>> dump(t)
rotated_latitude_longitude transform
------------------------------------
Transform['grid_mapping_name'] = 'rotated_latitude_longitude'
Transform['grid_north_pole_latitude'] = 33.67
Transform['grid_north_pole_longitude'] = 190.0
Methods and attributes defined here:
CFD.copy() -> a deep copy of CFD
Return a string containing a full description of the transformation.
Parameters: |
|
---|---|
Returns: | A string containing the description of the object. |
See also
Return True if two instances are congruent in that they have
- Equal sets of keys.
- For each key, the two values are equal.
- Both instances have equal attributes.
Equality of numbers is to within a tolerance. Refer to cf for details.
Parameters: |
|
---|---|
Returns: | True if the two objects are congruent, False otherwise. |
Return a list of the cf dictionary’s key names which match the given regular expression.
Parameters: | regex (str) – Optional. The regular expression with which to identify key names. |
---|---|
Returns: | A list of keys names. |
Examples:
>>> d.keys()
['dim2', 'dim0', 'dim1', 'aux0', 'cm0']
>>> d.get_keys()
['dim2', 'dim0', 'dim1', 'aux0', 'cm0']
>>> d.get_keys('dim')
['dim2', 'dim0', 'dim1']
>>> d.get_keys('^aux|^dim')
['dim2', 'dim0', 'dim1', 'aux0']
>>> d.get_keys('dim[123]')
['dim2', 'dim1']
CFD.has_key(k) -> True if CFD has a key k, else False