convert_between_array_and_pixel_axes#

ndcube.utils.wcs.convert_between_array_and_pixel_axes(axis, naxes)[source]#

Reflects axis index about center of number of axes.

This is used to convert between array axes in numpy order and pixel axes in WCS order. Works in both directions.

Parameters:
  • axis (numpy.ndarray of int) – The axis number(s) before reflection.

  • naxes (int) – The number of array axes.

Returns:

reflected_axis (numpy.ndarray of int) – The axis number(s) after reflection.