spectrochempy.NDDataset.get_axis

NDDataset.get_axis(*args, **kwargs)[source]

Helper function to determine an axis index whatever the syntax used (axis index or dimension names).

Parameters
  • dim, axis, dims (str, int, or list of str or index) – The axis indexes or dimensions names - they can be specified as argument or using keyword ‘axis’, ‘dim’ or ‘dims’.

  • negative_axis (bool, optional, default=False) – If True a negative index is returned for the axis value (-1 for the last dimension, etc…).

  • allows_none (bool, optional, default=False) – If True, if input is none then None is returned.

  • only_first (bool, optional, default: True) – By default return only information on the first axis if dim is a list. Else, return a list for axis and dims information.

Returns

  • axis (int) – The axis indexes.

  • dim (str) – The axis name.