utils (ndcube.utils)#

ndcube.utils.collection Module#

Functions#

assert_aligned_axes_compatible(...)

Checks whether two sets of aligned axes are compatible.

ndcube.utils.cube Module#

Functions#

sanitize_wcs(func)

A wrapper for NDCube methods to sanitise the wcs argument.

sanitize_crop_inputs(points, wcs)

Sanitize inputs to NDCube crop methods.

get_crop_item_from_points(points, wcs, ...)

Find slice item that crops to minimum cube in array-space containing specified world points.

propagate_rebin_uncertainties(uncertainty, ...)

Default algorithm for uncertainty propagation in rebin().

ndcube.utils.misc Module#

Functions#

unique_sorted(iterable)

Return unique values in the order they are first encountered in the iterable.

convert_quantities_to_units(coords, units)

Converts a sequence of Quantities to units used in the WCS.

ndcube.utils.sequence Module#

Utilities for ndcube sequence.

Functions#

cube_like_index_to_sequence_and_common_axis_indices(...)

Converts a cube-like index for an NDCubeSequence to a sequence index and a common axis index.

cube_like_tuple_item_to_sequence_items(item, ...)

Convert a tuple for slicing an NDCubeSequence in the cube-like API to a list of SequenceItems.

Classes#

SequenceItem(sequence_index, cube_item)

Define SequenceItem named tuple of length 2.

Class Inheritance Diagram#

Inheritance diagram of ndcube.utils.sequence.SequenceItem

ndcube.utils.wcs_high_level_conversion Module#

This module provides helpers introduced in astropy/astropy#11950.

Functions#

values_to_high_level_objects(*world_values, ...)

high_level_objects_to_values(*world_objects, ...)

ndcube.utils.wcs Module#

Miscellaneous WCS utilities.

Functions#

array_indices_for_world_objects(wcs[, axes])

Calculate the array indices corresponding to each high level world object.

convert_between_array_and_pixel_axes(axis, naxes)

Reflects axis index about center of number of axes.

calculate_world_indices_from_axes(wcs, axes)

Given a string representation of a world axis or a numerical array index, convert it to a numerical world index aligning to the position in wcs.world_axis_object_components.

pixel_axis_to_world_axes(pixel_axis, ...)

Retrieves the indices of the world axis physical types corresponding to a pixel axis.

world_axis_to_pixel_axes(world_axis, ...)

Gets the pixel axis indices corresponding to the index of a world axis.

pixel_axis_to_physical_types(pixel_axis, wcs)

Gets the world axis physical types corresponding to a pixel axis.

physical_type_to_pixel_axes(physical_type, wcs)

Gets the pixel axis indices corresponding to a world axis physical type.

physical_type_to_world_axis(physical_type, ...)

Returns world axis index of a physical type based on WCS world_axis_physical_types.

get_dependent_pixel_axes(pixel_axis, ...)

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

get_dependent_array_axes(array_axis, ...)

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

get_dependent_world_axes(world_axis, ...)

Given a WCS world axis index, return indices of dependent WCS world axes.

get_dependent_physical_types(physical_type, wcs)

Given a world axis physical type, return the dependent physical types including the input type.

array_indices_for_world_objects(wcs[, axes])

Calculate the array indices corresponding to each high level world object.

validate_physical_types(physical_types)

Validate a list of physical types against the UCD1+ standard