ExtraCoords¶
-
class
ndcube.
ExtraCoords
(ndcube=None)[source]¶ Bases:
ndcube.extra_coords.extra_coords.ExtraCoordsABC
A representation of additional world coordinates associated with pixel axes.
ExtraCoords can be initialised by either specifying a
LowLevelWCS
object 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
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
ExtraCoords
based on a lookup table.from_lookup_tables
(names, pixel_dimensions, …)Construct an ExtraCoords instance from lookup tables.
keys
()The world axis names for all the coordinates in the extra coords.
Attributes Documentation
-
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, **kwargs)[source]¶ Add a coordinate to this
ExtraCoords
based on a lookup table.- Parameters
name – The name for these world coordinate(s).
array_dimension – The pixel dimension(s), in the array, to which this lookup table corresponds.
lookup_table – The lookup table. Note, if this table is multi-dimensional it must (currently) be specified with its axes in world order, so transposed with respect to the data array.
-
classmethod
from_lookup_tables
(names, pixel_dimensions, lookup_tables)[source]¶ Construct an ExtraCoords instance from lookup tables.
This is a convience wrapper around
add
which does not expose all the options available in that method.- Parameters
array_shape (
tuple
ofint
, optional) – The shape of the array.pixel_dimensions (
tuple
ofint
) – The pixel dimensions (in the array) to which thelookup_tables
apply. Must be the same length aslookup_tables
.lookup_tables (
tuple
ofobject
) – The lookup tables which specify the world coordinates for thepixel_dimensions
.
- Returns
- Return type
ndcube.extra_coords.ExtraCoords