# Coordinate Transforms¶

## Numpy¶

 radec_to_lm(radec[, phase_centre]) Converts Right-Ascension/Declination coordinates in radians to a Direction Cosine lm coordinates, relative to the Phase Centre. radec_to_lmn(radec[, phase_centre]) Converts Right-Ascension/Declination coordinates in radians to a Direction Cosine lm coordinates, relative to the Phase Centre. lm_to_radec(lm[, phase_centre]) Convert Direction Cosine lm coordinates to Right Ascension/Declination coordinates in radians, relative to the Phase Centre. lmn_to_radec(lmn[, phase_centre]) Convert Direction Cosine lm coordinates to Right Ascension/Declination coordinates in radians, relative to the Phase Centre.
africanus.coordinates.radec_to_lm(radec, phase_centre=None)[source]

Converts Right-Ascension/Declination coordinates in radians to a Direction Cosine lm coordinates, relative to the Phase Centre.

\begin{eqnarray} & l =& \, \cos \, \delta \sin \, \Delta \alpha \\ & m =& \, \sin \, \delta \cos \, \delta 0 - \cos \delta \sin \delta 0 \cos \Delta \alpha \\ & n =& \, \sqrt{1 - l^2 - m^2} - 1 \end{eqnarray}

where $$\Delta \alpha = \alpha - \alpha 0$$ is the difference between the Right Ascension of each coordinate and the phase centre and $$\delta 0$$ is the Declination of the phase centre.

Parameters: radec : numpy.ndarray radec coordinates of shape (coord, 2) where Right-Ascension and Declination are in the last 2 components, respectively. phase_centre : numpy.ndarray, optional radec coordinates of the Phase Centre. Shape (2,) numpy.ndarray lm Direction Cosines of shape (coord, 2)
africanus.coordinates.radec_to_lmn(radec, phase_centre=None)[source]

Converts Right-Ascension/Declination coordinates in radians to a Direction Cosine lm coordinates, relative to the Phase Centre.

\begin{eqnarray} & l =& \, \cos \, \delta \sin \, \Delta \alpha \\ & m =& \, \sin \, \delta \cos \, \delta 0 - \cos \delta \sin \delta 0 \cos \Delta \alpha \\ & n =& \, \sqrt{1 - l^2 - m^2} - 1 \end{eqnarray}

where $$\Delta \alpha = \alpha - \alpha 0$$ is the difference between the Right Ascension of each coordinate and the phase centre and $$\delta 0$$ is the Declination of the phase centre.

Parameters: radec : numpy.ndarray radec coordinates of shape (coord, 2) where Right-Ascension and Declination are in the last 2 components, respectively. phase_centre : numpy.ndarray, optional radec coordinates of the Phase Centre. Shape (2,) numpy.ndarray lm Direction Cosines of shape (coord, 3)
africanus.coordinates.lm_to_radec(lm, phase_centre=None)[source]

Convert Direction Cosine lm coordinates to Right Ascension/Declination coordinates in radians, relative to the Phase Centre.

\begin{eqnarray} & \delta = & \, \arcsin \left( m \cos \delta 0 + n \sin \delta 0 \right) \\ & \alpha = & \, \arctan \left( \frac{l}{n \cos \delta 0 - m \sin \delta 0} \right) \\ \end{eqnarray}

where $$\alpha$$ is the Right Ascension of each coordinate and the phase centre and $$\delta 0$$ is the Declination of the phase centre.

Parameters: lm Direction Cosines of shape (coord, 2) phase_centre : numpy.ndarray, optional radec coordinates of the Phase Centre. Shape (2,) numpy.ndarray radec coordinates of shape (coord, 2) where Right-Ascension and Declination are in the last 2 components, respectively.
africanus.coordinates.lmn_to_radec(lmn, phase_centre=None)[source]

Convert Direction Cosine lm coordinates to Right Ascension/Declination coordinates in radians, relative to the Phase Centre.

\begin{eqnarray} & \delta = & \, \arcsin \left( m \cos \delta 0 + n \sin \delta 0 \right) \\ & \alpha = & \, \arctan \left( \frac{l}{n \cos \delta 0 - m \sin \delta 0} \right) \\ \end{eqnarray}

where $$\alpha$$ is the Right Ascension of each coordinate and the phase centre and $$\delta 0$$ is the Declination of the phase centre.

Parameters: lm Direction Cosines of shape (coord, 3) phase_centre : numpy.ndarray, optional radec coordinates of the Phase Centre. Shape (2,) numpy.ndarray radec coordinates of shape (coord, 2) where Right-Ascension and Declination are in the last 2 components, respectively.

 radec_to_lm(radec[, phase_centre]) Converts Right-Ascension/Declination coordinates in radians to a Direction Cosine lm coordinates, relative to the Phase Centre. radec_to_lmn(radec[, phase_centre]) Converts Right-Ascension/Declination coordinates in radians to a Direction Cosine lm coordinates, relative to the Phase Centre. lm_to_radec(lm[, phase_centre]) Convert Direction Cosine lm coordinates to Right Ascension/Declination coordinates in radians, relative to the Phase Centre. lmn_to_radec(lmn[, phase_centre]) Convert Direction Cosine lm coordinates to Right Ascension/Declination coordinates in radians, relative to the Phase Centre.
africanus.coordinates.dask.radec_to_lm(radec, phase_centre=None)[source]

Converts Right-Ascension/Declination coordinates in radians to a Direction Cosine lm coordinates, relative to the Phase Centre.

\begin{eqnarray} & l =& \, \cos \, \delta \sin \, \Delta \alpha \\ & m =& \, \sin \, \delta \cos \, \delta 0 - \cos \delta \sin \delta 0 \cos \Delta \alpha \\ & n =& \, \sqrt{1 - l^2 - m^2} - 1 \end{eqnarray}

where $$\Delta \alpha = \alpha - \alpha 0$$ is the difference between the Right Ascension of each coordinate and the phase centre and $$\delta 0$$ is the Declination of the phase centre.

Parameters: radec coordinates of shape (coord, 2) where Right-Ascension and Declination are in the last 2 components, respectively. phase_centre : dask.array.Array, optional radec coordinates of the Phase Centre. Shape (2,) dask.array.Array lm Direction Cosines of shape (coord, 2)
africanus.coordinates.dask.radec_to_lmn(radec, phase_centre=None)[source]

Converts Right-Ascension/Declination coordinates in radians to a Direction Cosine lm coordinates, relative to the Phase Centre.

\begin{eqnarray} & l =& \, \cos \, \delta \sin \, \Delta \alpha \\ & m =& \, \sin \, \delta \cos \, \delta 0 - \cos \delta \sin \delta 0 \cos \Delta \alpha \\ & n =& \, \sqrt{1 - l^2 - m^2} - 1 \end{eqnarray}

where $$\Delta \alpha = \alpha - \alpha 0$$ is the difference between the Right Ascension of each coordinate and the phase centre and $$\delta 0$$ is the Declination of the phase centre.

Parameters: radec coordinates of shape (coord, 2) where Right-Ascension and Declination are in the last 2 components, respectively. phase_centre : dask.array.Array, optional radec coordinates of the Phase Centre. Shape (2,) dask.array.Array lm Direction Cosines of shape (coord, 3)
africanus.coordinates.dask.lm_to_radec(lm, phase_centre=None)[source]

Convert Direction Cosine lm coordinates to Right Ascension/Declination coordinates in radians, relative to the Phase Centre.

\begin{eqnarray} & \delta = & \, \arcsin \left( m \cos \delta 0 + n \sin \delta 0 \right) \\ & \alpha = & \, \arctan \left( \frac{l}{n \cos \delta 0 - m \sin \delta 0} \right) \\ \end{eqnarray}

where $$\alpha$$ is the Right Ascension of each coordinate and the phase centre and $$\delta 0$$ is the Declination of the phase centre.

Parameters: lm Direction Cosines of shape (coord, 2) phase_centre : dask.array.Array, optional radec coordinates of the Phase Centre. Shape (2,) dask.array.Array radec coordinates of shape (coord, 2) where Right-Ascension and Declination are in the last 2 components, respectively.
africanus.coordinates.dask.lmn_to_radec(lmn, phase_centre=None)[source]

Convert Direction Cosine lm coordinates to Right Ascension/Declination coordinates in radians, relative to the Phase Centre.

\begin{eqnarray} & \delta = & \, \arcsin \left( m \cos \delta 0 + n \sin \delta 0 \right) \\ & \alpha = & \, \arctan \left( \frac{l}{n \cos \delta 0 - m \sin \delta 0} \right) \\ \end{eqnarray}

where $$\alpha$$ is the Right Ascension of each coordinate and the phase centre and $$\delta 0$$ is the Declination of the phase centre.

Parameters: lm Direction Cosines of shape (coord, 3) phase_centre : dask.array.Array, optional radec coordinates of the Phase Centre. Shape (2,) dask.array.Array radec coordinates of shape (coord, 2) where Right-Ascension and Declination are in the last 2 components, respectively.