hyperspy.misc.slicing module

hyperspy.misc.slicing._slice_target(target, dims, both_slices, slice_nav=None, issignal=False)

Slices the target if appropriate

Parameters
  • target (object) – Target object

  • dims (tuple) – (navigation_dimensions, signal_dimensions) of the original object that is sliced

  • both_slices (tuple) – (original_slices, array_slices) of the operation that is performed

  • slice_nav ({bool, None}) – if None, target is returned as-is. Otherwise navigation and signal dimensions are sliced for True and False values respectively.

  • issignal (bool) – if the target is signal and should be sliced as one

hyperspy.misc.slicing.copy_slice_from_whitelist(_from, _to, dims, both_slices, isNav, order=None)

Copies things from one object to another, according to whitelist, slicing where required.

Parameters
  • _from (object) – Original object

  • _to (object) – Target object

  • dims (tuple) – (navigation_dimensions, signal_dimensions) of the original object that is sliced

  • both_slices (tuple) – (original_slices, array_slices) of the operation that is performed

  • isNav (bool) – if the slicing operation is performed on navigation dimensions of the object

  • order (tuple, None) – if given, performs the copying in the order given. If not all attributes given, the rest is random (the order a whitelist.keys() returns them). If given in the object, _slicing_order is looked up.