cf.Field.dimension_to_auxiliary¶
-
Field.
dimension_to_auxiliary
(*args, **kwargs)[source]¶ Move dimension coordinates to an auxiliary coordinate construct.
A new auxiliary coordinate construct is derived from the selected dimension coordinate construct, and the dimension coordinate construct is removed.
New in version 3.14.1.
See also
- Parameters
- identity, filter_kwargs: optional
Select the unique dimension coordinate construct returned by
f.dimension_coordinate(*identity, **filter_kwargs)
. Seedimension_coordinate
for details.
- Returns
Examples
>>> f = cf.example_field(0) >>> print(f) Field: specific_humidity (ncvar%q) ---------------------------------- Data : specific_humidity(latitude(5), longitude(8)) 1 Cell methods : area: mean Dimension coords: latitude(5) = [-75.0, ..., 75.0] degrees_north : longitude(8) = [22.5, ..., 337.5] degrees_east : time(1) = [2019-01-01 00:00:00] >>> g = f.dimension_to_auxiliary('latitude') >>> print(g) Field: specific_humidity (ncvar%q) ---------------------------------- Data : specific_humidity(latitude(5), longitude(8)) 1 Cell methods : area: mean Dimension coords: longitude(8) = [22.5, ..., 337.5] degrees_east : time(1) = [2019-01-01 00:00:00] Auxiliary coords: latitude(latitude(5)) = [-75.0, ..., 75.0] degrees_north >>> h = g.auxiliary_to_dimension('latitude') >>> print(h) Field: specific_humidity (ncvar%q) ---------------------------------- Data : specific_humidity(latitude(5), longitude(8)) 1 Cell methods : area: mean Dimension coords: latitude(5) = [-75.0, ..., 75.0] degrees_north : longitude(8) = [22.5, ..., 337.5] degrees_east : time(1) = [2019-01-01 00:00:00] >>> h.equals(f) True