cfdm.AggregatedArray.subarray_shapes

AggregatedArray.subarray_shapes(shapes)[source]

Create the subarray shapes.

A fragmented dimension (i.e. one spanned by two or fragments) will always have a subarray size equal to the size of each of its fragments, overriding any other size implied by the shapes parameter.

Added in version (cfdm): 1.12.0.0

See also

subarrays

Parameters:
shapes: int, sequence, dict or str, optional

Define the subarray shapes.

Any value accepted by the chunks parameter of the dask.array.from_array function is allowed.

The subarray sizes implied by chunks for a dimension that has been fragmented are ignored, so their specification is arbitrary.

Returns:
tuple

The subarray sizes along each dimension.

Examples

>>> a.shape
(12, 1, 73, 144)
>>> a.get_fragment_array_shape()
(2, 1, 1, 1)
>>> a.fragmented_dimensions()
[0]
>>> a.subarray_shapes(-1)
((6, 6), (1,), (73,), (144,))
>>> a.subarray_shapes(None)
((6, 6), (1,), (73,), (144,))
>>> a.subarray_shapes("auto")
((6, 6), (1,), (73,), (144,))
>>> a.subarray_shapes((None, 1, 40, 50))
((6, 6), (1,), (40, 33), (50, 50, 44))
>>>  a.subarray_shapes((None, None, "auto", 50))
((6, 6), (1,), (73,), (50, 50, 44))
>>>  a.subarray_shapes({2: 40})
((6, 6), (1,), (40, 33), (144,))