ExtraCoords¶
- class ndcube.ExtraCoords(ndcube=None)[source]¶
Bases:
ExtraCoordsABCA representation of additional world coordinates associated with pixel axes.
ExtraCoords can be initialised by either specifying a
LowLevelWCSobject and amapping, or it can be built up by specifying one or more lookup tables.- Parameters:
wcs – The WCS specifying the extra coordinates.
mapping – The mapping between the array dimensions and pixel dimensions in the extra coords object. This is an iterable of
(array_dimension, pixel_dimension)pairs of length equal to the number of pixel dimensions in the extra coords.
Attributes Summary
Produce a WCS that describes the associated NDCube with just the extra coords.
Return an APE-14 like representation of any sliced out world dimensions.
The mapping between the array dimensions and pixel dimensions.
A WCS object representing the world coordinates described by this
ExtraCoords.Methods Summary
add(name, array_dimension, lookup_table[, ...])Add a coordinate to this
ExtraCoordsbased on a lookup table.from_lookup_tables(names, pixel_dimensions, ...)Construct a new ExtraCoords instance from lookup tables.
keys()The world axis names for all the coordinates in the extra coords.
Attributes Documentation
- cube_wcs¶
Produce a WCS that describes the associated NDCube with just the extra coords.
For NDCube pixel axes without any extra coord, dummy axes are inserted.
- dropped_world_dimensions¶
Return an APE-14 like representation of any sliced out world dimensions.
- mapping¶
- wcs¶
Methods Documentation
- add(name, array_dimension, lookup_table, physical_types=None, **kwargs)[source]¶
Add a coordinate to this
ExtraCoordsbased on a lookup table.- Parameters:
name (
stror sequence ofstr) – The name(s) for these world coordinate(s).array_dimension (
intortupleofint) – The pixel dimension(s), in the array, to which this lookup table corresponds.lookup_table (
objector sequence ofobject) – The lookup table. ABaseTableCoordinatesubclass or anything that can instantiate one, i.e. currently aTime,SkyCoord, or a (sequence of)Quantity.physical_types (
stror iterable ofstr, optional) – Descriptor(s) of the physical type associated with each axis; length must match the number of dimensions inlookup_table.
- classmethod from_lookup_tables(names, pixel_dimensions, lookup_tables, physical_types=None)[source]¶
Construct a new ExtraCoords instance from lookup tables.
This is a convience wrapper around
addwhich does not expose all the options available in that method.- Parameters:
pixel_dimensions (
tupleofint) – The pixel dimensions (in the array) to which thelookup_tablesapply. Must be the same length aslookup_tables.lookup_tables (iterable of
object) – The lookup tables which specify the world coordinates for thepixel_dimensions. Must beBaseTableCoordinatesubclass instances or objects from which to instantiate them (seeExtraCoords.add).physical_types (sequence of
stror of sequences ofstr, optional) – Descriptors of the physical types associated with each axis in the tables. Must be the same length aslookup_tables; and length of each element must match the number of dimensions in correspondinglookup_tables[i].
- Return type:
ndcube.extra_coords.ExtraCoords
