GlobalCoordsABC#
- class ndcube.GlobalCoordsABC[source]#
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
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)[source]#
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"
, wherexxx
is an arbitrary string. If not known, can beNone
.coord – The object describing the coordinate value, for example a
Quantity
or aSkyCoord
.
- 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 #
- values() an object providing a view on D's values #