ndcube.utils.wcs.get_dependent_pixel_axes(pixel_axis, axis_correlation_matrix)[source]

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

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

  • wcs_axis (int) – Index of axis (in WCS 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.


dependent_pixel_axes – Sorted indices of pixel axes dependent on input axis in WCS ordering convention.

Return type:

np.ndarray of int