Bases: cf.utils.CfDict
A CF transform construct.
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 CF-netCDF ‘formula_terms’ or ‘grid_mapping’ property. DCH DCH DCH
In the ‘formula_terms’ case, a mapping to a coordinate (as opposed to another field) uses the coordinate’s space key name as a pointer rather than a copy of the coordinate itself.
Examples
>>> t
<CF Transform: atmosphere_sigma_coordinate>
>>> print t.dump()
atmosphere_sigma_coordinate transform
-------------------------------------
Transform['ps'] = <CF Field: surface_air_pressure(73, 96)>
Transform['ptop'] = 0.05
Transform['sigma'] = 'dim0'
>>> t
<CF Transform: rotated_latitude_longitude>
>>> print t.dump()
rotated_latitude_longitude transform
------------------------------------
Transform['grid_north_pole_latitude'] = 33.67
Transform['grid_north_pole_longitude'] = 190.0
Initialization
Parameters : |
|
---|
Transform attributes
isformula_terms | True if the transform is a formula_terms. |
isgrid_mapping | True if the transform is a grid_mapping. |
name | The identifying name of the transformation. |
Transform methods (undocumented methods behave exactly as their counterparts in a built-in dictionary)
clear | |
copy | Return a deep copy. |
dump | Return a string containing a full description of the transform. |
equals | True if two instances are equal, False otherwise. |
get | |
get_keys | Return a list of the key names which match a regular expression. |
has_key | Return true if and only if the dictionary contains the given key. |
items | |
iteritems | |
iterkeys | |
itervalues | |
keys | |
pop | |
popitem | |
setdefault | |
update | |
values |
Return a deep copy.
Equivalent to copy.deepcopy(d).
Returns : |
|
---|
Examples
>>> d.copy()
Return a string containing a full description of the transform.
Parameters : |
|
---|---|
Returns : |
|
Examples
>>> x = t.dump()
>>> print t.dump()
>>> print t.dump(id='transform1')
True if two instances are equal, False otherwise.
Parameters : |
|
---|---|
Returns : |
|
Examples
Return a list of the key names which match a regular expression.
Parameters : |
|
---|---|
Returns : |
|
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[1-9]')
['dim2', 'dim1']
Return true if and only if the dictionary contains the given key.
Parameters : |
|
---|---|
Returns : | out : bool |
Examples
>>> d.keys()
['key1', 3, ('a', 1)]
>>> d.has_key(3)
True
>>> d.has_key('key9')
False
True if the transform is a formula_terms.
Examples
>>> t
<CF Transform: atmosphere_sigma_coordinate>
>>> t.isformula_terms
True
>>> t
<CF Transform: rotated_latitude_longitude>
>>> t.isformula_terms
False
True if the transform is a grid_mapping.
Examples
>>> t
<CF Transform: rotated_latitude_longitude>
>>> t.isgrid_mapping
True
<CF Transform: atmosphere_sigma_coordinate>
>>> t.isgrid_mapping
True
The identifying name of the transformation.
Examples
>>> t.name
'atmosphere_hybrid_sigma_pressure_coordinate'
>>> t.name = 'rotated_latitude_longitude'