ndcube.utils.sequence.cube_like_tuple_item_to_sequence_items(item, common_axis, common_axis_lengths, n_cube_dims)[source]#

Convert a tuple for slicing an NDCubeSequence in the cube-like API to a list of SequenceItems.

This requires the common_axis item to be a slice item. If it is an int, this function should not be used.

  • item (iterable of int or slice) – The slicing item. The common axis entry must be a slice

  • common_axis (int) – The index of the item corresponding to the common axis.

  • common_axis_lengths (iterable of int) – The lengths of each cube in the sequence along the common axis.

  • n_cube_dims (int) – The number of dimensions in the cubes in the sequence.


sequence_items (list of SequenceItem) – The sequence index and slicing item for each cube in the sequence to be included in the NDCubeSequence that would result by applying the input slicing item via the cube-like API.