fields.mixins.components.FieldComponentCoreMixin.reduce_axes#
- FieldComponentCoreMixin.reduce_axes(axes: AxesInput, indices: Sequence[int], *args, buffer_class: Type[BufferBase] | None = None, buffer_registry: BufferRegistry | None = None, out: _SupFCCore | BufferBase | None = None, check_units: bool = False, **kwargs) _SupFCCore [source]#
Reduce a component to a smaller set of axes by slicing.
- Parameters:
axes (
list
ofstr
) – Axes to index remove from this component. These must be active axes in the existing component.indices (
list
ofint
) – Indices to use for each axis to remove. This should be the same length as axes.buffer_class (
type
, optional) – Optional override for the new buffer class.buffer_registry (
BufferRegistry
, optional) – Registry to resolve string-based buffer classes.out (
FieldComponent
orBufferBase
, optional) – Optional destination for the result. Can be a FieldComponent or buffer.check_units (
bool
, defaultFalse
) – If True, check that out matches this component’s units.*args – Forwarded to buffer constructor if a new buffer is created.
**kwargs – Forwarded to buffer constructor if a new buffer is created.
- Returns:
A new component with reduced dimensionality.
- Return type:
FieldComponent