Skip to main content
`Ctrl`+`K`

# GlobalCoordsABC

class ndcube.GlobalCoordsABC

  Bases: `Mapping`

  A structured representation of coordinate information applicable to a whole `NDCubeABC`.

  This class acts as a mapping between coordinate name and the coordinate object. In addition to this a physical type is stored for each coordinate name. A concrete implementation of this class must fulfill the `Mapping` ABC, including methods such as `__iter__` and `__len__`.

  Parameters:

    ndcube (`NDCube`, optional) – The parent ndcube for this object. Used to extract global coordinates from the wcs and extra coords of the ndcube. If not specified only coordinates explicitly added will be shown.

  Attributes Summary

  `physical_types` | A mapping of names to physical types for each coordinate.

  Methods Summary

  `add`(name, physical_type, coord) | Add a new coordinate to the collection.
  `get`(k[,d]) |
  `items`() |
  `keys`() |
  `remove`(name) | Remove a coordinate from the collection.
  `values`() |

  Attributes Documentation

  physical_types

    A mapping of names to physical types for each coordinate.

  Methods Documentation

  abstractmethod add(name: str, physical_type: str, coord: Any)

    Add a new coordinate to the collection.

    Parameters:

      - name (`str`) – The name for the coordinate.

      - physical_type (`str`) – An IOVA UCD1+ physical type description for the coordinate. If no matching UCD type exists, this can instead be `"custom:xxx"`, where `xxx` is an arbitrary string. If not known, can be `None`.

      - coord – The object describing the coordinate value, for example a `Quantity` or a `SkyCoord`.

  get(k[, d]) → D[k] if k in D, else d. d defaults to None.
  items() → a set-like object providing a view on D's items
  keys() → a set-like object providing a view on D's keys
  abstractmethod remove(name: str)

    Remove a coordinate from the collection.

  values() → an object providing a view on D's values