SpatialCoordMixinClass

class spectral_cube.base_class.SpatialCoordMixinClass[source]

Bases: object

Attributes Summary

latitude_extrema

longitude_extrema

spatial_coordinate_map

world

Return a list of the world coordinates in a cube, projection, or a view

world_extrema

Methods Summary

flattened_world([view])

Retrieve the world coordinates corresponding to the extracted flattened version of the cube

world_spines()

Returns a list of 1D arrays, for the world coordinates along each pixel axis.

Attributes Documentation

latitude_extrema
longitude_extrema
spatial_coordinate_map
world

Return a list of the world coordinates in a cube, projection, or a view of it.

SpatialCoordMixinClass.world is called with bracket notation, like a NumPy array:

c.world[0:3, :, :]
Returns:
[v, y, x]list of NumPy arrays

The 3 world coordinates at each pixel in the view. For a 2D image, the output is [y, x].

Notes

Supports efficient Numpy slice notation, like world[0:3, :, 2:4]

Examples

Extract the first 3 velocity channels of the cube:

>>> v, y, x = c.world[0:3]

Extract all the world coordinates:

>>> v, y, x = c.world[:, :, :]

Extract every other pixel along all axes:

>>> v, y, x = c.world[::2, ::2, ::2]

Extract all the world coordinates for a 2D image:

>>> y, x = c.world[:, :]
world_extrema

Methods Documentation

flattened_world(view=())[source]

Retrieve the world coordinates corresponding to the extracted flattened version of the cube

world_spines()[source]

Returns a list of 1D arrays, for the world coordinates along each pixel axis.

Raises error if this operation is ill-posed (e.g. rotated world coordinates, strong distortions)

This method is not currently implemented. Use world instead.