cf.aggregate

cf.aggregate(fields, messages=False, strict_units=True, overlap=True, contiguous=False, _delete_meta=True, strict_identity=True)

Aggregate fields into as few fields as possible.

The aggregation of fields may be thought of as the combination fields into each other to create a new field that occupies a larger space.

Using the CF aggregation rules, input fields are separated into aggregatable groups and each group (which may contain just one field) is then aggregated to a single field. These aggregated fields are returned in a field list.

Parameters :
fields : (sequence of) Field or FieldList

The field or fields to aggregated.

messages : bool, optional

If True then print messages giving reasons why a field has not been aggregated.

overlap : bool, optional

If False then two fields will not be aggregated if their two adjacent dimension coordinate cells overlap each other. By default aggregation may occur in this case. See the contiguous parameter.

contiguous : bool, optional

If True then a necessary condition for the aggregation of two fields is that their two adjacent dimension coordinate cells partially overlap or share a common boundary value. By default aggregation may occur if this is not the case. See the overlap parameter.

strict_units : bool, optional

If False then assume that fields or their components (such as coordinates) with the same identity but missing units all have equivalent (but unspecified) units, so that aggregation may occur. By default such fields are not aggregatable.

strict_identity : bool, optional

If False then treat fields with data arrays but no identities as having equal identities, and so are potentially aggregatable. By default fields with data arrays but no identities are not aggregatable.

Returns :
out : FieldList

The aggregated fields.

Examples

The following six fields comprise eastward wind at two different times and for three different atmospheric heights for each time:

>>> f
[<CF Field: eastward_wind(latitude(73), longitude(96)>,
 <CF Field: eastward_wind(latitude(73), longitude(96)>,
 <CF Field: eastward_wind(latitude(73), longitude(96)>,
 <CF Field: eastward_wind(latitude(73), longitude(96)>,
 <CF Field: eastward_wind(latitude(73), longitude(96)>,
 <CF Field: eastward_wind(latitude(73), longitude(96)>]
>>> cf.aggregate(f)
[<CF Field: eastward_wind(height(3), time(2), latitude(73), longitude(96)>]

Previous topic

cf.write

Next topic

cf.collapse

This Page