copy_datasets_filter#

caput.containers.copy_datasets_filter(source: caput.containers._core.ContainerPrototype, dest: caput.containers._core.ContainerPrototype, axis: str | collections.abc.Iterable[str] = [], selection: caput.mpiarray.SelectionLike = {}, exclude_axes: tuple[str] | list[str] | None = None, copy_without_selection: bool = False) None[source]#

Copy datasets while filtering a given axis.

By default, only datasets containing the axis to be filtered will be copied.

Parameters:
sourceContainerPrototype

Source container

destContainerPrototype

Destination container. The axes in this container should reflect the selections being made to the source.

axisstr | tuple[str] | list[str]

Name of the axes to filter. These must match the axes in selection, unless selection is a single item. This is partially here for legacy reasons, as the selections can be fully specified by selection

selectiondict, optional

A filtering selection to be applied to each axis.

exclude_axeslist[str] | tuple[str], optional

An optional set of axes that if a dataset contains one means it will not be copied.

copy_without_selectionbool, optional

If set to True, then datasets that do not have an axis appearing in selection will still be copied over in full. Default is False.