WCSCoordinates

class glue.core.coordinates.WCSCoordinates(header=None, wcs=None)[source]

Bases: glue.core.coordinates.Coordinates

Class for coordinate transformation based on the WCS FITS standard. This class does not take into account distortions.

Parameters
headerastropy.io.fits.Header

FITS header (derived from WCS if not given)

wcsastropy.wcs.WCS

WCS object to use, if different from header

References

  • Greisen & Calabretta (2002), Astronomy and Astrophysics, 395, 1061

  • Calabretta & Greisen (2002), Astronomy and Astrophysics, 395, 1077

  • Greisen, Calabretta, Valdes & Allen (2006), Astronomy and Astrophysics, 446, 747

Attributes Summary

header

wcs

Methods Summary

axis_label(self, axis)

default_world_coords(self, ndim)

dependent_axes(self, axis)

Return a tuple of which world-axes are non-independent from a given pixel axis

pixel2world(self, \*pixel)

Convert pixel to world coordinates, preserving input type/shape.

world2pixel(self, \*world)

Convert world to pixel coordinates, preserving input type/shape.

world_axis_unit(self, axis)

Return the unit of the world coordinate given by axis (assuming the Numpy axis order)

Attributes Documentation

header
wcs

Methods Documentation

axis_label(self, axis)[source]
default_world_coords(self, ndim)[source]
dependent_axes(self, axis)[source]

Return a tuple of which world-axes are non-independent from a given pixel axis

The axis index is given in numpy ordering convention (note that opposite the fits convention)

pixel2world(self, *pixel)[source]

Convert pixel to world coordinates, preserving input type/shape.

Parameters
*pixelscalars lists, or Numpy arrays

The pixel coordinates (0-based) to convert

Returns
*worldNumpy arrays

The corresponding world coordinates

world2pixel(self, *world)[source]

Convert world to pixel coordinates, preserving input type/shape.

Parameters
*worldscalars lists, or Numpy arrays

The world coordinates to convert

Returns
*pixelNumpy arrays

The corresponding pixel coordinates

world_axis_unit(self, axis)[source]

Return the unit of the world coordinate given by axis (assuming the Numpy axis order)