gwcs.coordinate_frames.EmptyFrame

class gwcs.coordinate_frames.EmptyFrame(name=None, naxes=None)

Bases: CoordinateFrameProtocol

Represents a “default” detector frame. This is for use as the default value for input frame by the WCS object.

Parameters:

Attributes

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

A custom name of this 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.

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

Names describing the axes of the frame.

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

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

property EmptyFrame.axes_type: AxesType

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.

property EmptyFrame.axis_physical_types

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

property EmptyFrame.name: str

A custom name of this frame.

property EmptyFrame.naxes: int

The number of axes described by this frame.

property EmptyFrame.reference_frame: None

The reference frame of the coordinates described by this frame.

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

property EmptyFrame.unit: tuple[None, ...]

The units of the axes in this frame.

property EmptyFrame.world_axis_object_classes: WorldAxisObjectClasses

The APE 14 object classes for this frame.

property EmptyFrame.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.

from_transform([name, transform])

Class method constructor to allow for an EmptyFrame to be created using data from a transform.

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.

EmptyFrame.add_units(arrays)

Add units to the arrays

Parameters:

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

Return type:

tuple[LowLevelInput, ...]

EmptyFrame.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.

  • correct_1d (bool, default: True)

Returns:

values – naxis number of coordinates as scalars or arrays.

Return type:

numbers.Number or numpy.ndarray

classmethod EmptyFrame.from_transform(name=None, transform=None)

Class method constructor to allow for an EmptyFrame to be created using data from a transform.

Notes

  • This assumes that the number of inputs to the transform corresponds to the

    number of axes in the frame. Therefore, this assumes that there are NO non-coordinate inputs present.

Parameters:
  • name (str | None, default: None) – Name of the frame. If None, defaults to “detector”.

  • transform (Mdl, default: None) – A transform from this step’s frame to next step’s frame. The transform of the last step should be None.

Returns:

An EmptyFrame object with the number of axes set based on the transform.

Return type:

Self

EmptyFrame.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

EmptyFrame.remove_units(arrays)

Remove units from the input arrays

Parameters:

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

Return type:

tuple[LowLevelInput, ...]

EmptyFrame.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:
Returns:

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

Return type:

object