cf.Domain.dimensions

Domain.dimensions

A dictionary mapping the domain’s components (including the field’s data array) to their dimensions.

Keys are dimension coordinate identifiers ('dimN'), auxiliary coordinate identifiers ('auxN') and cell measure construct identifiers ('cmN'), and values are lists of dimension identifiers ('dimN'), stating the dimensions, in order, of the construct concerned. The dimension identifiers must all exist as keys to the dimension_sizes dictionary.

The special key 'data' stores the ordered list of dimension identifiers ('dimN') relating to a containing field’s data array.

The N part of each key identifier should be replaced by an arbitrary integer greater then or equal to zero, the only restriction being that the resulting identifier is not already in use. No meaning should be inferred from the integer part of the identifiers, which need not include zero nor be consecutive (although these will commonly be the case).

Examples

In this example, the domain has:

  • Four dimensions ('dim0', 'dim1', 'dim2' and 'dim7')
  • Three dimension coordinates (dimension 'dim7' has no dimension coordinate)
  • Three auxiliary coordinates ('aux0', 'aux1' and 'aux3'), two of which span dimensions 'dim1' and 'dim2' (but in different orders) and one is one dimensional.
  • One cell measure variable spanning two dimensions
  • The identifiers of the field’s data array dimensions.
>>> d.dimension_sizes
{'dim0': 12, 'dim1': 73, 'dim2': 96, 'dim7': 1}
>>> d.dimensions
{'aux0': ['dim1', 'dim2'],
 'aux1': ['dim2', 'dim1'],
 'aux3': ['dim0'],
 'cm0' : ['dim1', 'dim2'],
 'data': ['dim0', 'dim1', 'dim2'],
 'dim0': ['dim0'],
 'dim1': ['dim1'],
 'dim2': ['dim2']}

Previous topic

cf.Domain.dimension_sizes

Next topic

cf.Domain.transforms

This Page