Bases: object
Completely describe a field’s coordinate system (domain).
It contains the domain axis constructs, dimension coordinate constructs, auxiliary coordinate constructs, cell measure constructs and coordinate reference constructs defined by the CF data model.
Initialization
Parameters: |
|
---|---|
Examples: |
In this example, four dots (....) refers to appropriate initialization parameters of the coordinate, cell measure and coordinate reference constructs, which are omitted here for clarity.
>>> dim_coord_A = cf.DimensionCoordinate(....)
>>> dim_coord_B = cf.DimensionCoordinate(....)
>>> dim_coord_A.size, dim_coord_B.size
(73, 96)
>>> dim_coord_A.X, dim_coord_B.Y
(True, True)
>>> aux_coord_A = cf.AuxiliaryCoordinate(....)
>>> aux_coord_A.shape
(96, 73)
>>> cell_measure_A = cf.CellMeasure(....)
>>> cell_measure_A.shape
(73, 96)
>>> ref_A = cf.CoordinateReference(name='latitude_longitude', ....)
>>> d = cf.Domain(dim=[dim_coord_A, dim_coord_B],
... aux=aux_coord_A,
... measure=cell_measure_A,
... ref=ref_A)
...
>>> d.items_axes()
{'aux0': ['dim1', 'dim0'],
'msr0': ['dim0', 'dim1'],
'dim1': ['dim1'],
'dim0': ['dim0']}
>>> d.refs
{'ref0' : <CF CoordinateReference: latitude_longitude>}
It was not necessary to specify the axis mappings for aux_coord_A and cell_measure_A because the two axes have unambiguous sizes.
The same domain could have been initialised using the dictionary form of the parameters and explicitly assigning axes described by their dimension coordinate metadata:
>>> e = cf.Domain(axes={'dim0': 73, 'dim1': 96},
... dim={'dim0': dim_coord_A, 'dim1': dim_coord_B},
... aux={'aux0': aux_coord_A},
... measure={'msr0': cell_measureA},
... ref={'ref0': ref_A},
... assign_axes={'aux0': ['Y', 'X'],
... 'msr0': ['X', 'Y']})
...
>>> e.equals(d)
True
analyse | Analyse a domain. |
axes | Return domain axis identifiers. |
axis | Return a domain axis identifier. |
axis_name | Return the canonical name for an axis. |
close | Close all referenced open data files. |
copy | Return a deep copy. |
ref_axes | Return the axes spanned by the coordinate object inputs of a coordinate reference. |
data_axes | Return the axes of the field’s data array. |
direction | Return True if an axis is increasing, otherwise return False. |
directions | Return a dictionary mapping axes to their directions. |
dump | Return a string containing a full description of the domain. |
dump_axes | Return a string containing a description of the domain. |
dump_components | Return a string containing a full description of the domain. |
equals | True if two domains are equal, False otherwise. |
equivalent | True if and only if two domains are logically equivalent. |
equivalent_refs | True if a coordinate refencence object is the same as one in another domain. |
expand_dims | Expand the domain with a new dimension in place. |
get | Return the item corresponding to an internal identifier. |
has | True if the domain has the given internal identifier. |
insert_aux | Insert a auxiliary coordinate into the domain in place. |
insert_axis | Insert an axis into the domain in place. |
insert_coord | Insert a dimension coordinate or auxiliary coordinate into the domain in place. |
insert_dim | Insert a dimension coordinate to the domain in place. |
insert_measure | Insert a cell measure into the domain in place. |
insert_ref | Insert a coordinate reference object into the domain in place. |
item | Return an item of the domain, or its domain identifier. |
item_axes | Return the axes of a domain item. |
items | Return items of the domain. |
map_axes | Map the axis identifiers of the domain to their equivalent axis identifiers of another. |
new_aux_identifier | Return a new, unique auxiliary coordinate identifier for the domain. |
new_axis_identifier | Return a new, unique axis identifier for the domain. |
new_measure_identifier | Return a new, unique cell measure identifier for the domain. |
new_ref_identifier | Return a new, unique coordinate reference identifier for the domain. |
remove_axes | Remove and return axes from the domain. |
remove_axis | Remove and return an axis from the domain. |
remove_item | Remove and return an item from the domain. |
remove_items | Remove and return items from the domain. |