API/Reference

Index

Types

SkyCoords.ICRSCoordsType
ICRSCoords(ra, dec)

International Celestial Reference System

This is the current standard adopted by the International Astronomical Union notably due to its high level of accuracy compared to standard equatorial coordinate systems. What sets this apart from FK5Coords is that it is completely defined using extragalactic radio sources rather than a geocentric frame, which means the reference frame will not change due to Earth's motion.

Coordinates

  • ra - Right ascension in radians (0, 2π)
  • dec - Declination in radians (-π/2, π/2)
source
SkyCoords.GalCoordsType
GalCoords(l, b)

Galactic Coordinate System

This coordinate system is defined based on the projection of the Milky Way galaxy onto our celestial sphere, with (0, 0) being approximately the center of our galaxy.

Coordinates

  • l - Galactic longitude in radians (-π, π)
  • b - Galactic latitude in radians (-π/2, π/2)
source
SkyCoords.FK5CoordsType
FK5Coords{equinox}(ra, dec)

Equatorial Coordinate System

This coordinate system maps the celestial sphere based on a geocentric observer. Historically the oldest, this coordinate system has been shown to be inaccurate due to its definitions based on the Earth, which has long-scale precession causing the reference frame to change. Because of this, an equinox must be provided (typically 2000, commonly known as J2000) which defines the reference frame.

Coordinates

  • ra - Right ascension in radians (0, 2π)
  • dec - Declination in radians (-π/2, π/2)
source
SkyCoords.EclipticCoordsType
EclipticCoords{equinox}(lon, lat)

Ecliptic Coordinate System

This coordinate system is geocentric with the ecliptic plane as the xy-plane with x oriented according to the equinox specified by equinox.

Coordinates

  • lon - Longitude in radians (0, 2π)
  • lat - Latitude in radians (-π/2, π/2)
source

Conversion

To convert between types, there are three (equivalent) methods of doing so.

julia> c1 = ICRSCoords(0., 0.)
ICRSCoords{Float64}(0.0, 0.0)
  • using convert
    julia> convert(GalCoords, c1)
    GalCoords{Float64}(1.6814027872278692, -1.0504884034813007)
  • using constructors
    julia> GalCoords(c1)
    GalCoords{Float64}(1.6814027872278692, -1.0504884034813007)
  • using |>
    julia> c1 |> GalCoords
    GalCoords{Float64}(1.6814027872278692, -1.0504884034813007)

Functions

SkyCoords.separationFunction
separation(c1::AbstractSkyCoords, c2::AbstractSkyCoords) -> distance

Return angular separation between two sky coordinates, in radians.

The angular separation is calculated using the Vincenty formula, which is slightly more complex and computationally expensive than some alternatives, but is stable at at all distances, including the poles and antipodes.

source
SkyCoords.position_angleFunction
position_angle(c1::AbstractSkyCoords, c2::AbstractSkyCoords) -> angle

Return position angle between two sky coordinates, in positive radians.

Examples

julia> c1 = ICRSCoords(0, 0); c2 = ICRSCoords(deg2rad(1), 0);

julia> position_angle(c1, c2) |> rad2deg
90.0
source
SkyCoords.offsetFunction
offset(::AbstractSkyCoords, separation, pa) -> coordinate

Offset a coordinate by a given angular separation, separation, in radians and position angle, pa, in radians.

Uses the sine and cosine rules in spherical coordinates with corrections for the antipodes. Returns a sky coordinate of the same type as input.

Examples

julia> c1 = ICRSCoords(0, 0);

julia> c2 = offset(c1, deg2rad(1), deg2rad(90))
ICRSCoords{Float64}(0.017453292519943295, 1.0686516840418957e-18)

julia> offset(c1, c2) .|> rad2deg
(1.0, 90.0)

See Also

source
offset(::AbstractSkyCoords, AbstractSkyCoords) -> angle, angle

Return the separation and position angle in radians between two sky coordinates.

Examples

julia> c1 = ICRSCoords(0, 0); c2 = ICRSCoords(deg2rad(1), 0);

julia> offset(c1, c2) .|> rad2deg
(1.0, 90.0)

See Also

source