yaw.core.coordinates.CoordSky#

class yaw.core.coordinates.CoordSky(ra: ArrayLike, dec: ArrayLike)[source]#

Bases: Coordinate

A representation of a vector of angular coordinates in radian.

Angles follow the astronomical convention of R.A./Dec., i.e. declination values are in the range of [\(-\pi\), \(\pi\)].

Create a new coordinate vector.

Parameters:
  • ra (float, NDArray) – The right ascension coordinate(s).

  • dec (float, NDArray) – The declination coordinate(s).

Note

The coordinate vector has a length, supports numpy-style indexing and iteration over the elements (always returning new coordinate vector instances).

Methods

__init__(ra, dec)

Create a new coordinate vector.

distance(other)

Compute the angular distance in radian between two coordinate vectors.

from_array(array)

Create a new coordinate vector from an array of tuples of (ra, dec).

from_coords(coords)

Concatenate a sequence of coordinates into a new vector of coordates.

mean()

The mean coordinate (mean over all dimensions).

to_3d()

Get the coordinates as 3-dim Euclidean coordiante Coord3D.

to_sky()

Get the coordinates as angular coordiante CoordSky in radian.

Attributes

dim

A list of names of coordinates in the coordinate system.

ndim

The number of coordinates in the coordinate system.

values

The coordinate values cast into a numpy array with shape (N, ndim) or (ndim,) if there is only a single entry.

ra

The right ascension coordinate(s).

dec

The declination coordinate(s).

dec: NDArray#

The declination coordinate(s).

property dim: tuple[str]#

A list of names of coordinates in the coordinate system.

distance(other: Coordinate) DistSky[source]#

Compute the angular distance in radian between two coordinate vectors.

Coordinates are automatically converted before distance calculation.

Parameters:

other (Coordinate) – Second coordinate vector.

Returns:

Angular distance in radian between points in this and the other vector.

Return type:

DistSky

classmethod from_array(array)[source]#

Create a new coordinate vector from an array of tuples of (ra, dec).

classmethod from_coords(coords: Sequence[CoordSky]) CoordSky[source]#

Concatenate a sequence of coordinates into a new vector of coordates.

mean() Coord3D[source]#

The mean coordinate (mean over all dimensions).

property ndim: int#

The number of coordinates in the coordinate system.

ra: NDArray#

The right ascension coordinate(s).

to_3d() Coord3D[source]#

Get the coordinates as 3-dim Euclidean coordiante Coord3D.

to_sky() CoordSky[source]#

Get the coordinates as angular coordiante CoordSky in radian.

Warning

During conversion, points loose their radial information. After back-transformation to Coord3D they lie on the unit sphere.

property values: NDArray[np.float64]#

The coordinate values cast into a numpy array with shape (N, ndim) or (ndim,) if there is only a single entry.