get_dependent_array_axes

ndcube.utils.wcs.get_dependent_array_axes(array_axis, axis_correlation_matrix)[source]

Find indices of all array axes associated with the world axes linked to the input array axis.

For example, say the input array axis is 0 and it is associated with two world axes corresponding to longitude and latitude. Let’s also say that array axis 1 is also associated with longitude and latitude. Thus, this function would return array axes 0 and 1. Note the the output axes include the input axis. On the other hand let’s say array axis 2 is associated with only one world axis, e.g. wavelength, which does not depend on any other array axis (i.e. it is independent). In that case this function would only return array axis 2. Both input and output array axis indices are in the numpy array ordering convention (reverse of WCS ordering convention). The returned axis indices include the input axis.

Parameters:
  • array_axis (int) – Index of array axis (in numpy ordering convention) for which dependent axes are desired.

  • axis_correlation_matrix (numpy.ndarray of bool) – 2D boolean correlation matrix defining the dependence between the pixel and world axes. Format same as astropy.wcs.BaseLowLevelWCS.axis_correlation_matrix.

Returns:

dependent_array_axes – Sorted indices of array axes dependent on input axis in numpy ordering convention.

Return type:

np.ndarray of int