CoordinateFrameProtocol

class gwcs.coordinate_frames.CoordinateFrameProtocol(*args, **kwargs)[source]

Bases: Protocol

API Definition for a Coordinate frame

Attributes Summary

axes_names

Names describing the axes of the frame.

axes_order

The position of the axes in the frame in the transform.

axes_type

An upcase string (or tuple of strings) describing the type of the axis.

axis_physical_types

The UCD 1+ physical types for the axes, in frame order.

name

The name of the coordinate frame.

naxes

The number of axes described by this frame.

reference_frame

The reference frame of the coordinates described by this frame.

unit

The units of the axes in this frame.

world_axis_object_classes

The APE 14 object classes for this frame.

world_axis_object_components

The APE 14 object components for this frame.

Methods Summary

add_units(arrays)

Add units to the arrays

from_high_level_coordinates(*high_level_coords)

Convert high level coordinate objects to "values" as described by this frame.

remove_units(arrays)

Remove units from the input arrays

to_high_level_coordinates(*values)

Convert "values" to high level coordinate objects described by this frame.

Attributes Documentation

axes_names

Names describing the axes of the frame.

axes_order

The position of the axes in the frame in the transform.

axes_type

An upcase string (or tuple of strings) describing the type of the axis.

See AxisType for the known values, but you can also use your own custom one.

axis_physical_types

The UCD 1+ physical types for the axes, in frame order.

name

The name of the coordinate frame.

naxes

The number of axes described by this frame.

reference_frame

The reference frame of the coordinates described by this frame.

This is usually an Astropy object such as SkyCoord or Time.

unit

The units of the axes in this frame.

world_axis_object_classes

The APE 14 object classes for this frame.

world_axis_object_components

The APE 14 object components for this frame.

Methods Documentation

add_units(arrays: tuple[ndarray[tuple[Any, ...], dtype[generic]] | Quantity, ...] | ndarray[tuple[Any, ...], dtype[generic]] | Quantity) tuple[ndarray[tuple[Any, ...], dtype[generic]] | Quantity, ...][source]

Add units to the arrays

from_high_level_coordinates(*high_level_coords)[source]

Convert high level coordinate objects to “values” as described by this frame.

“values” are the coordinates in array or scalar form, and high level objects are things such as SkyCoord or Quantity. See Shared Python Interface for World Coordinate Systems for details.

Parameters:
high_level_coordinates

One (or more) high level object describing the coordinate.

Returns:
valuesnumbers.Number or numpy.ndarray

naxis number of coordinates as scalars or arrays.

remove_units(arrays: tuple[ndarray[tuple[Any, ...], dtype[generic]] | Quantity, ...] | ndarray[tuple[Any, ...], dtype[generic]] | Quantity) tuple[ndarray[tuple[Any, ...], dtype[generic]], ...][source]

Remove units from the input arrays

to_high_level_coordinates(*values)[source]

Convert “values” to high level coordinate objects described by this frame.

“values” are the coordinates in array or scalar form, and high level objects are things such as SkyCoord or Quantity. See Shared Python Interface for World Coordinate Systems for details.

Parameters:
valuesnumbers.Number, numpy.ndarray, or Quantity

naxis number of coordinates as scalars or arrays.

Returns:
high_level_coordinates

One (or more) high level object describing the coordinate.