ExtraCoordsABC#

class ndcube.ExtraCoordsABC[source]#

Bases: ABC

A representation of additional world coordinates associated with pixel axes.

ExtraCoords can be initialised by either specifying a BaseLowLevelWCS object and a mapping, or it can be built up by specifying one or more lookup tables.

Parameters:
  • wcs – The WCS specifying the extra coordinates.

  • mapping – The mapping between the array dimensions and pixel dimensions in the extra coords object. This is an iterable of (array_dimension, pixel_dimension) pairs of length equal to the number of pixel dimensions in the extra coords.

Attributes Summary

is_empty

Return True if no extra coords present, else return False.

mapping

The mapping between the array dimensions and pixel dimensions.

wcs

A WCS object representing the world coordinates described by this ExtraCoords.

Methods Summary

add(name, array_dimension, lookup_table[, ...])

Add a coordinate to this ExtraCoords based on a lookup table.

keys()

The world axis names for all the coordinates in the extra coords.

Attributes Documentation

is_empty#

Return True if no extra coords present, else return False.

mapping#

The mapping between the array dimensions and pixel dimensions.

This is an iterable of (array_dimension, pixel_dimension) pairs of length equal to the number of pixel dimensions in the extra coords.

wcs#

A WCS object representing the world coordinates described by this ExtraCoords.

Note

This WCS object does not map to the pixel dimensions of the data array in the NDCube object. It only includes pixel dimensions associated with the extra coordinates. For example, if there is only one extra coordinate associated with a single pixel dimension, this WCS will only have 1 pixel dimension, even if the NDCube object has a data array of 2-D or greater. Therefore using this WCS directly might lead to some confusing results.

Methods Documentation

abstract add(name: str | Iterable[str], array_dimension: int | Iterable[int], lookup_table: Any, physical_types: str | Iterable[str] = None, **kwargs)[source]#

Add a coordinate to this ExtraCoords based on a lookup table.

Parameters:
  • name (str or sequence of str) – The name(s) for these world coordinate(s).

  • array_dimension (int or tuple of int) – The array dimension(s), to which this lookup table corresponds.

  • lookup_table (object or sequence of object) – The lookup table. A BaseTableCoordinate subclass or anything that can instantiate one, i.e. currently a Time, SkyCoord, or a (sequence of) Quantity.

  • physical_types (str or iterable of str, optional) – Descriptor(s) of the <dimensions and physical types associated with each axis; length must match the number of dimensions in lookup_table.

abstract keys() Iterable[str][source]#

The world axis names for all the coordinates in the extra coords.