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

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

abstract add(name: str, physical_type: str, coord: Any)[source]#

Add a new coordinate to the collection.

Parameters:
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#
abstract remove(name: str)[source]#

Remove a coordinate from the collection.

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