GlobalCoords

class ndcube.GlobalCoords(ndcube=None)[source]

Bases: collections.abc.Mapping

A structured representation of coordinate information applicable to a whole NDCube.

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.

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

A mapping of names to physical types for each coordinate.

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 (http://www.ivoa.net/documents/latest/UCDlist.html). 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 (object) – The object describing the coordinate value, for example a Quantity or a SkyCoord.

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

A new object storing just the coordinates with the given physical type.

Return type

GlobalCoords

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
remove(name)[source]

Remove a coordinate from the collection.

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