cf.Transform

class cf.Transform(*args, **kwargs)[source]

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 domain 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 :
args, kwargs :

Keys and values are initialized exactly as for a built-in dict. Keys are transform parameter names (such as ‘grid_north_pole_latitude’ or ‘sigma’) with appropriate values. Some key/value pairs are treated as special cases:

  • If the key ‘standard_name’ is specified then it is assumed to be the standard name of a dimensionless vertical coordinate, and the transform represents a CF-netCDF formula_terms attribute. A ‘standard_name’ key is not created, but its value is assigned to the name attribute.
  • If the key ‘grid_mapping_name’ is specified then is assumed that the transform represents a CF-netCDF grid mapping of the same name. A ‘grid_mapping_name’ key is created and its value is also assigned to the name attribute.

Examples

>>> t = Transform(grid_north_pole_latitude=38.0, 
...               grid_north_pole_longitude=190.0,
...               grid_mapping_name='rotated_latitude_longitude')
>>> t = Transform(p0=cf.Data(1000, 'hPa'), lev='dim1', 
...               standard_name='atmosphere_ln_pressure_coordinate')

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

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

Table Of Contents

Previous topic

cf.Flags.sort

Next topic

cf.Transform.isformula_terms

This Page