cf.Field.weights

Field.weights(weights=None, scale=False, squeeze=False, components=False)[source]
Parameters :
weights : optional

Specify how the weights are to be created. Must one, or a sequence, of:

Value

Description

'equal'

Equal weights.

'area'

Cell area weights from the field’s area cell measure construct or, if one doesn’t exist, from latidude and longitude dimension coordinates.

'volume'

Cell volume weights from the field’s volume cell measure construct.

item

Linear weights from the dimension coordinate object that would be selected by this call of the field’s dim method: f.dim(item). See cf.Field.dim for details.

cf.Field

Take weights from the data array of another field, which must be broadcastable to this field.

By default equal weights are returned.

If weights is a sequence of any combination of the above then the returned field contains the outerproduct of the weights defined by each element of the sequence. The ordering of the sequence is irrelevant.

Example: To create to two dimensional weights based on cell

areas: f.weights('area'). To create to three dimensional weights based on cell areas and linear height: f.weights(['area', 'Z']).

components : bool, optional

See also

cell_area, collapse

Examples

Previous topic

cf.Field.unsqueeze

Next topic

cf.Field.__deepcopy__

This Page