gwcs.coordinate_frames.Frame2D

class gwcs.coordinate_frames.Frame2D(axes_order=(0, 1), unit=(Unit('pix'), Unit('pix')), axes_names=('x', 'y'), name=None, axes_type=None, axis_physical_types=None)

Bases: CoordinateFrame

A 2D coordinate frame.

Parameters:
  • axes_order (tuple[int, int], default: (0, 1)) – A dimension in the input data that corresponds to this axis.

  • unit (tuple[Unit, Unit], default: (Unit("pix"), Unit("pix"))) – Unit for each axis.

  • axes_names (tuple[str, str], default: ('x', 'y')) – Names of the axes in this frame.

  • name (str | None, default: None) – Name of this frame.

  • axes_type (tuple[AxisType | str, AxisType | str] | None, default: None)

  • axis_physical_types (tuple[str | None, str | None] | None, default: None)

Attributes

axes_names

Names of axes in the frame.

axes_order

A tuple of indices which map inputs to axes.

axes_type

Type of this frame, one of 'SPATIAL', 'SPECTRAL', 'TIME'.

axis_physical_types

The axis physical types for this frame.

name

A custom name of this frame.

naxes

The number of axes in this frame.

raw_properties

The raw FrameProperties object for this frame.

reference_frame

Reference frame, used to convert to world coordinate objects.

serialized_classes

This property is used by the low level WCS API in Astropy.

unit

The unit of 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.

property Frame2D.axes_names: tuple[str, ...]

Names of axes in the frame.

property Frame2D.axes_order: tuple[int, ...]

A tuple of indices which map inputs to axes.

property Frame2D.axes_type: tuple[AxisType | str, ...]

Type of this frame, one of ‘SPATIAL’, ‘SPECTRAL’, ‘TIME’.

property Frame2D.axis_physical_types: tuple[str | None, ...]

The axis physical types for this frame.

These physical types are the types in frame order, not transform order.

property Frame2D.name: str

A custom name of this frame.

property Frame2D.naxes: int

The number of axes in this frame.

property Frame2D.raw_properties: FrameProperties

The raw FrameProperties object for this frame.

property Frame2D.reference_frame: AstropyBuiltInFrame | None

Reference frame, used to convert to world coordinate objects.

property Frame2D.serialized_classes: bool

This property is used by the low level WCS API in Astropy.

By providing it we can duck type as a low level WCS object.

property Frame2D.unit: tuple[Unit, ...]

The unit of this frame.

property Frame2D.world_axis_object_classes: WorldAxisObjectClasses

The APE 14 object classes for this frame.

property Frame2D.world_axis_object_components: list[WorldAxisObjectComponent]

The APE 14 object components for this frame.

Methods

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.

is_high_level(*args)

Return True if the input coordinates are already high level objects described by this frame.

remove_units(arrays)

Remove units from the input arrays

to_high_level_coordinates(*values[, correct_1d])

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

Frame2D.add_units(arrays)

Add units to the arrays

Parameters:

arrays (tuple[LowLevelInput, ...] | LowLevelInput)

Return type:

tuple[LowLevelInput, ...]

Frame2D.from_high_level_coordinates(*high_level_coords, correct_1d=True)

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:

values – naxis number of coordinates as scalars or arrays.

Return type:

numbers.Number or numpy.ndarray

Frame2D.is_high_level(*args)

Return True if the input coordinates are already high level objects described by this frame.

This is used by the low level WCS API in Astropy to determine whether to call to_high_level_coordinates or not.

Return type:

bool

Frame2D.remove_units(arrays)

Remove units from the input arrays

Parameters:

arrays (tuple[LowLevelInput, ...] | LowLevelInput)

Return type:

tuple[LowLevelArray, ...]

Frame2D.to_high_level_coordinates(*values, correct_1d=True)

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:

values (numbers.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.

Return type:

object