GlobalCoords¶
- class ndcube.GlobalCoords(ndcube=None)[source]¶
Bases:
GlobalCoordsABC
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.
filter_by_physical_type
(physical_type)Filter this object to coordinates with a given physical type.
get
(k[,d])items
()keys
()remove
(name)Remove a coordinate from the collection.
values
()Attributes Documentation
- physical_types¶
Methods Documentation
- add(name, physical_type, coord)[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
.
- filter_by_physical_type(physical_type)[source]¶
Filter this object to coordinates with a given physical type.
- Parameters:
physical_type (
str
) – The physical type to filter by.- Returns:
GlobalCoords
– A new object storing just the coordinates with the given physical type.
- 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 ¶